diff options
| -rw-r--r-- | debian/changelog | 6 | ||||
| -rwxr-xr-x | sitesummary-nodes | 16 | 
2 files changed, 15 insertions, 7 deletions
diff --git a/debian/changelog b/debian/changelog index ddc7a03..d71efb4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +sitesummary (0.0.57~svnX) UNRELEASED; urgency=low + +  * Create Nagios hostclass for sitesummary hostclass. +	 + -- Petter Reinholdtsen <pere@debian.org>  Thu, 21 Jan 2010 11:26:58 +0100 +  sitesummary (0.0.56) unstable; urgency=low    * Replace Nagios main config file with one based on the current one diff --git a/sitesummary-nodes b/sitesummary-nodes index 635d4a4..8baeb54 100755 --- a/sitesummary-nodes +++ b/sitesummary-nodes @@ -157,7 +157,7 @@ EOF  sub nagios_hostgroup_namewash {      my $name = shift; -    $name =~ s/[^a-zA-Z_-]/-/g; # Avoid illegal characteres +    $name =~ s/[^a-zA-Z_-]+/-/g; # Avoid illegal characteres      return $name;  } @@ -204,15 +204,17 @@ sub generate_nagios_config {          my $site = get_site($hostid) || "none";          my $sitegroup = get_sitegroup($hostid); -        my $groupname = nagios_hostgroup_namewash("site-$site"); -        $hostgroup{$groupname} = 1; -        push(@groups, $groupname); +        push(@groups, nagios_hostgroup_namewash("site-$site"));          if ($sitegroup) { -            $groupname = nagios_hostgroup_namewash("site-$site-$sitegroup"); -            $hostgroup{$groupname} = 1; -            push(@groups, $groupname); +            push(@groups, nagios_hostgroup_namewash("site-$site-$sitegroup"));          } +        my $hostclass = get_hostclass($hostid) || "none"; +        push(@groups, nagios_hostgroup_namewash("hostclass-$hostclass")); + +        for my $group ( @groups ) { +            $hostgroup{$group} = 1; +        }          # Only check laptops that have the nagios tools installed          next if is_laptop($hostid) && ! $remote && ! $nagiosclient;  | 
