Page 1 of 1

O/S requires an update, while all is up to date

Posted: Wed Nov 28, 2012 9:52 am
by mitch2k
Hi,

I have added some remote linux servers (CentOS) using the wizard. At first, everything worked fine (14 days now), but today I received a mail telling me that one of servers had a warning: YUM WARNING: O/S requires an update.
Since I was convinced that it was just a package that needed to be updated, I ran the yum update command on the server. To my surprise, no updates where found. So Nagios XI tells that there are updates, but that's not true.

I digged some deeper,and used the sintax that check_yum uses to check for updates (yum check-update | grep -e i386 -e noarch -e x86_64 | grep -i -v excluding | wc -l). This gives 0 as result, indicating that there are no updates.
Anyone an idea why Nagios then throws a warning? Any way to troubleshoot this?

Thanks!

Re: O/S requires an update, while all is up to date

Posted: Wed Nov 28, 2012 10:34 am
by scottwilkerson
When the check runs it runs as the nagios user and we have seen that this check can have the results you mentioned as it is running as a different user. This is associated with caching.

If you run the following

Code: Select all

yum clean all 
su nagios -c 'yum clean all'

Re: O/S requires an update, while all is up to date

Posted: Wed Nov 28, 2012 12:02 pm
by mitch2k
Hi.

I tried this, but it states it needs to run as root

Code: Select all

root@zeus [~]# su nagios -c 'yum clean all'
Loaded plugins: fastestmirror
You need to be root to perform this command.

Re: O/S requires an update, while all is up to date

Posted: Wed Nov 28, 2012 12:39 pm
by scottwilkerson
Lets run it as root, just

Code: Select all

yum clean all 
Then run the command as both users to see if they match

Code: Select all

(yum check-update | grep -e i386 -e noarch -e x86_64 | grep -i -v excluding | wc -l)
su nagios -c '(yum check-update | grep -e i386 -e noarch -e x86_64 | grep -i -v excluding | wc -l)'

Re: O/S requires an update, while all is up to date

Posted: Thu Nov 29, 2012 1:23 am
by mitch2k
Hi,

I have ran yum clean all as root yesterday, but Nagios was still telling me that there where updates.
This night, suddenly the state of the check changed to OK, so I guess it's resolved now.

Thanks scottwilkerson!