I’ve installed the agent-setup on my Xeams and 3CX servers by following this manual:
And copied the check_systemd_service.sh to the /usr/lib/check_mk_agent/local folder and applied the chmod x command.
When I execute the script against the service. The returned result is that the service is running.
e.g. ./usr/lib/check_mk_agent/local/check_systemd_service xeams
OK: service xeams is running
Yet on my Librenms server the service is not checking (or returning the result) of my service. It only states “Usage: check_systemd_service”.
Used service:
Testing with different parameters are not working.
I’ve tried Xeams, xeams, ./check_systemd_service xeams, ./check_systemd_service.sh xeams, ./usr/lib/check_mk_agent/local/check_systemd_service xeams, …
Any ideas?
Pretty new to the whole Librenms system, so might be an oversight on my part.
Service checks run on the LibreNMS poller itself. So if you used check_http for example, with an IP address of 192.168.2.22, all the poller does is locally run something like check_http -H 192.168.2.22. If you need to add something to that command, like if you’re checking http on port 8080 instead of 80, you would add in -p 8080 in the parameters field. Not the whole command.
From what I can tell, check_systemd_service.sh can only check services on a local machine; no remote check option. So for that to work you need some way of running the script on the remote machine and pulling the data back to LibreNMS (like NRPE or check_by_ssh).
Like you, I’ve got the check_mk agent running on my remote Linux servers so I’ve been playing with this (it’s experimental). But it allows you to use the check_mk agent to execute the local script and get it to LibreNMS via MRPE.
If you’re interested in that, on your Xeams server, you might add something like…
Then you would download that check_mrpe file into your LibreNMS server’s nagios plugins location (usually
/usr/lib/nagios/plugins) and chmod +x it.
That should give you a mpre option in add services. Use that and set the IP address to the address of your Xeams server and set the parameters to -a XEAMS
No need for step 1. check_mpre only needs to be on the LibreNMS server. The check_mk agent needs to be on your Xeams server before you can do step 2 but I think you’ve got that already.
Bit stuck, where could I download the check_mk agent?
The command apt-get install check_mk_agent is not doing much. Nor does the check_mk site explains where you can fetch it from.
Both mrpe.cfg and the check_systemd_service.sh script would be on the Xeams server. What this does is it runs check_systemd_service.sh locally on your Xeams server and adds its output under <<<mrpe>>> in the check_mk agent’s output.
Then, the LibreNMS server reads this with the check_mpre script as a service.