[hobbit] Hobbit compatible temperature monitor
We have a NetBotz appliance from APC which supports temperature probes. I use snmpwalk to query the MIB and produce a hobbit test which looks like:
NetBotz Overall Status: normal(0)
NetBotz Enclosure Status: normal(0)
Module Pod Status: normal(0)
Location 1 Temp at: DC Temp. DCH2
Location 1 Temp Status: normal(0)
Location 1 Temperature : 76F
Location 2 Temp at: Temp. East
Location 2 Temp Status: normal(0)
Location 2 Temperature : 70F
Location 3 Temp at: Temp. West
Location 3 Temp Status: normal(0)
Location 3 Temperature : 77F
Humidity Status: normal(0)
Humidity: 34
I have never been able to get custom graphs working, so I am not graphing the output. But getting custom graphs is not high on my priority list.
......Bruce
-----Original Message----- From: Tim McCloskey [mailto:morphine at zwizard.com] Sent: Wednesday, June 25, 2008 11:50 AM To: hobbit at hswn.dk Subject: Re: [hobbit] Hobbit compatible temperature monitor
If your platform supports it you can use ipmitool for various internals. Actual server room temp would need some external device such as the ones others have mentioned.
Example:
On a Sun X4150 box one of the sensors is Ambient Temp0.
temp="/usr/sfw/bin/ipmitool sensor reading 'Ambient Temp0' | awk '{print $NF}'"
Other hardware has different sensor names, some just have (temp) sensors for CPU die temps.
Regards,
Buchan Milne wrote:
On Wednesday 25 June 2008 17:28:01 Eric Boyd wrote:
I am looking to add temperature graphs to hobbit.
What should I use to monitor and graph the temperature of our server room? None of our servers report any temperature readings in the client data.
What servers are these? Any recent HP or Dell servers, if you have their respective agents (HPASM or OMSA) installed, should allow you to monitor their temperatures via snmp, e.g. with Devmon + Hobbit you should be able to get graphs for each temperature probe.
We have some APC battery backups that have environmental monitors built in,
Can you get the temperature data via SNMP? The existing templates for APC devices in devmon don't have any 'temp' test, but if the data is there that can be fixed.
Regards, Buchan
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
Note: The information contained in this message may be privileged and confidential and protected from disclosure. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by replying to the message and deleting it from your computer. Thank you. Fellowes, Inc.
On Wednesday 25 June 2008 23:52:49 White, Bruce wrote:
We have a NetBotz appliance from APC which supports temperature probes. I use snmpwalk to query the MIB and produce a hobbit test which looks like:
NetBotz Overall Status: normal(0) NetBotz Enclosure Status: normal(0) Module Pod Status: normal(0) Location 1 Temp at: DC Temp. DCH2 Location 1 Temp Status: normal(0) Location 1 Temperature : 76F Location 2 Temp at: Temp. East Location 2 Temp Status: normal(0) Location 2 Temperature : 70F Location 3 Temp at: Temp. West Location 3 Temp Status: normal(0) Location 3 Temperature : 77F Humidity Status: normal(0) Humidity: 34I have never been able to get custom graphs working, so I am not graphing the output. But getting custom graphs is not high on my priority list.
Well, devmon could be a convenient method to poll the device, and would make getting graphs and alerts quite easy.
Regards, Buchan
On Thu, 2008-06-26 at 10:12 +0200, Buchan Milne wrote:
On Wednesday 25 June 2008 23:52:49 White, Bruce wrote:
I have never been able to get custom graphs working, so I am not graphing the output. But getting custom graphs is not high on my priority list.
Well, devmon could be a convenient method to poll the device, and would make getting graphs and alerts quite easy.
It might be, but since it doesn't support snmp v3 I have not been able to use it. mrtg does support snmp v3, has templates, and bbmrtg.pl is pretty stable for importing the states into hobbit.
-- Daniel J McDonald, CCIE #2495, CISSP #78281, CNX Austin Energy http://www.austinenergy.com
I use some APC environmental monitors (model AP9319) and I have an external script I'd be happy to provide to the community.
they seem to retail for about $200 now.
Stewart
On Thu, Jun 26, 2008 at 8:01 AM, McDonald, Dan < Dan.McDonald at austinenergy.com> wrote:
On Thu, 2008-06-26 at 10:12 +0200, Buchan Milne wrote:
On Wednesday 25 June 2008 23:52:49 White, Bruce wrote:
I have never been able to get custom graphs working, so I am not graphing the output. But getting custom graphs is not high on my priority list.
Well, devmon could be a convenient method to poll the device, and would make getting graphs and alerts quite easy.
It might be, but since it doesn't support snmp v3 I have not been able to use it. mrtg does support snmp v3, has templates, and bbmrtg.pl is pretty stable for importing the states into hobbit.
-- Daniel J McDonald, CCIE #2495, CISSP #78281, CNX Austin Energy http://www.austinenergy.com
-- Stewart
You only lose what you cling to.
Stewart, I'd love to see your script. Have you set up graphing for it? -Eric
Stewart L wrote:
I use some APC environmental monitors (model AP9319) and I have an external script I'd be happy to provide to the community.
they seem to retail for about $200 now.
Stewart
On Thu, Jun 26, 2008 at 8:01 AM, McDonald, Dan <Dan.McDonald at austinenergy.com <mailto:Dan.McDonald at austinenergy.com>> wrote:
On Thu, 2008-06-26 at 10:12 +0200, Buchan Milne wrote: > On Wednesday 25 June 2008 23:52:49 White, Bruce wrote: > > I have never been able to get custom graphs working, so I am not graphing > > the output. But getting custom graphs is not high on my priority list. > > Well, devmon could be a convenient method to poll the device, and would make > getting graphs and alerts quite easy. It might be, but since it doesn't support snmp v3 I have not been able to use it. mrtg does support snmp v3, has templates, and bbmrtg.pl is pretty stable for importing the states into hobbit. -- Daniel J McDonald, CCIE #2495, CISSP #78281, CNX Austin Energy http://www.austinenergy.com-- Stewart
You only lose what you cling to.
Yep. We graph temperature and humidity (as that is the base sensor included in the package). just queried via SNMP.
Here you go! all of our sensors are in climate controlled rooms, so humidity is not a concern. This reports them both on one page, but only alerts if temp is out of range. would be a trivial update if someone wanted to alarm on humidity thresholds...
I have written many externals using this template. I use the same model to pull over 500 firewalls for 10 data points each in less than 30 seconds.
I'll leave the NCV stuff up to you. add an 'apctemp' test to your hosts and off it goes! Have fun!
Stewart
#!/usr/bin/perl
########################################################
Hobbit script to monitor APC Environmental monitors
Written by Stewart Larsen
Released to the public domain
This uses bbhostgrep to figure out which hosts to
poll and then Net::SNMP to poll them Asynchronously.
This incorporates nicely into the NCV graphs As well.
########################################################
use strict; use Net::SNMP qw(snmp_dispatcher ticks_to_time);
Set to 1 to print to STDOUT instead of sending messages
my $debug = 1;
this is the IP address of your hobbit server
my $BBDISP = "192.168.1.1";
hosts need to have the 'apctemp' test defined on them. Or change this to
whatever you want to call it. my $testname="apctemp";
Path to your bb executable
my $BB = "/usr/lib/hobbit/server/bin/bb";
Path to your bbhostgrep executable
my $BBHG = "/usr/lib/hobbit/server/bin/bbhostgrep";
SNMP Community String
my $snmpc = 'public';
Temperature thresholds
my $temp_warn = 90; my $temp_panic = 92;
my $contact = "Emergency Contact:\n\t1) Facilities\n\t\t850-555-1212\n\t2) Facilities On Call\n\t\t850-555-1111";
my @HOSTS = (); my %hosts_hash = (); my %ip_hash = (); my $now_string = localtime;
open (INPUT, "$BBHG $testname |" ) or die "Cannot open input: $!\n"; while(<INPUT>) { my ($ip,$hostname) = split(/\s/,$_); print "Adding $ip to polled hosts\n" if $debug; push @HOSTS,$hostname; $hosts_hash{$hostname} = $ip; $ip_hash{$ip} = $hostname; }
close INPUT;
# Poll interval (in seconds). This value should be greater
# than the number of retries plus one, times the timeout value.
my $INTERVAL = 20;
# Maximum number of polls, including the initial poll.
my $MAX_POLLS = 1;
my $temperature = '.1.3.6.1.4.1.318.1.1.10.3.13.1.1.3.1';
my $humidity = '.1.3.6.1.4.1.318.1.1.10.3.13.1.1.6.1';
my $location = '.1.3.6.1.4.1.318.1.1.10.3.12.1.0';
# Create a session for each host and queue the first get-request.
foreach my $host (@HOSTS) {
my ($session, $error) = Net::SNMP->session(
-hostname => $hosts_hash{$host},
-nonblocking => 0x1, # Create non-blocking objects
-timeout => 5,
-debug => 0xFF,
-retries => 1,
-version => '1',
-community => $snmpc
);
if (!defined($session)) {
printf("ERROR: %s.\n", $error);
exit 1;
}
# Queue the get-request, passing references to variables that
# will be used to store the last sysUpTime and the number of
# polls that this session has performed.
my ($last_uptime, $num_polls) = (0, 0);
$session->get_request(
-varbindlist => [$temperature,$humidity,$location],
-callback => [
\&validate_sysUpTime_cb
]
);
}
# Define a reference point for all of the polls
my $EPOC = time();
# Enter the event loop
snmp_dispatcher();
$now_string = localtime;
#print STDERR "$now_string: Processing Complete\n";
exit 0;
sub validate_sysUpTime_cb { my ($session) = @_; if (!defined($session->var_bind_list)) { printf("%-15s ERROR: %s\n", $session->hostname, $session->error) if $debug; system("$BB $BBDISP \"status ".$ip_hash{$session->hostname}.".$testname clear $now_string - Communication Failure\n".$session->error."\"\n") if !$debug; } else {
# Validate the sysUpTime
my $temperature = $session->var_bind_list->{$temperature};
my $humidity = $session->var_bind_list->{$humidity};
my $location = $session->var_bind_list->{$location};
my $line = sprintf("Service on %-15s is Ok \n\ntemp :
%s\nhumidity: %s\n\n", $session->hostname, $temperature, $humidity);
my $cmd = "";
my $color = "";
my $mark = "";
if ($temperature >= $temp_panic)
{
# Panic on CPU test
$mark="PANIC";
$color="red";
}
elsif ($temperature >= $temp_warn)
{
# Warn on CPU test
$mark="WARNING";
$color="yellow";
}
else
{
# CPU test OK
$mark="OK";
$color="green";
$contact = "";
}
my $line="Environmental Monitoring\n\n$mark: Location:
$location\n\ntemp : $temperature\nhumidity : $humidity\n\n$contact"; $cmd = "$BB $BBDISP \"status ".$ip_hash{$session->hostname}.".$testname $color $now_string $line\n\""; print STDOUT "********************\n$cmd" if $debug; system($cmd) if !$debug;
$session->error_status;
}
}
On Thu, Jun 26, 2008 at 11:37 AM, Eric Boyd <eric at iconla.com> wrote:
Stewart, I'd love to see your script. Have you set up graphing for it? -Eric
Stewart L wrote:
I use some APC environmental monitors (model AP9319) and I have an external script I'd be happy to provide to the community.
they seem to retail for about $200 now.
Stewart
On Thu, Jun 26, 2008 at 8:01 AM, McDonald, Dan < Dan.McDonald at austinenergy.com <mailto:Dan.McDonald at austinenergy.com>> wrote:
On Thu, 2008-06-26 at 10:12 +0200, Buchan Milne wrote:
On Wednesday 25 June 2008 23:52:49 White, Bruce wrote:
I have never been able to get custom graphs working, so I am not graphing the output. But getting custom graphs is not high on my priority list.
Well, devmon could be a convenient method to poll the device, and would make getting graphs and alerts quite easy.
It might be, but since it doesn't support snmp v3 I have not been able to use it. mrtg does support snmp v3, has templates, and bbmrtg.pl is pretty stable for importing the states into hobbit.
-- Daniel J McDonald, CCIE #2495, CISSP #78281, CNX Austin Energy http://www.austinenergy.com
-- Stewart
You only lose what you cling to.
To unsubscribe from the hobbit list, send an e-mail to hobbit-unsubscribe at hswn.dk
-- Stewart
You only lose what you cling to.
participants (5)
-
bewhite@fellowes.com
-
bgmilne@staff.telkomsa.net
-
Dan.McDonald@austinenergy.com
-
eric@iconla.com
-
stewartl42@gmail.com