aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPetter Reinholdtsen <pere@hungry.com>2010-01-16 09:45:04 +0000
committerPetter Reinholdtsen <pere@hungry.com>2010-01-16 09:45:04 +0000
commit401d35620839a7e7af8b9073c077d62dba5bc085 (patch)
treec0b53bd35b456a7b7baffa0676bd5ae28ac3d092
parenta412708f8954aac4051d073e445533a3c30c9dd7 (diff)
downloadsitesummary-401d35620839a7e7af8b9073c077d62dba5bc085.tar.gz
sitesummary-401d35620839a7e7af8b9073c077d62dba5bc085.tar.bz2
sitesummary-401d35620839a7e7af8b9073c077d62dba5bc085.tar.xz
Run the Nagios network checks for all hosts, and the remote checks for
those with NRPE installed.
-rwxr-xr-xsitesummary-nodes40
1 files changed, 22 insertions, 18 deletions
diff --git a/sitesummary-nodes b/sitesummary-nodes
index f15d938..9f0ba78 100755
--- a/sitesummary-nodes
+++ b/sitesummary-nodes
@@ -142,7 +142,6 @@ EOF
sub generate_nagios_config {
for my $hostname (sort keys %hostnames) {
my $hostid = $hostnames{$hostname};
- next unless (is_nagios_client($hostid));
my $address = get_dns_address($hostid);
@@ -160,6 +159,28 @@ define host {
EOF
print_nagios_service_check(0, $hostname, "ping",
"check_ping", "100.0,20%!500.0,60%");
+
+ my %tcpservices =
+ (
+ 139 => { name => 'samba', package => 'samba' },
+ 389 => { name => 'ldap', package => 'slapd' },
+ 631 => { name => 'CUPS', package => 'cupsys' },
+ 4949 => { name => 'munin', package => 'munin-node' },
+ 7100 => { name => 'xfs', package => 'xfs' }, # check X font server
+ );
+
+ for my $port (sort { $a <=> $b } keys %tcpservices) {
+ next if (exists $tcpservices{$port}->{package} && !
+ is_pkg_installed($hostid,
+ $tcpservices{$port}->{package}));
+ my $servicename = $tcpservices{$port}->{name};
+ print_nagios_service_check(0, $hostname, $servicename,
+ "check_tcp", $port);
+ }
+
+ # The rest of the checks only work if NRPE is installed and configured
+ next unless (is_nagios_client($hostid));
+
print_nagios_service_check($remote, $hostname, "swap",
"check_swap", "10%!5%");
print_nagios_service_check($remote, $hostname, "current users",
@@ -207,23 +228,6 @@ EOF
}
}
- my %tcpservices =
- (
- 139 => { name => 'samba', package => 'samba' },
- 389 => { name => 'ldap', package => 'slapd' },
- 631 => { name => 'CUPS', package => 'cupsys' },
- 4949 => { name => 'munin', package => 'munin-node' },
- 7100 => { name => 'xfs', package => 'xfs' }, # check X font server
- );
-
- for my $port (sort { $a <=> $b } keys %tcpservices) {
- next if (exists $tcpservices{$port}->{package} && !
- is_pkg_installed($hostid,
- $tcpservices{$port}->{package}));
- my $servicename = $tcpservices{$port}->{name};
- print_nagios_service_check(0, $hostname, $servicename,
- "check_tcp", $port);
- }
# check software raid status
if ( -e get_filepath_current($hostid, "/system/mdstat") ) {
print_nagios_service_check($remote, $hostname, "sw-raid",