Check port versions - NRPE pkg version check: Difference between revisions

From TykWiki
Jump to navigationJump to search
No edit summary
No edit summary
Line 1: Line 1:
A nagios plugin I wrote, which checks the number of outdated ports on a system. If the number exceeds the configured limits, WARNING or CRITICAL is returned.
A nagios plugin I wrote, which checks the number of outdated ports on a system. If the number exceeds the configured limits, WARNING or CRITICAL is returned.
== Download the plugin ==
The plugin can be downloaded to the correct place (and made executable) with the following commands:
<pre>
sudo fetch -o /usr/local/libexec/nagios/check_portmaster http://www.gibfest.dk/check_portmaster
sudo chmod +x /usr/local/libexec/nagios/check_portmaster
</pre>
Feel free to check the source code to see what it does, it is pretty simple and well commented.


== NRPE configuration ==
== NRPE configuration ==
Line 6: Line 15:
<pre>
<pre>
command[check_portmaster]=/usr/local/libexec/nagios/check_portmaster
command[check_portmaster]=/usr/local/libexec/nagios/check_portmaster
</pre>
== Updating the portmaster output file ==
As mentioned in [[Check_portsindex_age_-_NRPE_ports_age_check]] I add the following line to <code>/etc/crontab</code> to both update ports, and create an updated <code>/tmp/check_portmaster.tmp</code> file:
<pre>
0 3 * * * root /usr/sbin/portsnap cron && /usr/sbin/portsnap -I update && /usr/local/sbin/portmaster -L > /tmp/check_portmaster.tmp
</pre>
</pre>

Revision as of 13:11, 15 February 2010

A nagios plugin I wrote, which checks the number of outdated ports on a system. If the number exceeds the configured limits, WARNING or CRITICAL is returned.

Download the plugin

The plugin can be downloaded to the correct place (and made executable) with the following commands:

sudo fetch -o /usr/local/libexec/nagios/check_portmaster http://www.gibfest.dk/check_portmaster
sudo chmod +x /usr/local/libexec/nagios/check_portmaster

Feel free to check the source code to see what it does, it is pretty simple and well commented.

NRPE configuration

Add the following line to the NRPE config:

command[check_portmaster]=/usr/local/libexec/nagios/check_portmaster

Updating the portmaster output file

As mentioned in Check_portsindex_age_-_NRPE_ports_age_check I add the following line to /etc/crontab to both update ports, and create an updated /tmp/check_portmaster.tmp file:

0	3	*	*	*	root	/usr/sbin/portsnap cron && /usr/sbin/portsnap -I update && /usr/local/sbin/portmaster -L > /tmp/check_portmaster.tmp