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

 

     [snips-users] Re: [snips-dev] genweb.cgi update

On Mon, Oct 20, 2003 at 06:16:32AM -0700, Russell Van Tassell wrote:
> 
> 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

I've heard some people have had trouble applying this patch (it's the
CVS diff).  To make it a bit easier, I'm including an actual patch file
for everyone... to use it (I use GNU patch -- you might have to modify
these instructions slightly):

1) save the file to something like genweb.cgi.patch in some place useful

   	eg.	cd ~snips/web/cgi

2) MAKE A COPY of your old file...

	eg.	cp -p genweb.cgi genweb.cgi.ORIG

3) Patch the file using the patch file you saved from this email:

	eg.	patch -p1 < genweb.cgi.patch


4) In the event you have problems, you can copy your orig file over the
   top of the "new" one, restoring your previous file.  The patch WILL
   NOT modify your directory settings, etc.


Cheers!
Russell


-- 
Russell M. Van Tassell
russell at loosenut com

"To err is human, to moo bovine."
*** genweb.cgi	Mon Oct 20 13:44:27 2003
--- genweb.cgi	Mon Oct 20 13:48:34 2003
***************
*** 1,5 ****
! #!/bin/perl
! my $versionid = '$Id: genweb.cgi,v 1.3 2002/01/30 05:42:45 vikas Exp $ ';#
  
  # ------------
  # This program displays SNIPS events in HTML format (for an alternative
--- 1,5 ----
! #!/usr/local/bin/perl
! my $versionid = '$Id: genweb.cgi,v 1.4 2003/10/20 13:13:49 russell Exp $ ';#
  
  # ------------
  # This program displays SNIPS events in HTML format (for an alternative
***************
*** 106,112 ****
  #
  #########################################################################
  
! my $SNIPSVERSION = "1.1";			# version
  # Global variables.
  use strict;
  use vars qw (
--- 106,112 ----
  #
  #########################################################################
  
! my $SNIPSVERSION = "1.2";			# version
  # Global variables.
  use strict;
  use vars qw (
***************
*** 120,126 ****
  	     $prefmt $prefmt_filesz $totaldatasize
  	    );
  BEGIN {
!   $snipsroot =  "/usr/local/snips-1.2b2"   unless $snipsroot;	# SET_THIS
    push (@INC, "$snipsroot/etc"); push (@INC, "$snipsroot/bin");
    require  "snipsperl.conf" ;		# local customizations
    require  "snipsweb-confg";	# all WEB configurable options
--- 120,126 ----
  	     $prefmt $prefmt_filesz $totaldatasize
  	    );
  BEGIN {
!   $snipsroot = "/usr/local/snips"  unless $snipsroot;	# SET_THIS
    push (@INC, "$snipsroot/etc"); push (@INC, "$snipsroot/bin");
    require  "snipsperl.conf" ;		# local customizations
    require  "snipsweb-confg";	# all WEB configurable options
***************
*** 638,645 ****
    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 '');
    $update = "OLD DATA" if ($ev->{state} & $n_OLDDATA);
  
    #if ($update eq "") {$update = $updates{"$ev->{device_name}:$ev->{device_addr}"}; }
--- 638,653 ----
    my @rowcolor = ("#FFFFcc", "#D8D8D8");	# alternating row colors
    my $action   = $views[$view2severity{$view}];
  
!   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}"}; }
Zyrion Traverse Network Monitoring & Network Management Software