Skip to content

Commit

Permalink
Fix systemd unit for node_exporter
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <[email protected]>
  • Loading branch information
alexellis committed Mar 7, 2025
1 parent 959c32f commit 4e2e3a1
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions cmd/system/nodeexporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ func installNodeExporterE(cmd *cobra.Command, args []string) error {
return err
}

fmt.Printf("Wrote: %s\n", systemdUnit)
fmt.Printf("Wrote: %s\n", unitName)

if _, err = executeShellCmd(context.Background(), "systemctl", "daemon-reload"); err != nil {
return err
Expand All @@ -111,7 +111,13 @@ func installNodeExporterE(cmd *cobra.Command, args []string) error {
return err
}

fmt.Printf("Started node_exporter\n")
fmt.Printf(`Started service: node_exporter
Check status with: sudo journalctl -u node_exporter -f
View metrics at: http://127.0.0.1:9100/metrics
`)

}
return nil
Expand All @@ -123,7 +129,7 @@ Description=Node Exporter
After=network.target
[Service]
ExecStart=%s/node_exporter
ExecStart=%s
[Install]
WantedBy=multi-user.target
Expand Down

0 comments on commit 4e2e3a1

Please sign in to comment.