Monitoring Red Hat RHEL and CentOS Updates with Icinga2 and Nagios
Keeping Red Hat and CentOS systems up to date is critical to ensuring the security and stability of the infrastructure. Applying security patches in a timely manner reduces the risk of vulnerabilities and downtime.
Why monitor updates with Icinga2 and Nagios.
In the enterprise environment, having a clear, real-time overview of available updates is essential. Icinga2 and Nagios, through dedicated plugins, allow you to:
- Detect new available updates
- Notify administrators in a timely manner
- Classify updates (security or ordinary).
Configuring the check_yum.py plugin on CentOS/RHEL.
1. Checking the plugin directory
Check the path to the plugins defined in constants.conf:
less /etc/icy2/constants.confIn our case, the plugins are located in /usr/lib64/nagios/plugins.
2. Downloading the plugin for YUM
cd /usr/lib64/nagios/plugins
wget https://raw.githubusercontent.com/HariSekhon/Nagios-Plugins/master/check_yum.py3. Installing Python.
The plugin requires Python. If not present, install it with:
yum install python36Set Python3 as the default (if needed):
ln -fs /usr/bin/python3 /usr/bin/python4. Running the plugin
./check_yum.py
YUM OK: 0 Security Updates Available. 0 Non-Security Updates Available | security_updates_available=0 non_security_updates_available=0 total_updates_available=0The plugin returns:
- OK if there are no updates
- WARNING if there are ordinary updates
- CRITICAL if there are security updates
FAQ - Monitoring CentOS and RHEL updates.
How to monitor security updates on CentOS with Icinga2?
You can use the check_yum.py plugin to receive automatic notifications for security updates by integrating it into Icinga2 or Nagios.
What are the benefits of the check_yum plugin?
The plugin allows proactive management of updates with customizable notifications and output compatible with Nagios/Icinga2 alert systems.
How to distinguish critical from ordinary updates?
The plugin returns WARNING status for ordinary updates and CRITICAL status for security updates.
Is it possible to automate updates after the check?
Yes, it is possible to integrate post-check scripts to automate the download and application of patches.
Can I also use this method on RHEL systems?
Yes, the same method works perfectly on Red Hat Enterprise Linux with yum.
Conclusion
Control automation streamlines processes and maintains the security of your systems.
Find out how we can reduce inefficiencies and keep your servers monitored at all times. Talk to a Network Monitoring expert Now 30 minutes Free!