diff options
author | Petter Reinholdtsen <pere@hungry.com> | 2012-04-29 18:14:31 +0000 |
---|---|---|
committer | Petter Reinholdtsen <pere@hungry.com> | 2012-04-29 18:14:31 +0000 |
commit | b00cd1aa9ce4379dff0fa3ad19cd41646dc061f7 (patch) | |
tree | ea27b918831dc408663a51f532157b20b6b02de9 | |
parent | cee561dd4bcb48a91c55c5ea820857cac59acaef (diff) | |
download | sitesummary-b00cd1aa9ce4379dff0fa3ad19cd41646dc061f7.tar.gz sitesummary-b00cd1aa9ce4379dff0fa3ad19cd41646dc061f7.tar.bz2 sitesummary-b00cd1aa9ce4379dff0fa3ad19cd41646dc061f7.tar.xz |
Document /etc/sitesummary/nagiosignore and change its definition.
-rw-r--r-- | README | 17 | ||||
-rwxr-xr-x | sitesummary-nodes | 6 |
2 files changed, 20 insertions, 3 deletions
@@ -94,6 +94,23 @@ to use instead of the value in system/hostname. For this to work, the new-name entry must map to a IP address, either in DNS via an entry in /etc/hosts. +Ignoring specific Nagios checks for some hosts +---------------------------------------------- + +Some times a machine have a package installed that cause some Nagios +test to be enabled, but the service provided by the package is +disabled and the check always fail. In this case, the Nagios test can +be disabled using the /etc/sitesummary/nagiosignore file. + +For example, to disable the DHCP check for a given host, add the +hostname and the Nagios check description to +/etc/sitesummary/nagiosignore like this: + + some.nagios.host.com process - dhcpd3 + +The nagios description can be found in +/var/lib/sitesummary/nagios-generated.cfg. + Design draft ------------ system to collect key info about all the machines on a site, to help diff --git a/sitesummary-nodes b/sitesummary-nodes index 3c439a9..ab2ecf1 100755 --- a/sitesummary-nodes +++ b/sitesummary-nodes @@ -51,8 +51,8 @@ if ($opts{'h'}) { if (open(my $fh, $nagiosignorefile)) { while (<$fh>) { chomp; - my ($hostname, $nagioscheck) = split(/:/); - $nagios_ignore{"$hostname:$nagioscheck"} = 1; + my ($hostname, $nagioscheck) = split(/ /, $_, 2); + $nagios_ignore{"$hostname $nagioscheck"} = 1; } close $fh; } @@ -185,7 +185,7 @@ sub print_nagios_service_check { my ($remote, $hostname, $description, $check, $check_args) = @_; my $template = "server-service"; - return if exists $nagios_ignore{"$hostname:$check"}; + return if exists $nagios_ignore{"$hostname $description"}; my $cmd; if ($remote) { $cmd = "check_nrpe!$check"; |