[rancid] Re: output that triggers annoying email notification - I am sure we have all seen this before from rancid. :)

Brian Lam blam at rockyou.com
Tue Jun 22 17:44:00 UTC 2010


I haven't heard back so I went ahead and comment out the line below:

{'show system'                  => 'ShowChassis'},

Unfortunately, it removed a lot of valuable information so I am going to
attempt to 'intercept' the output files and remove the '!Chassis...' line
there in the file:

- !Chassis:  0     up          medium   up      up      up      up      up
   up
+ !Chassis:  0     up          low      up      up      up      up      up
   up

I think I narrow down it to the following in the bin/f10rancid:

...
...
...
open(OUTPUT,">$host.new") || die "Can't open $host.new for writing: $!\n";
select(OUTPUT);
# make OUTPUT unbuffered if debugging
if ($debug) { $| = 1; }

if ($file) {
    print STDERR "opening file $host\n" if ($debug);
    print STDOUT "opening file $host\n" if ($log);
    open(INPUT,"<$host") || die "open failed for $host: $!\n";
} else {
    print STDERR "executing clogin -t $timeo -c\"$cisco_cmds\" $host\n" if
($debug);
    print STDOUT "executing clogin -t $timeo -c\"$cisco_cmds\" $host\n" if
($log);
    if (defined($ENV{NOPIPE})) {
    system "clogin -t $timeo -c \"$cisco_cmds\" $host </dev/null > $host.raw
2>&1" || die "clogin failed for $host: $!\n";
    open(INPUT, "< $host.raw") || die "clogin failed for $host: $!\n";
    } else {
    open(INPUT,"clogin -t $timeo -c \"$cisco_cmds\" $host </dev/null |") ||
die "clogin failed for $host: $!\n";
    }
}
...
...
...

Do let me know if I am completely off base here.

Brian Lam | IT/Operations | Rockyou, Inc.




On Mon, Jun 21, 2010 at 12:32 PM, Brian Lam <blam at rockyou.com> wrote:

> All,
>
> I am using rancid 2.3.2. with force 10 switches (S50N - 48-port).
>
> The following line keeps triggering an email notification, which is
> annoying because we get desensitized to the notification email when there is
> an actual change.
>
> - !Chassis:  0     up          medium   up      up      up      up      up
>      up
> + !Chassis:  0     up          low      up      up      up      up      up
>      up
>
> The router command that spit out this status is (I believe) 'show system'.
> I searched for the command and believe it's in the following file:
>
> bin/f10rancid:  {'show system'                  => 'ShowChassis'},
>
> I am going to hack the script to see if I can filter the annoying output.
> I will probably will remove the command 'show system' if I don't figure out
> how to filter out the annoying line.  But this affect the output globally
> and I would like to get the rest of the output.
>
> I was wondering if someone has experience changing the code base to deal w/
> this case?  Any pointer would be apreciated.  Thanks!
>
> Example of system command and system outputs:
>
> r305-sw2-secondary#show system
>
> Stack MAC : 00:01:e8:d6:86:6e
>
> --  Unit 0 --
> Unit Type       : Management Unit
> Status          : online
> Next Boot       : online
> Required Type   : S50N - 48-port E/FE/GE (SB)
> Current Type    : S50N - 48-port E/FE/GE (SB)
> Master priority : 0
> Hardware Rev    : 2.0
> Num Ports       : 52
> Up Time         : 11 wk, 5 day, 11 hr, 47 min
> FTOS Version    : 7.8.1.3
> Jumbo Capable   : yes
> POE Capable     : no
> Burned In MAC   : 00:01:e8:d6:86:6e
> No Of MACs      : 3
>
> --  Module 0 --
> Status          : not present
>
> --  Module 1 --
> Status          : not present
>
> --  Power Supplies  --
> Unit   Bay   Status       Type
> ---------------------------------------------------------------------------
>   0     0     up            AC
>   0     1     absent
>
> --  Fan  Status  --
> Unit   TrayStatus  Speed    Fan0    Fan1    Fan2    Fan3    Fan4    Fan5
>
> --------------------------------------------------------------------------------
>  0     up          low      up      up      up      up      up      up
>
> --  Unit 1 --
> Unit Type       : Member Unit
> ...
> ...
>
>
> Brian Lam | IT/Operations | Rockyou, Inc.
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.shrubbery.net/pipermail/rancid-discuss/attachments/20100622/04a36c9c/attachment.html 


More information about the Rancid-discuss mailing list