OS Updates not working for me

I just installed LibreNMS for first time, and got the unix-agent installed on my servers, and then the appropriate modules (Apache, Mysql, OS Updates). Both Apache and Mysql work great, however OS Updates is not working. I took a look at the file os-updates.sh specifically the line “elif [ $OS == ““centos”” ]; then”. I am using “Oracle Linux Server”. I did try to edit the script and change from “centos” to multiple different combinations of including “Oracle”. Nothing worked. When I run “./poller.php -h db1 -d -r -f -m applications, unix-agent” I get the following output;

SQL[UPDATE `applications` set `app_state` ='UNKNOWN',`app_status` ='',`timestamp` =NOW() WHERE `app_id` = '31']
RRD[update /opt/librenms/rrd/o7db1/app-os-updates-31.rrd N:U]

Even tried setting “os-release” to just NAME=“centos” with no luck. This is occurring on all servers. Any help would be much appreciated

Can you run ./validate.php and post the output, please.

Component | Version
--------- | -------
LibreNMS  | 1.31.03-46-g25bb27c
DB Schema | 206
PHP       | 5.6.31
MySQL     | 10.0.31-MariaDB-wsrep
RRDTool   | 1.4.8
SNMP      | NET-SNMP 5.7.2

[OK]    Database connection successful
[OK]    Database schema correct
[WARN]  Your install is over 24 hours out of date, last update: Fri, 15 Sep 2017 19:59:18 +0000
[WARN]  Your local git contains modified files, this could prevent automatic updates.
Modified files:

cat /etc/os-release
NAME="Oracle Linux Server"
PRETTY_NAME="Oracle Linux Server 7.4"


In looking at os-updates.sh, I just noticed line 33, which on my system:
cat /etc/os-release | awk -F= ‘/^ID=/{print $2}’
So I changed line 41 to read;
elif [ $OS == "ol" ]; then
Which still gives me

I ran without success;
./poller.php -h db1 -d -r -f -m applications, unix-agent

SQL[UPDATE `applications` set `app_state` ='UNKNOWN',`app_status` ='',`timestamp` =NOW() WHERE `app_id` = '31']
RRD[update /opt/librenms/rrd/o7db1/app-os-updates-31.rrd N:U]

I have never got os-updates working either. Just been such a low priority of LibreNMS issues I haven’t dug into it yet. A bit annoying, because if I run the script manually, I get a correct number, but the graphs are just all NaN. So it don’t think it’s an issue with os-updates.sh, but some other parsing along the way.

Has anyone else actually got this working?

I ended up changing line 41 to " elif [ $OS == ““ol”” ]; then" to which the poller gave me this:
SQL[UPDATEapplicationssetapp_state='OK',**app_status='Cannot open logfile /var/log/yum.log'**,timestamp=NOW() WHEREapp_id= '14']

Running this against another server it did seem to successfully work;
SQL[UPDATE applications set app_state =‘OK’,app_status =‘76’,timestamp =NOW() WHERE app_id = ‘31’]
RRD[update /opt/librenms/rrd/o7db1/app-os-updates-31.rrd N:76]
[RRD Disabled]

Yet nothing in graph on that server’s page. It seems like its really close to working, just missing something minor

Yes, I run it on more than a dozen servers with no issue. All are deb based though. Maybe there’s an issue with rpm based distris?

It is working now on a few servers I had changed line 41 to correctly ID my os from “\centos” to " ““ol””.

Strange this is after I did make that change running the poller manually was still showing me an error for that app. I go to bed and wake up, was looking around and see a few of these servers are now reporting number of packages.

Same here working with Centos and Ubuntu

Really? I have mostly all Ubuntu 16.04 servers atm, not a single one seems to be working.

Everything else has been graphing fine for about a week

on the server-side, everything looks fine


1 Like

Huh. Thanks @Kevin_Krumm :slight_smile:

idk its weird it works @Gorian

no, I think it’s that your config uses osupdate while mine uses os-updates :wink:

I put so much work into the bigger stuff on this project, and with no one double checking my work, I often miss the small things (not for lack of wanting :/) The other day I was deadlocking my database because i forget to pass the number of pollers to services-wrapper.py and it was running pollers with a single poller and taking far to long to finish, and i’d end up with 25 some poller-wrapper instances at the same time.