/usr/lib/xymon/client/ext/ipmi is in hobbit-plugins 20160122.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | #!/usr/bin/perl
# A simple IPMI sensor and event log monitor
# Either a) chmod +r /dev/ipmi0 b) chmod u+s ipmitool c) allow xymon to use sudo:
# hobbit ALL=(root) SETENV:NOPASSWD: /usr/bin/ipmitool sdr
# hobbit ALL=(root) SETENV:NOPASSWD: /usr/bin/ipmitool sel list last 50
#my $IPMI='sudo /usr/local/lib/bb-sudo/ipmitool';
my $IPMI='ipmitool';
use warnings;
use strict;
use Hobbit;
my $bb = new Hobbit ('ipmi');
$bb->print ("Sensor Data Repository:\n");
foreach my $line (`$IPMI sdr 2>&1`) {
if($line =~ /ok$/) {
$bb->color_line ('green', $line);
} elsif($line =~ /ns$/) {
$bb->color_line ('clear', $line);
} elsif($line =~ /Could not open device|Get Device ID command failed|Error obtaining SDR|Unable to open/) {
$bb->color_line ('yellow', $line); # probably we just couldn't read /dev/ipmi0
} else {
$bb->color_line ('red', $line);
}
}
$bb->print ("\nIPMI event log (newest 50):\n");
my $sel = `$IPMI sel list last 50 2>&1`;
$bb->print ($sel);
$bb->send;
|