diff options
Diffstat (limited to 'sitesummary-nodes')
-rwxr-xr-x | sitesummary-nodes | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/sitesummary-nodes b/sitesummary-nodes index 1e3035d..3c439a9 100755 --- a/sitesummary-nodes +++ b/sitesummary-nodes @@ -31,6 +31,9 @@ EOF my %opts; getopts("hmnw", \%opts) || (usage(), exit(1)); +my $nagiosignorefile = "/etc/sitesummary/nagiosignore"; +my %nagios_ignore; + my %hostnames; my $server_hostid = get_localhost_hostid() || die "Unable to figure out hostid for the local host"; @@ -45,6 +48,14 @@ if ($opts{'h'}) { } elsif ($opts{'w'}) { print_ip_hw_list(); } elsif ($opts{'n'}) { + if (open(my $fh, $nagiosignorefile)) { + while (<$fh>) { + chomp; + my ($hostname, $nagioscheck) = split(/:/); + $nagios_ignore{"$hostname:$nagioscheck"} = 1; + } + close $fh; + } generate_nagios_config(); } else { print_list(); @@ -173,6 +184,8 @@ sub is_remote_nrpe_config_active { sub print_nagios_service_check { my ($remote, $hostname, $description, $check, $check_args) = @_; my $template = "server-service"; + + return if exists $nagios_ignore{"$hostname:$check"}; my $cmd; if ($remote) { $cmd = "check_nrpe!$check"; |