yum install nagios-plugins-check-updates
echo -e 'command[check_os_update]= sudo /var/lib64/nagios/plugins/check_updates -t 45 --boot-check_warning --critical=55' | tee /etc/nrpe.d/os_update.cfg systemctl restart nrpe.service
echo -e 'nrpe ALL=(root) NOPASSWD:/usr/lib64/nagios/plugins/check_updates' | tee /etc/sudoers.d/check_os_update
setsebool -P nagios_run_sudo 1
echo -e '#This is generally enforced by having Defaults requiretty in the /etc/sudoers.\n#Some Linux distributions have been known to have this as a default configuration. RedHat just recently removed this from Fedora and REHL, see Bug 1020147 (https://bugzilla.redhat.com/show_bug.cgi?id=1020147#c9)\nDefaults:nrpe !requiretty' | sudo tee -a /etc/sudoers.d/nrpe_requiretty
object CheckCommand "nrpe-check-1arg" { import "plugin-check-command" command = [PluginDir + "/check_nrpe" ] arguments = { "-H" = "$host$" "-c" = "$check$" "-t" = "50" } }
apply Service "OS Update" { import "generic-service" check_command = "nrpe-check-1arg" vars.host = "$host.address$" vars.check = "check_os_update" max_check_attempts = 5 check_interval = 30m retry_interval = 10m assign where host.address && ( host.vars.os == "CentOS7" ) ignore where host.name == "einzelner Rechner" }