Skip to content

Commit 4e2e3a1

Browse files
committedMar 7, 2025·
Fix systemd unit for node_exporter
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
1 parent 959c32f commit 4e2e3a1

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed
 

‎cmd/system/nodeexporter.go

+9-3
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ func installNodeExporterE(cmd *cobra.Command, args []string) error {
101101
return err
102102
}
103103

104-
fmt.Printf("Wrote: %s\n", systemdUnit)
104+
fmt.Printf("Wrote: %s\n", unitName)
105105

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

114-
fmt.Printf("Started node_exporter\n")
114+
fmt.Printf(`Started service: node_exporter
115+
116+
Check status with: sudo journalctl -u node_exporter -f
117+
118+
View metrics at: http://127.0.0.1:9100/metrics
119+
120+
`)
115121

116122
}
117123
return nil
@@ -123,7 +129,7 @@ Description=Node Exporter
123129
After=network.target
124130
125131
[Service]
126-
ExecStart=%s/node_exporter
132+
ExecStart=%s
127133
128134
[Install]
129135
WantedBy=multi-user.target

0 commit comments

Comments
 (0)
Please sign in to comment.