Using the Linux Server Wizard, I created a series of monitors for a new RHEL server using the NCPA agent. However, the new NCPA wizard does not create a yum monitor to see to O/S is up to date. I created a bash script as a plugin in the /usr/local/ncpa/plugins directory. NRPE uses a perl script which I referred to when creating my bash script. Apparently, my script runs and gives the proper exit code and status, but in Nagios there's an error message indicating a permissions issue:
Code: Select all
2021-05-26 11:23:51,649 [ERROR] yum:193087:MainThread @logutil.py:194 - [Errno 13] Permission denied: '/var/log/rhsm/rhsm.log' - Further logging output will be written to stderr
2021-05-26 11:23:51,651 [ERROR] yum:193087:MainThread @identity.py:156 - Reload of consumer identity cert /etc/pki/consumer/cert.pem raised an exception with msg: [Errno 13] Permission denied: '/etc/pki/consumer/key.pem'
[b]YUM WARNING: O/S requires an update.[/b]
Code: Select all
#!/bin/bash
if [ "$1" != "" ]; then
echo -e "Usage: please issue command with no parameters!\n"
exit 2
fi
yum check-update >/dev/null
if [ "$?" -eq "0" ]; then
echo -e "YUM OK: O/S is up to date.\n"
exit 0
else
echo -e "YUM WARNING: O/S requires an update.\n$?"
exit 1
fi
Thank you and best regards,
Steve