Page 1 of 1

Persistent Yum Updates warnings

Posted: Wed Aug 01, 2018 2:37 pm
by amunter
Hello,

I'm running XI version 5.5.2 using the vmware appliance.

I'm seeing something weird with a couple of the Linux servers I monitor. On two of them out of 13 I get persistent Yum Updates warnings that say that there are packages requiring update. When I go on those servers and do yum updates I see no updates available. I can even enable EPEL and get updates from there in case nrpe is finding those too, but still it reports that updates are available. I found an old help for someone that suggested doing a "yum clean all" as root and as the nagios user. I've done that. The nagios user gets an error trying to clean packages, but they're all cleaned out by root. Still no change.

What do I need to do to get it to be correct?

Thanks.

Re: Persistent Yum Updates warnings

Posted: Wed Aug 01, 2018 4:29 pm
by scottwilkerson
you would want to do the yum clean all as the root user

Re: Persistent Yum Updates warnings

Posted: Wed Aug 01, 2018 4:42 pm
by lmiltchev
If you opened the "check_yum" plugin in a text editor, you would see that it uses the "yum check-update" command.

Code: Select all

$yum = system("yum check-update >/dev/null");
If the exit code is NOT 0 (zero), it returns WARNING.

From the yum manual:
check-update
Implemented so you could know if your machine had any updates that needed to be applied without running it interactively.
Returns exit value of 100 if there are packages available for an update. Also returns a list of the packages to be updated
in list format. Returns 0 if no packages are available for update. Returns 1 if an error occurred. Running in verbose
mode also shows obsoletes.
What do you see, when you run the following commands on the remote machine?

Code: Select all

yum check-update
echo $?

Re: Persistent Yum Updates warnings

Posted: Thu Aug 02, 2018 9:07 am
by amunter
I'm getting

Code: Select all

Loaded plugins: product-id, search-disabled-repos

[Errno 13] Permission denied: '//var/lib/yum/rpmdb-indexes/version'
If I run as anything other than root. I believe that's what is causing it, but only for 2 out of those 13 machines I'm monitoring. On other machines I am able to run the command as a non-root user.

It doesn't seem to be an selinux related thing.

Re: Persistent Yum Updates warnings

Posted: Thu Aug 02, 2018 9:21 am
by lmiltchev
Run the following command as root to see if this is going to fix the permissions issue:

Code: Select all

chmod go+r /var/lib/yum/rpmdb-indexes/*
Then, try your command again as a "non-root" user.

Re: Persistent Yum Updates warnings

Posted: Thu Aug 02, 2018 9:27 am
by amunter
OK. I tried that command to give permissions on that directory. Before doing that I'd done a yum clean all as root again, though, so that directory didn't have contents...

Here is the output:

Code: Select all

Loaded plugins: product-id, refresh-packagekit, search-disabled-repos, subscription-manager
Repo rhel-6-server-rpms forced skip_if_unavailable=True due to: /etc/pki/entitlement/234234234289234234-key.pem
Repo rhel-6-server-optional-rpms forced skip_if_unavailable=True due to: /etc/pki/entitlement/234234234289234234-key.pem
https://cdn.redhat.com/content/dist/rhel/server/6/6Server/i386/optional/os/repodata/repomd.xml: [Errno 14] problem with the local client certificate
Trying other mirror.
https://cdn.redhat.com/content/dist/rhel/server/6/6Server/i386/os/repodata/repomd.xml: [Errno 14] problem with the local client certificate
Trying other mirror.
But now the return code is 0 so the warnings went away. I'm not confident that the update check is actually doing anything, though.

Re: Persistent Yum Updates warnings

Posted: Thu Aug 02, 2018 9:45 am
by lmiltchev
This error:
[Errno 14] problem with the local client certificate
Trying other mirror.
has nothing to do with our plugin... According to RedHat, the root cause for it is this:
The system is subscribed to both Red Hat Subscription Manager and Red Hat Network. When yum is initiated, the subscription-manager and rhnclient plugins conflict.
Here's an article, providing a solution for you:
https://access.redhat.com/solutions/57835

Thank you!

Re: Persistent Yum Updates warnings

Posted: Thu Aug 02, 2018 9:52 am
by amunter
Interesting. I don't get those messages when running the update check as root. I'll give that a try, though.

Re: Persistent Yum Updates warnings

Posted: Thu Aug 02, 2018 10:00 am
by amunter
I'm not subscribed to both, but in looking at the error message more carefully and checking up through your previous suggestion about the yum cache permission I decided to try giving permission to the entitlements key to the nagios user.

Did

Code: Select all

# chmod o+r /etc/pki/entitlements/*
and now it works.

Thanks for the suggestions.

Re: Persistent Yum Updates warnings

Posted: Thu Aug 02, 2018 10:02 am
by scottwilkerson
amunter wrote:I'm not subscribed to both, but in looking at the error message more carefully and checking up through your previous suggestion about the yum cache permission I decided to try giving permission to the entitlements key to the nagios user.

Did

Code: Select all

# chmod o+r /etc/pki/entitlements/*
and now it works.

Thanks for the suggestions.
Great! Locking