[Date Prev]   [Date Next] [Thread Prev]   [Thread Next] [Date Index]   [Thread Index]

 

     [snips-users] genweb.cgi update


Ok, a bit of insomnia this evening (what else is new).  I've updated
genweb.cgi to also behave correctly with subdevices (ie. those plussed
variables and such).

Best Regards,
Russell



-- begin
Index: genweb.cgi
===================================================================
RCS file: /home/cvsroot/snips/snipsweb/genweb.cgi,v
retrieving revision 1.3
diff -u -r1.3 genweb.cgi
--- genweb.cgi  30 Jan 2002 05:42:45 -0000      1.3
+++ genweb.cgi  20 Oct 2003 13:10:19 -0000
@@ -106,7 +106,7 @@
 #
 #########################################################################
 
-my $SNIPSVERSION = "1.1";                      # version
+my $SNIPSVERSION = "1.2";                      # version
 # Global variables.
 use strict;
 use vars qw (
@@ -638,8 +638,16 @@
   my @rowcolor = ("#FFFFcc", "#D8D8D8");       # alternating row colors
   my $action   = $views[$view2severity{$view}];
 
-  my $update = ($updates{"$ev->{device_name}:$ev->{device_addr}:$ev->{var_name}"} 
-               or '');
+  my( $update );
+  if ( ! $ev->{device_subdev} ){
+    $update =
+       ($updates{"$ev->{device_name}:$ev->{device_addr}:$ev->{var_name}"} 
+       or '');
+  } else {
+    $update =
+       ($updates{"$ev->{device_subdev}+$ev->{device_name}:$ev->{device_addr}:$ev->{var_name}"} 
+       or '');
+  }
   $update = "OLD DATA" if ($ev->{state} & $n_OLDDATA);
 
   #if ($update eq "") {$update = $updates{"$ev->{device_name}:$ev->{device_addr}"}; }

-- end

-- 
Russell M. Van Tassell
russell at loosenut com

"Never argue with an idiot.  They drag you down to their level then
 beat you with experience."

Zyrion Traverse Network Monitoring & Network Management Software