Osupdate: what keeps overwriting my poller data?

Hi,

I’m using osupdate to track if systems have outstanding updates. This works fine on Ubuntu workstations, but on the Librenms Debian server itself, I have a weird issue. Any help is welcome.

validate.php: I don’t think the missing python package and smokeping files are relevant, the python package is discussed here.

When I run the poller manually, it fetches the correct value and writes to the database:


$ /opt/librenms/poller.php -h localhost -d -f -m applications | grep -A 1 os-updates
Application: os-updates, app_id=19SNMP['/usr/bin/snmpget' '-v2c' '-c' 'COMMUNITY' '-Oqv' '-m' 'NET-SNMP-EXTEND-MIB' '-M' '/opt/librenms/mibs' 'udp:HOSTNAME:161' '.1.3.6.1.4.1.8072.1.3.2.4.1.2.8.111.115.117.112.100.97.116.101.1']
0  <<<<< correct
MariaDB [librenms]> SELECT hostname,app_state,app_status FROM devices,applications WHERE devices.device_id = applications.device_id AND applications.app_status >= 0 AND applications.app_type = "os-updates";
+----------------+-----------+------------+
| hostname       | app_state | app_status |
+----------------+-----------+------------+
| host1            | OK        | 0          |
| host2            | OK        | 1          |
| host3            | OK        | 112      |
| localhost       | OK        | 0         |   <<<<<<<
+----------------+-----------+------------+

Then always a few minutes later, the values get overwritten:

MariaDB [librenms]> SELECT hostname,app_state,app_status FROM devices,applications WHERE devices.device_id = applications.device_id AND applications.app_status >= 0 AND applications.app_
type = "os-updates";
+----------------+-----------+------------+
| hostname       | app_state | app_status |
+----------------+-----------+------------+
| host1            | OK        | 0          |
| host2            | OK        | 1          |
| host3            | OK        | 112      |
| localhost      | UNKNOWN   |            | <<<< 

From the mariadb log, these are the guilty queries:

43079 Prepare	update `applications` set `app_state` = ?, `app_state_prev` = ?, `app_status` = ?, `timestamp` = NOW() where `app_id` = ?
43079 Execute	update `applications` set `app_state` = 'UNKNOWN', `app_state_prev` = 'OK', `app_status` = '', `timestamp` = NOW() where `app_id` = 19

The only thing I can find is that in the Discovery log, two available applications show: osupdate and os-updates, which doesn´t make sense:

#### Load disco module applications ####

Applications: 
SNMP['/usr/bin/snmpbulkwalk' '-v2c' '-c' 'COMMUNITY' '-OQUs' '-m' 'NET-SNMP-EXTEND-MIB' '-M' '/opt/librenms/mibs' 'udp:HOSTNAME:161' 'nsExtendStatus']

nsExtendStatus."distro" = active
nsExtendStatus."serial" = active
nsExtendStatus."hardware" = active
nsExtendStatus."osupdate" = active
nsExtendStatus."ups-apcups" = active
nsExtendStatus."manufacturer" = active  

Available: [.....] opensips, os-updates, php-fpm, pi-hole, portactivity, [........] fbsdnfsclient, fbsdnfsserver, mailq, osupdate, phpfpmsp, [......]
  • What is causing these queries?
  • How can I correct the list of applications?
  • Any other ideas?

What user are you running the poller command as when you test it?

As librenms on the commandline or in the webui Poller debug. Same result.

Are you running librenms via cron or the service?

33   */6  * * *   librenms    /opt/librenms/cronic /opt/librenms/discovery-wrapper.py 1
*/5  *    * * *   librenms    /opt/librenms/discovery.php -h new >> /dev/null 2>&1
*/5  *    * * *   librenms    /opt/librenms/cronic /opt/librenms/poller-wrapper.py 16
*    *    * * *   librenms    /opt/librenms/alerts.php >> /dev/null 2>&1
*/5  *    * * *   librenms    /opt/librenms/poll-billing.php >> /dev/null 2>&1
01   *    * * *   librenms    /opt/librenms/billing-calculate.php >> /dev/null 2>&1
*/5  *    * * *   librenms    /opt/librenms/check-services.php >> /dev/null 2>&1
*    *    * * *   librenms    cd /opt/librenms/ && php artisan schedule:run >> /dev/null 2>&1

So cron runs with a limited environment compared to your standard shell, try running this as the librenms user env -i /bin/bash --noprofile --norc then run your poller command to test again.

Ok, I did, it doesn’t seem to make a difference?


librenms@localhost:/opt/librenms/$ env -i /bin/bash --noprofile --norc
bash-5.2$ /opt/librenms/poller.php -h localhost -d -f -m applications | grep -A 1 os-updates
Application: os-updates, app_id=19SNMP['/usr/bin/snmpget' '-v2c' '-c' 'COMMUNITY' '-Oqv' '-m' 'NET-SNMP-EXTEND-MIB' '-M' '/opt/librenms/mibs' 'udp:HOSTNAME:161' '.1.3.6.1.4.1.8072.1.3.2.4.1.2.8.111.115.117.112.100.97.116.101.1']
0 <<<< expected outcome

Ok, I’m out of ideas I’m afraid.

Ok, thanks for trying!

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.