Skip to content

Commit ba36538

Browse files
committed
Add initialization logs for agent startup
1 parent 0046605 commit ba36538

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

cmd/alpamon/command/root.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package command
22

33
import (
44
"fmt"
5+
"github.com/alpacanetworks/alpamon-go/pkg/version"
56
"os"
67
"syscall"
78

@@ -11,7 +12,6 @@ import (
1112
"github.com/alpacanetworks/alpamon-go/pkg/runner"
1213
"github.com/alpacanetworks/alpamon-go/pkg/scheduler"
1314
"github.com/alpacanetworks/alpamon-go/pkg/utils"
14-
"github.com/alpacanetworks/alpamon-go/pkg/version"
1515
"github.com/rs/zerolog/log"
1616
"github.com/spf13/cobra"
1717
)
@@ -40,10 +40,11 @@ func runAgent() {
4040
}
4141
defer func() { _ = os.Remove(pidFilePath) }()
4242

43+
fmt.Printf("alpamon version %s starting.\n", version.Version)
44+
4345
// Config & Settings
4446
settings := config.LoadConfig()
4547
config.InitSettings(settings)
46-
fmt.Printf("alpamon-go %s starting.\n", version.Version)
4748

4849
// Session
4950
session := scheduler.InitSession()
@@ -55,6 +56,7 @@ func runAgent() {
5556
// Logger
5657
logFile := logger.InitLogger()
5758
defer func() { _ = logFile.Close() }()
59+
log.Info().Msg("alpamon initialized and running.")
5860

5961
// Commit
6062
runner.CommitAsync(session, commissioned)

pkg/scheduler/reporter.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ func reportStartupEvent() {
5151
eventData, _ := json.Marshal(map[string]string{
5252
"reporter": "alpamon",
5353
"record": "started",
54-
"description": fmt.Sprintf("alpamon-go %s started running.", version.Version),
54+
"description": fmt.Sprintf("alpamon %s started running.", version.Version),
5555
})
5656

5757
Rqueue.Post(startUpEventURL, eventData, 10, time.Time{})

0 commit comments

Comments
 (0)