BB Unix Network Monitor - Message
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: {bb} bb-xsnmp-1.77.patch1.txt - APC UPS
- To: bb@bb4.com
- Subject: Re: {bb} bb-xsnmp-1.77.patch1.txt - APC UPS
- From: Ben Pitzer <bpitzer@gmail.com>
- Date: Wed, 9 Mar 2005 10:25:29 -0500
- Content-transfer-encoding: 7bit
- Content-type: text/plain; charset=US-ASCII
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:references; b=MuWyqsc6S+yXSMvsKkU9H6oGpUMp8fJEH4YU/2VyVHKQ+iNgpuTiYRx54NlhJQ6F5pCYU1y3lQvKdc5R4DDebhRidsrjdpCwCuMa5r69y3jqZpAt836t34/exGbRSOSTentGor4e8uXMedfvbm8quEbFz9HYeBo2d5JTfc+G+g8=
- In-reply-to: <4ce1dd0f05030820586b7cfc3@mail.gmail.com>
- References: <5D200A6BB92BB54F8E2FED8E4A28D76302B635DE@RRMAILER.rr.com> <4ce1dd0f05030820586b7cfc3@mail.gmail.com>
- Reply-to: bb@bb4.com
- Sender: owner-bb@bb4.com
Yes, this is a problem that i"m working on. When bb-xsnmp.pl has a
failed SNMP request, it errors out, and no other devices in the test
hash get tested. I have a patch for that which I'm currently testing.
I'll let it loose soon, I'm hoping.
Regards,
Ben Pitzer
On Tue, 8 Mar 2005 23:58:37 -0500, Jim Johnson <jajohnso@gmail.com> wrote:
> As a followup, I'm wondering if anyone has experienced this problem
> with xsnmp.pl:
>
> I'm monitoring around 35 APC and Liebert UPS's with xsnmp 1.77
> including Craig's patch and some other support I've added. The issue
> I'm seeing is that when one of the UPS's can't give the SNMP info
> being requested because it's offline due to network issues, drained
> battery, etc, I see this in BBOUT:
>
> bb-xsnmp.pl main::main: SNMP get request failed for
> 'liebert.mydomain.com': No response from remote host
> 'liebert.mydomain.com'
>
> Now I would expect this kind of message since there's no connectivity,
> however, the xsnmp script gets hosed up at that point and no other
> devices in xsnmptab are queried. So one UPS goes down, and after
> about 20 minutes they all go purple from lack of new data. Is there
> some sort of logic that I'm missing that says "Hey - that UPS is dead,
> move on to the next one!" As of this moment I'm in the middle of a
> nasty snow storm with four UPS's in remote buildings down because
> their battery drained from the power outage and I've had to edit
> bb-xsnmptab to get rid of the UPS's that are dead so the other 30 or
> so UPS's won't go purple. That shouldn't really be necessary, should
> it? Any ideas on this one?
>
> Thanks in advance ...
>
> - Jim
>
> On Fri, 4 Feb 2005 16:14:29 -0500, Tyler, Lowell <ltyler@rr.com> wrote:
> > Hey Everyone,
> >
> > For those who are interested, here's Craig's patch in GNU patch format.
> >
> > Just save the text between the "*** start/end ***" markers to a file
> > (eg. filename.patch), and do the usual "patch -p1 < filename.patch"
> > while in the same directory as the script (to be patched).
> >
> > *** Start of patch ***
> > diff -Naur bb-xsnmp-1.77/bb-xsnmp.pl bb-xsnmp-1.77pl1/bb-xsnmp.pl
> > --- bb-xsnmp-1.77/bb-xsnmp.pl 2004-03-28 22:40:32.000000000 -1000
> > +++ bb-xsnmp-1.77pl1/bb-xsnmp.pl 2005-02-04 10:53:41.307727000
> > -1000
> > @@ -2691,16 +2691,16 @@
> > }
> >
> > # Digest results
> > - my $model = $result->{'upsBasicIdentModel'};
> > + my $model = $result->{$snmpoids{'upsBasicIdentModel'}};
> > my $battstatus =
> > $snmpsyntaxdb{'upsBasicBatteryStatus'}{$result->{$snmpoids{'upsBasicBatt
> > eryStatus'}}};
> > my $outstatus =
> > $snmpsyntaxdb{'upsBasicOutputStatus'}{$result->{$snmpoids{'upsBasicOutpu
> > tStatus'}}};
> > - my $capacity = $result->{'upsAdvBatteryCapacity'};
> > - my $remain = $result->{'upsAdvBatteryRunTimeRemaining'} / 100; #
> > Seconds
> > + my $capacity = $result->{$snmpoids{'upsAdvBatteryCapacity'}};
> > + my $remain = $result->{$snmpoids{'upsAdvBatteryRunTimeRemaining'}}
> > / 100; # Seconds
> > my $replace =
> > $snmpsyntaxdb{'upsAdvBatteryReplaceIndicator'}{$result->{$snmpoids{'upsA
> > dvBatteryReplaceIndicator'}}};
> > - my $inputvoltage = $result->{'upsAdvInputLineVoltage'};
> > - my $outputload = $result->{'upsAdvOutputLoad'};
> > - my $outputvoltage = $result->{'upsAdvOutputVoltage'};
> > - my $replacedate = $result->{'upsBasicBatteryLastReplaceDate'};
> > + my $inputvoltage = $result->{$snmpoids{'upsAdvInputLineVoltage'}};
> > + my $outputload = $result->{$snmpoids{'upsAdvOutputLoad'}};
> > + my $outputvoltage = $result->{$snmpoids{'upsAdvOutputVoltage'}};
> > + my $replacedate =
> > $result->{$snmpoids{'upsBasicBatteryLastReplaceDate'}};
> >
> > # Determine state
> > my $worstcolor = 'green';
> > @@ -2708,6 +2708,20 @@
> > $worstcolor = 'red';
> > $message .= "Battery time remaining low.\n";
> > }
> > + if ($capacity < 50) {
> > + $worstcolor = 'red';
> > + $message .= "Battery capacity is less than 50%.\n";
> > + } elsif ($capacity < 75) {
> > + $worstcolor = ($worstcolor eq 'green') ? 'yellow' : $worstcolor;
> > + $message .= "Battery capacity is less than 75%.\n";
> > + }
> > + if ($remain < 900) {
> > + $worstcolor = 'red';
> > + $message .= "Battery capacity is less than 900 seconds.\n";
> > + } elsif ($remain < 1800) {
> > + $worstcolor = ($worstcolor eq 'green') ? 'yellow' : $worstcolor;
> > + $message .= "Battery capacity is less than 1800 seconds.\n";
> > + }
> > if ($replace eq 'batteryNeedsReplacing') {
> > $worstcolor = 'red';
> > $message .= "Battery needs replacing.\n";
> > @@ -2715,10 +2729,10 @@
> > # upsAdvOutputLoad, say yellow for 90 and red for 95.
> > if ($outputload > 95) {
> > $worstcolor = 'red';
> > - $message .= "Output load above 95 percent.\n";
> > + $message .= "Output load is above 95 percent.\n";
> > } elsif ($outputload > 90) {
> > $worstcolor = ($worstcolor eq 'green') ? 'yellow' : $worstcolor;
> > - $message .= "Output load above 90 percent.\n";
> > + $message .= "Output load is above 90 percent.\n";
> > }
> >
> > # Collect the following if currently on battery power.
> > @@ -2737,6 +2751,7 @@
> > my $timeonbatt = $result->{'upsBasicBatteryTimeOnBattery'} / 100;
> > # Seconds
> > $message .= "Reason for input line failure: $failcause\n";
> > $message .= "Time elapsed since switching to battery: $timeonbatt
> > seconds\n";
> > + $worstcolor = ($worstcolor eq 'green') ? 'yellow' : $worstcolor;
> > }
> >
> > # Compose remainder of message.
> > @@ -2747,9 +2762,9 @@
> > $message .= "Remaining Battery Capacity: $capacity\n";
> > $message .= "Time Remaining Before Battery Exhaustion: $remain
> > seconds\n";
> > $message .= "Battery Replacement Indicator: $replace\n";
> > - $message .= "Input Voltage: $replace\n";
> > + $message .= "Input Voltage: $inputvoltage\n";
> > $message .= "UPS Load: $outputload %\n";
> > - $message .= "Output Voltage: $outputvoltage %\n";
> > + $message .= "Output Voltage: $outputvoltage\n";
> > $message .= "Date Batteries Last Replaced: $replacedate\n";
> >
> > $message = "status $commahost.$test $worstcolor
> > ".scalar(localtime)."\n\n$message";
> > *** End of patch ***
> >
> > Lowell
> >
> > -----Original Message-----
> > From: owner-bb@bb4.com [mailto:owner-bb@bb4.com] On Behalf Of Craig Cook
> > Sent: Wednesday, February 02, 2005 3:53 AM
> > To: bb@bb4.com
> > Subject: {bb} bb-xsnmp-1.77.patch1.txt - APC UPS
> >
> > I have posted this patch to deadcat to correct (& enhance) APC
> > monitoring.
> >
> > I saw questions in the archives about it, but no one has posted any
> > fixes.
> >
> > Craig Cook
> > --
> > Big Brother Consulting and Training Services www.cookitservices.com
> >
> > --
> > =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=
> > To unsubscribe from this list, or to subscribe to the bb-digest list
> > send e-mail to mailto:majordomo@bb4.com with unsubscribe bb -and/or-
> > subscribe bb-digest in the BODY of the message.
> >
> > --
> > =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=
> > To unsubscribe from this list, or to subscribe to the bb-digest list
> > send e-mail to mailto:majordomo@bb4.com with unsubscribe bb -and/or-
> > subscribe bb-digest in the BODY of the message.
> >
> --
> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=
> To unsubscribe from this list, or to subscribe to the bb-digest list
> send e-mail to mailto:majordomo@bb4.com with unsubscribe bb -and/or-
> subscribe bb-digest in the BODY of the message.
>
--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=
To unsubscribe from this list, or to subscribe to the bb-digest list
send e-mail to mailto:majordomo@bb4.com with unsubscribe bb -and/or-
subscribe bb-digest in the BODY of the message.
Home |
Main Index |
Thread Index