[1912] in Moira Commits

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

/svn/moira r4051 - in trunk/moira: clients/eunice clients/moira gen

daemon@ATHENA.MIT.EDU (Garry Zacheiss)
Thu Sep 8 14:46:44 2011

Date: Thu, 8 Sep 2011 14:46:38 -0400
From: Garry Zacheiss <zacheiss@MIT.EDU>
Message-Id: <201109081846.p88IkcZe014867@drugstore.mit.edu>
To: moira-commits@mit.edu
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Author: zacheiss
Date: 2011-09-08 14:46:37 -0400 (Thu, 08 Sep 2011)
New Revision: 4051

Modified:
   trunk/moira/clients/eunice/eunice.c
   trunk/moira/clients/moira/printer.c
   trunk/moira/gen/dhcp.pc
   trunk/moira/gen/nagios-printers.gen
   trunk/moira/gen/spwatch.gen
Log:
Support for status 4 (bootp only) printers.

Modified: trunk/moira/clients/eunice/eunice.c
===================================================================
--- trunk/moira/clients/eunice/eunice.c	2011-09-02 20:35:44 UTC (rev 4050)
+++ trunk/moira/clients/eunice/eunice.c	2011-09-08 18:46:37 UTC (rev 4051)
@@ -69,14 +69,15 @@
   "Reserved (0)",
   "Active (1)",
   "Active, No IP ACL (2)",
-  "Deleted (3)"
+  "Deleted (3)",
+  "Active, BOOTP only (4)"
 };
 
 static char *PrnState(int state)
 {
   static char buf[BUFSIZ];
   
-  if (state < 0 || state > 3)
+  if (state < 0 || state > 4)
     {
       sprintf(buf, "Unknown (%d)", state);
       return buf;

Modified: trunk/moira/clients/moira/printer.c
===================================================================
--- trunk/moira/clients/moira/printer.c	2011-09-02 20:35:44 UTC (rev 4050)
+++ trunk/moira/clients/moira/printer.c	2011-09-08 18:46:37 UTC (rev 4051)
@@ -48,14 +48,15 @@
   "Reserved (0)",
   "Active (1)",
   "Active, No IP ACL (2)",
-  "Deleted (3)"
+  "Deleted (3)",
+  "Active, BOOTP only (4)"
 };
 
 static char *PrnState(int state)
 {
   static char buf[BUFSIZ];
 
-  if (state < 0 || state > 3)
+  if (state < 0 || state > 4)
     {
       sprintf(buf, "Unknown (%d)", state);
       return buf;

Modified: trunk/moira/gen/dhcp.pc
===================================================================
--- trunk/moira/gen/dhcp.pc	2011-09-02 20:35:44 UTC (rev 4050)
+++ trunk/moira/gen/dhcp.pc	2011-09-08 18:46:37 UTC (rev 4051)
@@ -105,7 +105,7 @@
     FROM printers pr, machine m, machine m2, hwaddrmap hw
     WHERE pr.type != 'ALIAS' AND pr.mach_id != 0
     AND pr.mach_id = m.mach_id AND m.mach_id = hw.mach_id AND m.status != 3
-    AND pr.loghost = m2.mach_id AND (pr.status = 1 OR pr.status = 2)
+    AND pr.loghost = m2.mach_id AND (pr.status = 1 OR pr.status = 2 OR pr.status = 4)
     ORDER BY hw.hwaddr, m.name;
   EXEC SQL OPEN csr_boot;
   while (1)
@@ -167,7 +167,7 @@
     WHERE pr.hwtype LIKE 'HP%' AND pr.mach_id != 0
     AND pr.mach_id = m.mach_id AND m.mach_id = hw.mach_id AND m.status != 3
     AND pr.rm = m2.mach_id AND pr.loghost = m3.mach_id AND pr.type != 'ALIAS'
-    AND (pr.status = 1 OR pr.status = 2);
+    AND (pr.status = 1 OR pr.status = 2 OR pr.status = 4);
   EXEC SQL OPEN csr_boot2;
   while (1)
     {
@@ -205,7 +205,7 @@
 	fprintf(out, "trap-dest: %s\n", logaddr);
 
       /* Don't output any allow: lines for status 2 printers; they should be unrestricted. */
-      if (status == 1)
+      if (status == 1 || status == 4)
 	{
 	  if (*logaddr)
 	    fprintf(out, "allow: %s\n", logaddr);

Modified: trunk/moira/gen/nagios-printers.gen
===================================================================
--- trunk/moira/gen/nagios-printers.gen	2011-09-02 20:35:44 UTC (rev 4050)
+++ trunk/moira/gen/nagios-printers.gen	2011-09-08 18:46:37 UTC (rev 4051)
@@ -15,7 +15,8 @@
 
 $sth = $dbh->prepare("SELECT m.name FROM machine m, printers p " .
 		     "WHERE (p.type = 'DORM' OR p.type ='CLUSTER') " .
-		     "AND p.mach_id = m.mach_id AND m.status=1")
+		     "AND p.mach_id = m.mach_id AND m.status=1 AND " .
+		     (p.status = 1 OR p.status = 2 OR p.status = 4)")
     || exit $MR_DBMS_ERR;
 
 $sth->execute || exit $MR_DBMS_ERR;

Modified: trunk/moira/gen/spwatch.gen
===================================================================
--- trunk/moira/gen/spwatch.gen	2011-09-02 20:35:44 UTC (rev 4050)
+++ trunk/moira/gen/spwatch.gen	2011-09-08 18:46:37 UTC (rev 4051)
@@ -15,7 +15,7 @@
 
 $sth = $dbh->prepare("SELECT m.name FROM printers p, ".
 		     "machine m WHERE p.type = 'SAP' AND p.mach_id = ".
-		     "m.mach_id AND (p.status = 1 OR p.status = 2) AND m.status != 3 " .
+		     "m.mach_id AND (p.status = 1 OR p.status = 2 OR p.status = 4) AND m.status != 3 " .
 		     "ORDER BY m.name") || exit $MR_DBMS_ERR;
 
 $sth->execute || exit $MR_DBMS_ERR;


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