Service monitoring of remote hosts

Hi Folks,

I would like to monitor Linux Processes of remote hosts to get more insight if they are up and running and also about a potential response time. The typical remote service monitoring from the LibreNMS host does not fly as these services are bound to localhost.

e.g.
root@mx1:~# sudo netstat -ltnp | grep 889
tcp 0 0 127.0.0.1:8891 0.0.0.0:* LISTEN 911/opendkim
tcp 0 0 127.0.0.1:8893 0.0.0.0:* LISTEN 878/opendmarc
tcp 0 0 127.0.0.1:8894 0.0.0.0:* LISTEN 4196/clamav-milter
tcp 0 0 127.0.0.1:8899 0.0.0.0:* LISTEN 575/clamd

The check_mk_agent is able to gather the processes for inventory but can it be also used to monitor if a service is up and running and if not to send an alert?

Is there a way to use “something” as a remote probe running locally on the remotehost itself as a “pingprobe” and report the results back to LibreNMS?

Thank you,
Wolfgang

Take a look to https://docs.librenms.org/#Extensions/Services/

are you saying that I simply install the nagios plugins on all my remote mailservers and then I can monitor all the services locally while my central LibreNMS server is pulling the results via mk_agent ?

Well, to be honest, I’m not using nagios at the moment, but planning to do. You also have https://docs.librenms.org/#Extensions/Applications/ if you want to gather app stats

OK, I am well aware about all this :wink:

My point is that I need to monitor processes e.g. postfix which are NOT running on the LibreNMS Server itself and are somehow sub-processes of postfix (opendkim,opendmarc,clamav-milter,clamd, rspamd) and they all run for good reasons @localhost. Therefore no way to poll them externally (even if they are running on TCP ports) and hence my question if I am missing something or I can utilize existing LibreNMS tools to achieve this?

Oh. I understand you now.

Mmmmm…Tbh I dont know how you can do that.

Maybe you can use the agent to get the running processes and then put alerts on it

I use nagios plugins in /usr/lib/nagios/plugins
how test: ./check_tcp -H host/ip -p port
for help command: ./check_tcp -h
ex: for monitor service on tcp port 5555 cretae new service “tcp” and put in parameter “-p 5555”
If you need monitor services, not only external ports, try nagios nrpe, install in your host and in librenms use check_nrpe. In your host configure nrpe.cfg, in allowed hosts put librenms ip then restart nrpe service.

I’m using check_mk to monitor remote services. You will get a service-menu when enabling the unix-agent module on the LibreNMS server and installing the check_mk agent on the remote host. I then have an alert rule like “Inverted processes.command LIKE ‘%postfix%’” to monitor the services.

Hi Folks,
many thanks for your replies and sorry for not being precise enough :wink:
My ask had been about monitoring remote services which are bound to localhost / 127.0.0.1 on a the remote machine. So no way to monitor their status from the LibreNMS Server itself.
Yes I am running check_mk on the remote machine and therefore my ask how I can monitor processe bound to localhost with check_mk :wink:
Wolfgang

Hi Peter,
OK let me give this a try.

Many thanks,
Wolfgang