IPMI sensors -- update June 21, 2009

Templates, scripts for templates, scripts and requests for templates.

Moderators: Developers, Moderators

uhtred
Cacti User
Posts: 121
Joined: Fri Oct 09, 2009 8:59 am
Location: Germany

Re:

Post by uhtred »

At first: thx for this script!

PayableOnDeath wrote:Is there a way to create a user for this which does not require admin rights to out put sensor details

its a supermicro server if that makes any difference
Yes, u can change the privilege level.

ipmitool -L <privlvl>
Force session privilege level. Can be CALLBACK, USER, OPERATOR, ADMINISTRATOR.
Default is ADMINISTRATOR

So i did change (ss_ipmitool_sensors.php):
from
# set the sensor request type
#
$ipmitool_command = $ipmitool_command . " sdr type $sensor_type";
to
# set the sensor request type
#
$ipmitool_command = $ipmitool_command . " -L User sdr type $sensor_type";

additionally i did add (ipmitool_sensors_thermal.xml):
<sensorValue>
<name>Thermal Sensor Value</name>
<direction>input</direction>
<query_name>sensorReading</query_name>
</sensorValue>

so u can see the current value of a thermal sensor. it makes it easy to see, which one is active and which one is disabled.

greetings
System: Ubuntu 10.04lts@64bit, 2*X5650, 12GB, Cacti 0.8.7g, Spine 0.8.7g, PA2.9, Weathermap 0.97a, CAMM 1.6.75, monitor 1.3.1, realtime 0.43, thold 0.4.9.3, manage 0.6.2, mactrack 2.9(.1) ---- 508 devices, 6741 items, 4263 ds, time 7.01s, intervall 60, proc. 12, threads 14, php server 8
echo_why
Posts: 2
Joined: Tue Mar 15, 2011 7:13 am

Re: IPMI sensors -- update June 21, 2009

Post by echo_why »

I am very sorry, when I do the things like you said, I got the error:

+ Running data query [12].
+ Found type = '6 '[script query].
+ Found data query XML file at '/var/www/html/cacti/resource/script_server/ipmitool_sensors_fan.xml'
+ XML file parsed ok.
+ Executing script for list of indexes '/usr/bin/php -q /var/www/html/cacti/scripts/ss_ipmitool_sensors.php 192.168.9.201:ADMIN:admin fan index'
+ Executing script query '/usr/bin/php -q /var/www/html/cacti/scripts/ss_ipmitool_sensors.php 192.168.9.201:ADMIN:admin fan query sensorDevice'
+ Found item [sensorDevice=' "ipmitool" cannot be found in the user path'] index: FATAL
+ Executing script query '/usr/bin/php -q /var/www/html/cacti/scripts/ss_ipmitool_sensors.php 192.168.9.201:ADMIN:admin fan query sensorName'
+ Found item [sensorName=' "ipmitool" cannot be found in the user path'] index: FATAL
+ Found data query XML file at '/var/www/html/cacti/resource/script_server/ipmitool_sensors_fan.xml'
+ Found data query XML file at '/var/www/html/cacti/resource/script_server/ipmitool_sensors_fan.xml'
+ Found data query XML file at '/var/www/html/cacti/resource/script_server/ipmitool_sensors_fan.xml'

Found item [sensorDevice=' "ipmitool" cannot be found in the user path'] index: FATAL

I want to know why...Thank you very much..
echo_why
Posts: 2
Joined: Tue Mar 15, 2011 7:13 am

Re: IPMI sensors -- update June 21, 2009

Post by echo_why »

I know the reason:

$ipmitool_command = exec('which ipmitool 2>/dev/null');
$ipmitool_command = "/usr/local/bin/ipmitool";
if ($ipmitool_command == "") {

echo ("FATAL: \"ipmitool\" cannot be found in the user path\n");
return;
}
When executing this command "exec('which ipmitool 2>/dev/null');"
It found nothing
So,I add it by myself...
gctuser
Posts: 1
Joined: Tue Oct 09, 2012 6:47 am

Re: IPMI sensors -- update June 21, 2009

Post by gctuser »

Graphs for Voltage and Temperature are working fine here - Fan Graphs ARE NOT Working.

running:

Code: Select all

ipmitool -L User -I lan -H data-ipmi.luratech.com -U "username" -P "password" sdr type fan
gives result:

Code: Select all

FAN1             | 41h | ns  | 29.1 | Disabled
FAN2             | 42h | ok  | 29.2 | 3600 RPM
FAN3             | 43h | ok  | 29.3 | 4125 RPM
FAN4             | 44h | ns  | 29.4 | Disabled
FAN5             | 45h | ns  | 29.5 | Disabled
FAN6             | 46h | ns  | 29.6 | Disabled
FANA             | 47h | ok  | 29.7 | 4200 RPM
FANB             | 48h | ns  | 29.8 | Disabled
running:

Code: Select all

"/usr/bin/php" -q /usr/share/cacti/site/scripts/ss_ipmitool_sensors.php hostname:username:password fan query sensorname
gives result:

Code: Select all

PHP Notice:  Undefined index: name in /usr/share/cacti/site/scripts/ss_ipmitool_sensors.php on line 412
1:
Any ideas?
madsensh
Posts: 1
Joined: Mon Nov 25, 2013 3:54 pm

Re: IPMI sensors -- update June 21, 2009

Post by madsensh »

gctuser wrote:Graphs for Voltage and Temperature are working fine here - Fan Graphs ARE NOT Working...Any ideas?
I know this is an old thread, but I had the same problem and wanted to post my solution.

The problem is the regular expression on line 293 of ss_ipmitool_sensors.php.

Code: Select all

if (preg_match("/^(.+?)\s+\|.+\|.+\|.+\|\s([\-|\.|\d]+)\s/",
                        $ipmitool_response, $scratch) == 0) {
The regexp looks for a numeric value, which is not always present and in some cases may be "No Reading" or "Disabled" if no fan is connected, e.g.:

Code: Select all

CPU_FAN1         | 0Fh | ok  |  7.0 | 900 RPM
REAR_FAN1        | 11h | ns  |  7.0 | No Reading
FRNT_FAN1        | 13h | lnc |  7.0 | 300 RPM
To solve the problem, this portion:

Code: Select all

([\-|\.|\d]+)
should be changed to

Code: Select all

([\-|\.|\d]*).*
The script does check later to confirm that a numeric value is present, so this change should not break anything.
mavack
Posts: 5
Joined: Fri Dec 02, 2011 8:30 pm

Re: IPMI sensors -- update June 21, 2009

Post by mavack »

I recently found this and had some problems with it, for some reason ipmitool was returning the first line as soon which broke the script since it looked for space and then something.

Code: Select all

VR Watchdog      | 0Bh | ok  |  7.1 | 
BB +12.0V        | D0h | ok  |  7.1 | 11.94 Volts
BB +5.0V1        | D1h | ok  |  7.1 | 4.92 Volts
BB +3.3V         | D2h | ok  |  7.1 | 3.22 Volts
BB +5.0V2        | D3h | ok  |  7.1 | 4.94 Volts
BB +12.0V V2     | D5h | ok  |  7.1 | 11.94 Volts
BB +1.75V Vccp   | D6h | ok  |  7.1 | 1.76 Volts
BB VBAT          | DEh | ok  |  7.1 | 3.13 Volts
BB +1.05V PCH    | E2h | ok  |  7.1 | 1.03 Volts
BB +1.05V AUX    | E3h | ok  |  7.1 | 1.03 Volts
BB +1.35V MEM    | E4h | ok  |  7.1 | 1.32 Volts
BB +12.0V V1     | E8h | ok  |  7.1 | 11.99 Volts

To fix i made the following 2 changes

Code: Select all

line 292	if (preg_match("/^(.+?)\s+\|.+\|.+\|.+\|(.*)/",
line 336	$sensor_array[$sensor_count]['reading'] = filter_var($scratch[2],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION);
preg_match now finds anything in the last column including any text and pushes it into scratch, it is then filtering it when it gets push into sensor_array so that just the value goes through.
User avatar
Onkel_Tom
Posts: 16
Joined: Sat Apr 23, 2005 7:48 pm
Location: Germany

Re: IPMI sensors -- update June 21, 2009

Post by Onkel_Tom »

I know, this thread is rather old, but I didn't find a actual version of implementation of IPMI Tool environment paramters in cacti.
My cacti version is 1.2.21 and I tried to install this Script.

My Problem seems to be the Graph Template, got still this error:
RRDtool Command:

/bin/rrdtool graph - \
--imgformat=PNG \
--start='-86400' \
--end='-300' \
--pango-markup \
--title='Server - Voltage Sensors' \
--vertical-label='Volt' \
--slope-mode \
--base=1000 \
--height=120 \
--width=500 \
--tabwidth '30' \
--rigid \
--alt-autoscale-max \
--lower-limit='-15' \
COMMENT:"From 19.08.2022 18\:14\:51 To 20.08.2022 18\:09\:51\c" \
COMMENT:" \n" \
--color BACK#F3F3F3 \
--color CANVAS#FDFDFD \
--color SHADEA#CBCBCB \
--color SHADEB#999999 \
--color FONT#000000 \
--color AXIS#2C4D43 \
--color ARROW#2C4D43 \
--color FRAME#2C4D43 \
--border $rrdborder --font TITLE:11:'Arial' \
--font AXIS:8:'Arial' \
--font LEGEND:8:'Courier' \
--font UNIT:8:'Arial' \
--font WATERMARK:6:'Arial' \
--slope-mode \
LINE1:#00FF00FF:'|query_sensorName|' \
GPRINT::LAST:'Current\:%8.2lf%s' \
GPRINT::AVERAGE:'Average\:%8.2lf%s' \
GPRINT::MIN:'Minimum\:%8.2lf%s' \
GPRINT::MAX:'Maximum\:%8.2lf%s\n' \
LINE1:#0000FFFF:'|query_sensorName|' \
GPRINT::LAST:'Current\:%8.2lf%s' \
GPRINT::AVERAGE:'Average\:%8.2lf%s' \
GPRINT::MIN:'Minimum\:%8.2lf%s' \
GPRINT::MAX:'Maximum\:%8.2lf%s\n' \
LINE1:#EA8F00FF:'|query_sensorName|' \
GPRINT::LAST:'Current\:%8.2lf%s' \
GPRINT::AVERAGE:'Average\:%8.2lf%s' \
GPRINT::MIN:'Minimum\:%8.2lf%s' \
GPRINT::MAX:'Maximum\:%8.2lf%s\n' \
LINE1:#A150AAFF:'|query_sensorName|' \
GPRINT::LAST:'Current\:%8.2lf%s' \
GPRINT::AVERAGE:'Average\:%8.2lf%s' \
GPRINT::MIN:'Minimum\:%8.2lf%s' \
GPRINT::MAX:'Maximum\:%8.2lf%s\n' \
LINE1:#74C366FF:'|query_sensorName|' \
GPRINT::LAST:'Current\:%8.2lf%s' \
GPRINT::AVERAGE:'Average\:%8.2lf%s' \
GPRINT::MIN:'Minimum\:%8.2lf%s' \
GPRINT::MAX:'Maximum\:%8.2lf%s\n' \
LINE1:#9FA4EEFF:'|query_sensorName|' \
GPRINT::LAST:'Current\:%8.2lf%s' \
GPRINT::AVERAGE:'Average\:%8.2lf%s' \
GPRINT::MIN:'Minimum\:%8.2lf%s' \
GPRINT::MAX:'Maximum\:%8.2lf%s\n' \
LINE1:#CCBB00FF:'|query_sensorName|' \
GPRINT::LAST:'Current\:%8.2lf%s' \
GPRINT::AVERAGE:'Average\:%8.2lf%s' \
GPRINT::MIN:'Minimum\:%8.2lf%s' \
GPRINT::MAX:'Maximum\:%8.2lf%s\n' \
LINE1:#DA4725FF:'|query_sensorName|' \
GPRINT::LAST:'Current\:%8.2lf%s' \
GPRINT::AVERAGE:'Average\:%8.2lf%s' \
GPRINT::MIN:'Minimum\:%8.2lf%s' \
GPRINT::MAX:'Maximum\:%8.2lf%s\n'

RRDtool Command lengths = 2201 charaters.
RRDtool Says:
ERROR: parameter '#00FF00FF' does not represent a number in line LINE1:#00FF00FF:|query_sensorName|
does anyone have this Script running on a actual cacti version and can share the needed templates und xml files?

Best Regards
and thanks in advance!
Tom
Last edited by Onkel_Tom on Mon Aug 22, 2022 9:51 pm, edited 1 time in total.
User avatar
TheWitness
Developer
Posts: 17047
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Re: IPMI sensors -- update June 21, 2009

Post by TheWitness »

Your Graph is missing it's associated Data Template. You can tell since you are missing the DEF lines in the Graph. I was dinking around with this Template, but never finished doing the audit. Too much time spent on base Cacti to work on moving all the old Templates into the modern era.
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
User avatar
Onkel_Tom
Posts: 16
Joined: Sat Apr 23, 2005 7:48 pm
Location: Germany

Re: IPMI sensors -- update June 21, 2009

Post by Onkel_Tom »

thanks for your answer TheWitness!
I'm not that experienced with Data Templates and Graph Templates in cacti. So I'm not able to fix this on my own :cry:
hope somebody found some time someday to fix this.
User avatar
TheWitness
Developer
Posts: 17047
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Re: IPMI sensors -- update June 21, 2009

Post by TheWitness »

Attached you can find the updated Net-SNMP Device package for Cacti 1.2.23. I'm not sure it'll install before then, but you can try. You would always update to the 1.2.x branch and it should import just fine. It'll definitely make it to the next release.
Attachments
NetSNMP_Device.xml.gz
(108.63 KiB) Downloaded 66 times
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
User avatar
TheWitness
Developer
Posts: 17047
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Re: IPMI sensors -- update June 21, 2009

Post by TheWitness »

Pretty boring on my systems.
Attachments
LMSensors.png
LMSensors.png (369.73 KiB) Viewed 1966 times
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
User avatar
Onkel_Tom
Posts: 16
Joined: Sat Apr 23, 2005 7:48 pm
Location: Germany

Re: IPMI sensors -- update June 21, 2009

Post by Onkel_Tom »

TheWitness wrote: Mon Aug 22, 2022 8:59 pm Attached you can find the updated Net-SNMP Device package for Cacti 1.2.23. I'm not sure it'll install before then, but you can try.
Thank you, but I get a import error in 1.2.21
IMPORT parse_xml_hash ERROR wrong hash format for hash: info
TheWitness wrote: Mon Aug 22, 2022 8:59 pmYou would always update to the 1.2.x branch and it should import just fine. It'll definitely make it to the next release.
I'm waiting for the latest update release in epel repository for CentOS7 to install the latest cacti version.
User avatar
Osiris
Cacti Guru User
Posts: 1424
Joined: Mon Jan 05, 2015 10:10 am

Re: IPMI sensors -- update June 21, 2009

Post by Osiris »

You should be able to modify global_arrays.php and add the 1.2.23 version hash and the you should be able to install it.
Before history, there was a paradise, now dust.
User avatar
Onkel_Tom
Posts: 16
Joined: Sat Apr 23, 2005 7:48 pm
Location: Germany

Re: IPMI sensors -- update June 21, 2009

Post by Onkel_Tom »

Osiris wrote: Tue Aug 23, 2022 5:39 am You should be able to modify global_arrays.php and add the 1.2.23 version hash and the you should be able to install it.
Thanks Osiris, I tried this but doesn't work. Same error!

But I get the Data Template (DEF Line) from original IPMI Sensors in the Graph, don't ask me how I get this in, but now it is there, but it still doesn't work.
RRDtool Command:

/bin/rrdtool graph - \
--imgformat=PNG \
--start='-86400' \
--end='-300' \
--pango-markup \
--title='Server - Fan Sensors' \
--vertical-label='RPMs' \
--slope-mode \
--base=1000 \
--height=120 \
--width=500 \
--tabwidth '30' \
--rigid \
--alt-autoscale-max \
--lower-limit='0' \
COMMENT:"From 23.08.2022 03\:46\:31 To 24.08.2022 03\:41\:31\c" \
COMMENT:" \n" \
--color BACK#F3F3F3 \
--color CANVAS#FDFDFD \
--color SHADEA#CBCBCB \
--color SHADEB#999999 \
--color FONT#000000 \
--color AXIS#2C4D43 \
--color ARROW#2C4D43 \
--color FRAME#2C4D43 \
--border $rrdborder --font TITLE:11:'Arial' \
--font AXIS:8:'Arial' \
--font LEGEND:8:'Courier' \
--font UNIT:8:'Arial' \
--font WATERMARK:6:'Arial' \
--slope-mode \
--watermark '' \
DEF:a='/usr/share/cacti/rra/server_sensorreading_765.rrd':'sensorReading':AVERAGE \
LINE1:a#00FF00FF:'Fan 1A Tach' \
GPRINT:a:LAST:'Current\:%8.0lf' \
GPRINT:a:AVERAGE:'Average\:%8.0lf' \
GPRINT:a:MIN:'Minimum\:%8.0lf' \
GPRINT:a:MAX:'Maximum\:%8.0lf\n' \
LINE1:#0000FFFF:'Fan 1A Tach' \
GPRINT::LAST:'Current\:%8.0lf' \
GPRINT::AVERAGE:'Average\:%8.0lf' \
GPRINT::MIN:'Minimum\:%8.0lf' \
GPRINT::MAX:'Maximum\:%8.0lf\n' \
LINE1:#EA8F00FF:'Fan 1A Tach' \
GPRINT::LAST:'Current\:%8.0lf' \
GPRINT::AVERAGE:'Average\:%8.0lf' \
GPRINT::MIN:'Minimum\:%8.0lf' \
GPRINT::MAX:'Maximum\:%8.0lf\n' \
LINE1:#A150AAFF:'Fan 1A Tach' \
GPRINT::LAST:'Current\:%8.0lf' \
GPRINT::AVERAGE:'Average\:%8.0lf' \
GPRINT::MIN:'Minimum\:%8.0lf' \
GPRINT::MAX:'Maximum\:%8.0lf\n' \
LINE1:#74C366FF:'Fan 1A Tach' \
GPRINT::LAST:'Current\:%8.0lf' \
GPRINT::AVERAGE:'Average\:%8.0lf' \
GPRINT::MIN:'Minimum\:%8.0lf' \
GPRINT::MAX:'Maximum\:%8.0lf\n' \
LINE1:#9FA4EEFF:'Fan 1A Tach' \
GPRINT::LAST:'Current\:%8.0lf' \
GPRINT::AVERAGE:'Average\:%8.0lf' \
GPRINT::MIN:'Minimum\:%8.0lf' \
GPRINT::MAX:'Maximum\:%8.0lf\n' \
LINE1:#CCBB00FF:'Fan 1A Tach' \
GPRINT::LAST:'Current\:%8.0lf' \
GPRINT::AVERAGE:'Average\:%8.0lf' \
GPRINT::MIN:'Minimum\:%8.0lf' \
GPRINT::MAX:'Maximum\:%8.0lf\n' \
LINE1:#DA4725FF:'Fan 1A Tach' \
GPRINT::LAST:'Current\:%8.0lf' \
GPRINT::AVERAGE:'Average\:%8.0lf' \
GPRINT::MIN:'Minimum\:%8.0lf' \
GPRINT::MAX:'Maximum\:%8.0lf\n'

RRDtool Command lengths = 2167 charaters.

RRDtool Says:

ERROR: parameter '#0000FFFF' does not represent a number in line LINE1:#0000FFFF:Fan 1A Tach
User avatar
TheWitness
Developer
Posts: 17047
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Re: IPMI sensors -- update June 21, 2009

Post by TheWitness »

Okay, the updated package does not support or include the Multiple item Templates. If you install still has them, delete those graphs and the templates. Then, use Aggregate Templates if you wish to have multiple items per Graph.
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests