From 41de23a8f7d88cae19c4c36c0ea0954c86d9f59b Mon Sep 17 00:00:00 2001 From: Petter Reinholdtsen Date: Sat, 16 Jan 2010 10:40:21 +0000 Subject: Only check laptops with the nagios tools installed, to avoid reporting failed ping for machines that come and go on the network. --- sitesummary-nodes | 9 +++++++++ 1 file changed, 9 insertions(+) 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 <