[2014] in Moira Commits

home help back first fref pref prev next nref lref last post

/svn/moira r4155 - trunk/moira/gen

daemon@ATHENA.MIT.EDU (Garry Zacheiss)
Thu Feb 20 10:14:36 2014

Date: Thu, 20 Feb 2014 10:14:07 -0500
From: Garry Zacheiss <zacheiss@MIT.EDU>
Message-Id: <201402201514.s1KFE7ll018006@drugstore.mit.edu>
To: moira-commits@MIT.EDU
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Author: zacheiss
Date: 2014-02-20 10:14:07 -0500 (Thu, 20 Feb 2014)
New Revision: 4155

Modified:
   trunk/moira/gen/nagios-cluster.gen
Log:
Create a hostgroup for all cluster workstations.

Modified: trunk/moira/gen/nagios-cluster.gen
===================================================================
--- trunk/moira/gen/nagios-cluster.gen	2014-02-20 03:17:19 UTC (rev 4154)
+++ trunk/moira/gen/nagios-cluster.gen	2014-02-20 15:14:07 UTC (rev 4155)
@@ -26,6 +26,7 @@
 $sth1->execute || exit $MR_DBMS_ERR;
 
 my %clusters;
+my @workstations;
 while (($name) = $sth1->fetchrow_array) {
     next if $name eq "[NONE]";
     $name = lc($name);
@@ -33,6 +34,7 @@
     $cluster =~ s/\..*$//;
     $cluster =~ s/\-[^\-]*$//;
 #    print "$name\t$cluster\n";
+    push @workstations, $name;
     push @$cluster, $name;
     $clusters{$cluster}++;
 
@@ -112,6 +114,18 @@
     print OUT "\n\t}\n\n";
 }
 
+print OUT <<END;
+define hostgroup {
+	hostgroup_name	workstations
+	alias		workstations
+END
+print OUT "\tmembers\t\t";
+$maybecomma = "";
+foreach $machine (@workstations) {
+    print OUT "$maybecomma$machine";
+    $maybecomma = ",";
+}
+print OUT "\n\t}\n\n";
 
 print OUT "\n### Printers\n\n";
 


home help back first fref pref prev next nref lref last post