2,187
edits
(→NRPE: Minor corrections) |
(→Ubuntu Software Updates Monitor: Updated with working version) |
||
Line 173: | Line 173: | ||
== Ubuntu Software Updates Monitor == | == Ubuntu Software Updates Monitor == | ||
I've spend a fair amount of time faffing around to find a method of checking my Ubuntu servers for updates. The inbuilt <code>check_apt</code> doesn't give me the results as I see when logging in to a server, and other methods I've found don't seem to work at all. | |||
Given that I only really care about my servers that run Ubuntu 10 LTS, I decided to knock up a quick script that makes use of the same mechanism that's used to generate the MotD that you see when you login to the console. As its a simple locally run script, you also need to have [[#NRPE|NRPE]] running as well. | |||
# Set-up the check script on all servers to be monitored | |||
## In <code> /usr/lib/nagios/plugins </code> download the script | |||
##* <code> wget http://dl.sandfordit.com/scripts/check_apt_upgrade </code> | |||
## Make the file executable | |||
##* <code> chmod +x check_apt_upgrade </code> | |||
## Update the <code>/etc/nagios/nrpe.cfg</code> to include the check | |||
##* Add <code> command[check_apt_upgrade]=/usr/lib/nagios/plugins/check_apt_upgrade </code> | |||
## Restart the NRPE server service | |||
##* <code> service nagios-nrpe-server restart </code> | |||
# Update the Nagios server to poll the check | |||
## Add the section below to the appropriate service config file | |||
## Check your Nagios config is valid | |||
##* <code> nagios3 -v /etc/nagios3/nagios.cfg </code> | |||
## Restart Nagios | |||
##* <code> service nagios3 restart </code> | |||
define service { | |||
hostgroup_name nrpe-std | |||
service_description Updates | |||
check_command check_nrpe_port!check_apt_upgrade | |||
use generic-service | |||
notification_interval 0 ; set > 0 if you want to be renotified | |||
} | |||
=== SNMP Based (Michal Ludvig) === | |||
'''The check script that is called by SNMP doesn't work! I've left this here for the time being as the remote SNMP exec mechanism does work, and I expect to use it at some point. When I do, I'll remove this, and document that instead.''' | |||
This check uses some scripts developed by Michal Ludvig, I've downloaded the scripts to my site, but the originals, complete with his supporting notes can be found here - http://www.logix.cz/michal/devel/nagios. Though note that I've updated the <code>check_snmp_extend.sh </code> script (didn't work for me, suspect Nagios file locations have changed since script was originally written), all kudos should still go to Michal. | This check uses some scripts developed by Michal Ludvig, I've downloaded the scripts to my site, but the originals, complete with his supporting notes can be found here - http://www.logix.cz/michal/devel/nagios. Though note that I've updated the <code>check_snmp_extend.sh </code> script (didn't work for me, suspect Nagios file locations have changed since script was originally written), all kudos should still go to Michal. | ||
Line 218: | Line 250: | ||
notification_interval 0 ; set > 0 if you want to be renotified | notification_interval 0 ; set > 0 if you want to be renotified | ||
} | } | ||
== NRPE == | == NRPE == |