I think the patch didn't got in .... Here it's the patch
--- bb-xsnmp.pl.1_79 2006-09-14 16:18:55.000000000 +0200
+++ bb-xsnmp.pl 2006-05-14 00:10:48.000000000 +0200
@@ -1,6 +1,6 @@
-#!/usr/local/bin/perl
+#!/usr/bin/perl
# Monolithic SNMP gatherer for BigBrother.
# Ported to work with Hobbit which doesn't have bb-combo.sh
# Added support for quering the hobbit server to see if a conn test is
red
@@ -14,12 +14,12 @@
use strict;
use Carp;
use FileHandle;
use FindBin qw($Bin $Script);
-#use lib $ENV{'BBHOME'}."/ext/perl/";
-use lib qw(/local/packages/IT/HOBBIT/hobbit/server/ext/perl/);
+use lib $ENV{'BBHOME'}."/ext/perl/";
+#use lib qw(/local/packages/IT/HOBBIT/hobbit/server/ext/perl/);
use Net::SNMP qw(:snmp);
use vars qw($VERSION);
( $VERSION ) = '$Revision: 1.79 $' =~ /\$Revision:\s+([^\s]+)/;
my $debug = $ENV{'DEBUG'};
@@ -28,14 +28,14 @@
# I was not called by BigBrother.
# In this case, I assume I'm testing and
# print to stdout instead of
# sending to BB.
-my $defbbtmp = '/var/BB/bb/tmp';
-my $defbbhome = '/var/BB/bb';
+my $defbbtmp = '/home/hobbit/server/tmp';
+my $defbbhome = '/home/hobbit/server';
my $defbb = "$defbbhome/bin/bb";
-my $defbbdisp = 'enterprise.tigr.org';
+my $defbbdisp = 'itromlx10';
my $defmachine = 'localhost';
# For SNMP
my $defretries = 3;
my $deftimeout = 5;
@@ -331,10 +331,14 @@
529 => 'ascend',
789 => 'netapp',
1991 => 'foundry',
2021 => 'ucdavis',
3224 => 'netscreen',
+ 5624 => 'vhswitch',
+ 629 => 'mrswitch',
+ 52 => 'vhswitch',
+ 97 => 'cabletron',
);
my %snmpsyntaxdb = (
# .1.3.6.1.2.1.2.2.1.8
'ifOperStatus' => {
@@ -721,11 +725,11 @@
my $compaq_pct_temp_panic = 90;
# For disk checks
my $diskthreshdb_ref = undef;
my $disk_defyellow = exists($ENV{'DFWARN'}) ? $ENV{'DFWARN'} : 90;
-my $disk_defred = exists($ENV{'DFWARN'}) ? $ENV{'DFWARN'} : 90;
+my $disk_defred = exists($ENV{'DFPANIC'}) ? $ENV{'DFPANIC'} : 90;
# Turn on or off depending on whether or not you have more servers
defined
# than BB can display in one page. TODO: Automate this decision.
# bindtree is the minimum necessary.
my $l4_show_realservers = 0;
@@ -806,12 +810,12 @@
}
# Get a list of disabled hosts
my @disabled;
print "$ENV{'BBVAR'}/disabled\n" if $debug;
-# opendir(DISABLED,"$ENV{'BBVAR'}/disabled")
- opendir(DISABLED,"/local/packages/IT/HOBBIT/hobbit/data/disabled")
+ opendir(DISABLED,"$ENV{'BBVAR'}/disabled")
+# opendir(DISABLED,"/local/packages/IT/HOBBIT/hobbit/data/disabled")
|| warn "Could not open the disabled hosts directory: $!\n";
while (my $dhost = readdir(DISABLED)) {
if ($dhost =~ /^\.*$/) { next; }
$dhost =~ s/\..*$//;
$dhost =~ s/,/\./g;
@@ -821,34 +825,41 @@
closedir(DISABLED)
|| warn "Could not close the DISABLED directory handle: $!\n";
SNMP: while (my($host,$community) = each(%$commdb_ref)) {
# Make only one session
+
+
my($snmpsession,$snmperror) = Net::SNMP->session(
-hostname => $host,
-community => $community,
-debug => $debug,
-retries => $defretries,
-timeout => $deftimeout,
-translate => [ -timeticks => 0x0 ],
); # Net::SNMP->session
-
+#
+# check if host is down Butch Deal
+#
if(grep(/$host/,@disabled) >= 1) {
print "$host is disabled. Skipping.\n";
next SNMP;
}
-#
-# check if host is down Butch Deal
-#
+
if ( $HOBBIT ) {
my $string = "query ".$host.".conn";
- my $hoststat = `$ENV{'BB'} $ENV{'BBDISP'} "$string"`;
- if ($hoststat =~ "red") {
+ my $hoststat = `$ENV{'BB'} $ENV{'BBDISP'} "$string" `;
+ if ( length($hoststat) == 0 ) {
+ print "$host is not in bbhost file. Skipping.\n";
+ next SNMP;
+ }
+ if ($hoststat !~ "green") {
print "$host is down. Skipping.\n";
next SNMP;
}
}
+
if (! defined($snmpsession)) {
print((caller(0))[3].": SNMP session failed for '$host':
$snmperror\n");
next SNMP;
}
@@ -868,15 +879,16 @@
(my $brandnum =
substr($objectid,length($snmpoids{'enterprises'})+1)) =~ s/\..*$//;
if (exists($enterprisenumbers{$brandnum})) {
$enterprise = $enterprisenumbers{$brandnum};
} else {
print("Unknown enterprise number '$brandnum' in ObjectID
'$objectid'\n");
+ print("Unknown enterprise number '$brandnum' in ObjectID
'$objectid'\n");
next;
}
} else {
print((caller(0))[3].": SNMP get request failed for '$host':
".$snmpsession->error()."\n");
- return;
+ next SNMP;
}
# Determine what OS version the machine is.
my $version = undef;
unless ($version = &detect_version($host,$snmpsession,$enterprise))
{
@@ -2882,11 +2894,11 @@
$powercolors{$index} = 'red';
}
} # while (my($index,$state) = each(%statedb))
# find worst color
- my $worstcolor = &color_compare(values(%statedb));
+ my $worstcolor = &color_compare(values(%powercolors));
# compose message
$message = "status $commahost.$test $worstcolor
".scalar(localtime)."\n\n";
my @indices = sort { $a <=> $b } keys(%statedb);
foreach my $index (@indices) {
@@ -3356,11 +3368,11 @@
# Get disk names, skip over "snapshots" and aggregates
# Skip trailing slashes to make it more like Unix
if (my $result = $snmpsession->get_table(-baseoid =>
$snmpoids{'dfFileSys'})) {
while (my($key,$value) = each(%$result)) {
- next if $value =~ /\.snapshot$|^aggr/;
+ next if $value =~ /\/\.\.$|\.snapshot$|^aggr/;
(my $index = $key) =~ s/^.*\.//;
$value =~ s/\/$//;
$disknamedb{$index} = $value;
} # while (($key,$value) = each(%$result))
} else {
@@ -3479,12 +3491,12 @@
my $worstcolor = 'green';
# This is where I insert any messages about specific partitions going
over their limits
my @indices = sort { $a <=> $b } keys(%disknamedb);
foreach my $index (@indices) {
- my $yellowlimit = $ENV{'DFWARN'};
- my $redlimit = $ENV{'DFPANIC'};
+ my $yellowlimit = $disk_defyellow;
+ my $redlimit = $disk_defred;
if ((exists($diskthreshdb_ref->{$host})) &&
(defined($diskthreshdb_ref->{$host})) &&
(exists($diskthreshdb_ref->{$host}{$diskmntdb{$index}})) &&
(defined($diskthreshdb_ref->{$host}{$diskmntdb{$index}}))) {
$redlimit =
$diskthreshdb_ref->{$host}{$diskmntdb{$index}}{'red'};
@@ -3557,12 +3569,12 @@
my $worstcolor = 'green';
# This is where I insert any messages about specific partitions
going over their limits
my @indices = sort { $a <=> $b } keys(%disknamedb);
foreach my $index (@indices) {
- my $yellowlimit = $ENV{'DFWARN'};
- my $redlimit = $ENV{'DFPANIC'};
+ my $yellowlimit = $disk_defyellow;
+ my $redlimit = $disk_defred;
if ((exists($diskthreshdb_ref->{$host})) &&
(defined($diskthreshdb_ref->{$host})) &&
(exists($diskthreshdb_ref->{$host}{$diskmntdb{$index}})) &&
(defined($diskthreshdb_ref->{$host}{$diskmntdb{$index}}))) {
$redlimit =
$diskthreshdb_ref->{$host}{$diskmntdb{$index}}{'red'};
-----Original Message-----
From: Francesco Duranti [mailto:fduranti (at) q8.it]
Sent: Thursday, September 14, 2006 4:30 PM
To: hobbit (at) hswn.dk
Subject: [hobbit] R: [hobbit] question on disable until ok
If you use the last bb-xsnmp it also check with hobbit query
command to see if a host is alive but it check only if the
host is "red" so it will not get disabled. I got some problem
with it because if it get a error in snmp response it exit
and don't continue to check other hosts... I've modified it
to continue to check.. Attached is a patch with the 1.79
version available on deadcat that check if a host exist in
the bbhost file and if it's "conn" state is not "green" (so
if you've disabled the conn test it will not check for snmp.
________________________________
Da: Marco Avvisano [mailto:marco.avvisano (at) regione.toscana.it]
Inviato: gio 14/09/2006 14.53
A: hobbit (at) hswn.dk
Oggetto: Re: [hobbit] question on disable until ok
>
> Please DO NOT remove the hobbitd_filestore.
> We have quite a few lot custom scripts that use this "old
BB-style file
> interface"
>
Yes there are many scripts that using these files ... for
example bb-xsnmp
if not find these files stop to make check..
so if it's possible not only to remove from the new version,
but add it also
a in 'disable until'
best regards
Marco
To unsubscribe from the hobbit list, send an e-mail to
hobbit-unsubscribe (at) hswn.dk
To unsubscribe from the hobbit list, send an e-mail to
hobbit-unsubscribe (at) hswn.dk