diff options
author | Petter Reinholdtsen <pere@hungry.com> | 2010-01-16 10:40:21 +0000 |
---|---|---|
committer | Petter Reinholdtsen <pere@hungry.com> | 2010-01-16 10:40:21 +0000 |
commit | 41de23a8f7d88cae19c4c36c0ea0954c86d9f59b (patch) | |
tree | a362b26910c14fe7f0c380f14dc18395af63641f | |
parent | 9fb1b7d6ffb10e436aadbb2b1ce1337f74e5e74d (diff) | |
download | sitesummary-41de23a8f7d88cae19c4c36c0ea0954c86d9f59b.tar.gz sitesummary-41de23a8f7d88cae19c4c36c0ea0954c86d9f59b.tar.bz2 sitesummary-41de23a8f7d88cae19c4c36c0ea0954c86d9f59b.tar.xz |
Only check laptops with the nagios tools installed, to avoid reporting
failed ping for machines that come and go on the network.
-rwxr-xr-x | sitesummary-nodes | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/sitesummary-nodes b/sitesummary-nodes index 52a41e7..28f8d94 100755 --- a/sitesummary-nodes +++ b/sitesummary-nodes @@ -83,6 +83,12 @@ sub is_nagios_client { is_pkg_installed($hostid, "nagios3"); } +sub is_laptop { + my $hostid = shift; + my $path = get_filepath_current($hostid, "/system/laptop"); + return -e $path; +} + sub print_munin_list { for my $hostname (sort keys %hostnames) { next unless (is_munin_client($hostnames{$hostname})); @@ -160,6 +166,9 @@ sub generate_nagios_config { my $redirect = ""; my $remote = is_remote_nagios_client($hostid); + # Only check laptops that have the nagios tools installed + next if is_laptop($hostid) && ! $remote; + print <<EOF; ##################### $hostname ####################### EOF |