apache_exporter icon indicating copy to clipboard operation
apache_exporter copied to clipboard

Errors Running as a Windows Service

Open eagle-rr opened this issue 3 years ago • 2 comments

We are trying to run the Apache Exporter executable as a Windows service. When running the script using command-line; it works fine. As a windows service, we get the error:

Error 1053: The service did not respond to the start or control request in a timely fashion.

Any suggestions?

eagle-rr avatar Dec 02 '21 16:12 eagle-rr

I just ran into the same issue but could create a service with this tool: NSSM - the Non-Sucking Service Manager The .exe seems to be missing something that allows it running as service, but NSSM kinda works like a proxy to override this.

Here's an example how it could be installed with a batch file:

xcopy apache_exporter.exe "%PROGRAMFILES%\apache_exporter\"
xcopy nssm.exe "%PROGRAMFILES%\apache_exporter\"
"%PROGRAMFILES%\apache_exporter\nssm.exe" install apache_exporter "%PROGRAMFILES%\apache_exporter\apache_exporter.exe"
nssm set apache_exporter DependOnService Apache2.4
net start apache_exporter

basskitty avatar Mar 04 '22 11:03 basskitty

If someone tries to implement this https://github.com/prometheus-community/windows_exporter/blob/master/exporter.go#L466-L491 can be used as a template to add Windows Service funcionality to an Exporter.

splitt3r avatar May 17 '22 17:05 splitt3r