diff options
author | Petter Reinholdtsen <pere@hungry.com> | 2010-01-07 19:55:23 +0000 |
---|---|---|
committer | Petter Reinholdtsen <pere@hungry.com> | 2010-01-07 19:55:23 +0000 |
commit | 950c22b38bef72f68e9cf7ddb8927c1a3f82fe61 (patch) | |
tree | e21a184a3e07f75696d076df0c668438a876bc9f | |
parent | fed33f63a27a2982554335dfa78261cae3867c30 (diff) | |
download | sitesummary-950c22b38bef72f68e9cf7ddb8927c1a3f82fe61.tar.gz sitesummary-950c22b38bef72f68e9cf7ddb8927c1a3f82fe61.tar.bz2 sitesummary-950c22b38bef72f68e9cf7ddb8927c1a3f82fe61.tar.xz |
* Collect software raid status from /proc/mdstat if it exist.
* Generate Nagios checks for software raid, zombie processes, swap,
dns, imaps, nfs and squid too. Rename Nagios services to use
lower case characters.
-rw-r--r-- | collect.d/system | 5 | ||||
-rw-r--r-- | debian/changelog | 9 | ||||
-rw-r--r-- | nagios-templates.cfg | 35 | ||||
-rwxr-xr-x | sitesummary-nodes | 87 |
4 files changed, 123 insertions, 13 deletions
diff --git a/collect.d/system b/collect.d/system index 2a43630..4ec5438 100644 --- a/collect.d/system +++ b/collect.d/system @@ -37,6 +37,11 @@ route -n > route-n cat /proc/cpuinfo > cpuinfo cat /proc/meminfo > meminfo +# Collect software RAID status +if [ -f /proc/mdstat ] ; then + cat /proc/mdstat > mdstat +fi + # Collect mount points, for nagios configuration cp /etc/fstab fstab cat /proc/mounts > procmounts diff --git a/debian/changelog b/debian/changelog index b614134..6ddedc5 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,12 @@ +sitesummary (0.0.53) UNRELEASED; urgency=low + + * Collect software raid status from /proc/mdstat if it exist. + * Generate Nagios checks for software raid, zombie processes, swap, + dns, imaps, nfs and squid too. Rename Nagios services to use + lower case characters. + + -- Petter Reinholdtsen <pere@debian.org> Thu, 07 Jan 2010 20:03:00 +0100 + sitesummary (0.0.52) unstable; urgency=low * Change cron job to only reload nagios when the sitesummary generated diff --git a/nagios-templates.cfg b/nagios-templates.cfg index eafcd74..9732e8e 100644 --- a/nagios-templates.cfg +++ b/nagios-templates.cfg @@ -118,6 +118,41 @@ define command{ } define command{ + command_name check_dns + command_line /usr/lib/nagios/plugins/check_dns -H $HOSTADDRESS$ -s $HOSTADDRESS$ +} + +define command{ + command_name check_imaps + command_line /usr/lib/nagios/plugins/check_imap -p 993 -H $HOSTADDRESS$ -S +} + +define command{ + command_name check_nfs + command_line /usr/lib/nagios/plugins/check_rpc -H $HOSTADDRESS$ -C nfs -c2,3 +} + +define command{ + command_name check_squid + command_line /usr/lib/nagios/plugins/check_http -H $HOSTADDRESS$ -p $ARG1$ -u $ARG2$ -e 'HTTP/1.0 200 OK' +} + +define command{ + command_name check_swap + command_line /usr/lib/nagios/plugins/check_swap -w $ARG1 -c $ARG2$ +} + +define command{ + command_name check_procs_zombie + command_line /usr/lib/nagios/plugins/check_procs -w $ARG1$ -c $ARG2$ -s Z +} + +define command{ + command_name check_linux_raid + command_line /usr/lib/nagios/plugins/check_linux_raid +} + +define command{ command_name check-host-alive command_line /usr/lib/nagios/plugins/check_ping -H $HOSTADDRESS$ -w 5000,100% -c 5000,100% -p 1 } diff --git a/sitesummary-nodes b/sitesummary-nodes index 64a8e36..0f1b5f3 100755 --- a/sitesummary-nodes +++ b/sitesummary-nodes @@ -123,9 +123,21 @@ define host { define service { use server-service host_name $hostname - service_description PING + service_description ping check_command check_ping!100.0,20%!500.0,60% } +define service { + use server-service + host_name $hostname + service_description swap + check_command check_swap!10%!5% +} +define service { + use server-service + host_name $hostname + service_description zombie procs + check_command check_procs_zombie!20!100 +} EOF # check disk free space @@ -158,7 +170,7 @@ EOF define service { use server-service host_name $hostname - service_description Disk $partition + service_description disk $partition check_command check_disk!$warn%!$crit%!$partition } EOF @@ -168,10 +180,11 @@ EOF my %tcpservices = ( 139 => { name => 'samba', package => 'samba' }, + 389 => { name => 'ldap', package => 'slapd' }, 631 => { name => 'CUPS', package => 'cupsys' }, 636 => { name => 'ldaps', package => 'slapd' }, - 3128 => { name => 'squid', package => 'squid' }, -# 10000 => { name => 'webmin', package => 'webmin' }, + 4949 => { name => 'munin', package => 'munin-node' }, + 7100 => { name => 'xfs', package => 'xfs' }, # check X font server ); for my $port (sort { $a <=> $b } keys %tcpservices) { @@ -188,19 +201,67 @@ define service { } EOF } + # check software raid status + if ( -e get_filepath_current($hostid, "/system/mdstat") ) { + print <<EOF; +define service { + use server-service + host_name $hostname + service_description sw-raid + check_command check_linux_raid +} +EOF + } + # check munin if munin-node is installed - # check hw and sw raid status + # check hw raid status # check hardware status - # check free swap - # check X font server - # check LDAP - # check DNS + + # check LDAP and LDAPS using the protocol + + # Check DNS server + print <<EOF if is_pkg_installed($hostid, "pdns-server"); +define service { + use server-service + host_name $hostname + service_description dns + check_command check_dns +} +EOF + # Check IMAPS server + print <<EOF if is_pkg_installed($hostid, "courier-imap-ssl"); +define service { + use server-service + host_name $hostname + service_description imaps + check_command check_imaps +} +EOF + # Check NFS server + print <<EOF if is_pkg_installed($hostid, "nfs-kernel-server"); +define service { + use server-service + host_name $hostname + service_description nfs + check_command check_nfs +} +EOF + # Check Squid web proxy + print <<EOF if is_pkg_installed($hostid, "squid"); +define service { + use server-service + host_name $hostname + service_description squid + check_command check_squid!3128!http://www + +} +EOF # Check SSH server print <<EOF if is_pkg_installed($hostid, "openssh-server"); define service { use server-service host_name $hostname - service_description SSH + service_description ssh check_command check_ssh } EOF @@ -208,7 +269,7 @@ EOF define service { use server-service host_name $hostname - service_description HTTP + service_description http check_command check_http } EOF @@ -217,7 +278,7 @@ EOF define service { use server-service host_name $hostname - service_description Time server NTP + service_description ntp time server check_command check_ntp!-H!localhost } EOF @@ -226,7 +287,7 @@ EOF define service { use server-service host_name $hostname - service_description Load as in top + service_description load as in top check_command check_load!75,75,75!90,90,90 } EOF |