matteocorti / check_updates

check_updates is a Nagios plugin to check if RedHat or Fedora system is up-to-date
https://matteocorti.github.io/check_updates/
GNU General Public License v3.0
20 stars 18 forks source link

foreman-protector on Red Hat Satellite systems break check_updates #28

Closed ofalk closed 4 years ago

ofalk commented 4 years ago

Hi! Running check_updates on a recent (eg. 6.6) Red Hat Satellite system leads to wrong results, due to the new plugin foreman-protector.

One can easily work around this issue with adding extra arguments, eg:

/usr/lib64/nagios/plugins/check_updates -a '--disableplugin=foreman-protector'

However, I'd prefer if check_updates automatically handles this correctly, by checking if the file

/etc/yum/pluginconf.d/foreman-protector.conf

exists and adds --disableplugin=foreman-protector automatically to the command line parameters.

Example:

# /usr/lib64/nagios/plugins/check_updates -t 60                                                                   
CHECK_UPDATES CRITICAL - your machine is running kernel 3.10.0-1062.7.1 but a newer version (3.10.0-1062.9.1) is installed: you should reboot, 5 security updates available | total_updates=4;0;0 security_updates=5;0;0                                           
WARNING: (security)
Use (security)                                                                                                                
to (security) 
Use (security)                                                                                                                
No (security) 

versus

# /usr/lib64/nagios/plugins/check_updates -a '--disableplugin=foreman-protector' -t 60                                  
CHECK_UPDATES CRITICAL - your machine is running kernel 3.10.0-1062.7.1 but a newer version (3.10.0-1062.9.1) is installed: you should reboot, 2 non-security updates available | total_updates=2;0;0 security_updates=0;0;0
microcode_ctl.x86_64                                                                                                                 
python-requests.noarch                                 

I'd love to dig myself into the source, but I'm very limited on time. :-(

Thanks a lot, Oliver

matteocorti commented 4 years ago

Dear Oliver, I just committed a new version. As I don't have a satellite instance where I can test, could you please check if it's OK? Matteo

ofalk commented 4 years ago

Hey @matteocorti !

Thanks that works perfectly and as expected! Thanks a lot for the quick fix (for reference: commit 46e9311ac81cff7a95add5805b51f246b013901e)

Oliver

matteocorti commented 4 years ago

I just released version 1.7.7 with the fix

ofalk commented 4 years ago

Awesome! That was real quick!! 👍