Check Service Host Remote Ubuntu


I’ve been trying for several days to monitor a service on a remote host not included in the nagios-plugin “Checks” without success.

In addition to installing the above package on LibreNMS and remote host (Ubuntu 22.04), where is hosted the Syslog-NG service that I need to monitor for my client.

I have created a simple script similar to the one in the tutorial hosted on Youtube from the LibreNMS channel (LibreNMS Services - YouTube) and added it as a service.

I attach the script:
[email protected]:/usr/lib/nagios/plugins$ cat
import os
import sys

output = os.system (‘systemctl is-active syslog-ng’)
print (output)

if output == 0:
print(“OK. Syslog-NG Service Running”)
print(“Critical. Syslog-NG Service Down”)

Running this script from the CLI I get the following:

  • From the remote server:
    [email protected]_remote:/usr/lib/nagios/plugins$ ./
    OK. Syslog-NG Service Running

  • From the LibreNMS server:
    [email protected]:/usr/lib/nagios/plugins$ ./
    Critical. Syslog-NG Service Down

  • From the LibreNMS server querying another host:
    [email protected]:/usr/lib/nagios/plugins$ ./ -H 172.X.X.X.X
    Critical. Syslog-NG Service Down

  • The same thing happens from WebUI (as expected):

Both hosts are on the same subnet. LibreNMS is monitoring it correctly.

Attached is ./validate.php
[email protected]:/opt/librenms$ ./validate.php

Component Version
LibreNMS 22.8.0-102-gfd6fdeeb5
DB Schema 2022_09_03_091314_update_ports_adsl_table_with_defaults (246)
PHP 8.1.8
Python 3.10.4
Database MariaDB 10.6.7-MariaDB-2ubuntu1.1
RRDTool 1.7.2
SNMP 5.9.1


[OK] Composer Version: 2.4.2
[OK] Dependencies up-to-date.
[OK] Database connection successful
[OK] Database Schema is current
[OK] SQL Server meets minimum requirements
[OK] lower_case_table_names is enabled
[OK] MySQL engine is optimal
[OK] Database schema correct
[OK] MySQl and PHP time match
[OK] Active pollers found
[OK] Dispatcher Service not detected
[OK] Locks are functional
[OK] Python poller wrapper is polling
[OK] Redis is unavailable
[OK] rrd_dir is writable
[OK] rrdtool version ok
[email protected]@librenms:/opt/librenms$

I would be very grateful if you could help me.

Thank you.