script_exporter icon indicating copy to clipboard operation
script_exporter copied to clipboard

Can't start as windows service

Open kissaev opened this issue 3 years ago • 2 comments

Service don't start with nssm. Anybody can start it succesfull?

kissaev avatar Jan 29 '22 18:01 kissaev

image

kissaev avatar Jan 30 '22 10:01 kissaev

Hi @kissaev, sorry for the late reply. I think the following should work:

# Create a service named "script_exporter"
sc create script_exporter binpath="%CD%\script_exporter-windows-amd64.exe -config.file=%CD%\config.yaml" start=auto DisplayName="script_exporter"
sc description script_exporter "Prometheus exporter to execute scripts and collect metrics from the output or the exit status."

# Start / stop the "script_exporter" service
net start script_exporter
net stop script_exporter

# Show current state of the "script_exporter" service
sc query script_exporter

# Delete the "script_exporter" service
sc delete script_exporter

Since I'm not on windows, I do not know if the same works for nssm.

ricoberger avatar Apr 30 '22 11:04 ricoberger

I would close the issue for now, if you have further questions please let me know.

ricoberger avatar Nov 30 '22 07:11 ricoberger