Lusitaniae / apache_exporter

Prometheus exporter for Apache.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Errors Running as a Windows Service

eagle-rr opened this issue · 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?

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
commented

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.