IPMI sensors -- update June 21, 2009
Moderators: Developers, Moderators
IPMI sensors -- update June 21, 2009
I have been working to get different kinds of hardware monitoring working in a consistent manner. This is the package for using ipmitool to query a system over the IPMI management interface.
Here is what the final result looks like for one of my systems, and shows the fan speeds, thermal probe temperatures, and voltage levels for all of the available sensors on that server:
This model uses ipmitool to ask the target for all known sensors of the requested type. Add the appropriate data query to a device that has an IPMI interface, and then create new graphs for each of the sensors that you want. Each selected sensor will be created as an individual data-source and graph, like with interfaces.
--> see this page for the tarball and instructions <--
Here is what the final result looks like for one of my systems, and shows the fan speeds, thermal probe temperatures, and voltage levels for all of the available sensors on that server:
This model uses ipmitool to ask the target for all known sensors of the requested type. Add the appropriate data query to a device that has an IPMI interface, and then create new graphs for each of the sensors that you want. Each selected sensor will be created as an individual data-source and graph, like with interfaces.
--> see this page for the tarball and instructions <--
Last edited by ehall on Tue Jun 23, 2009 11:26 am, edited 11 times in total.
I'm trying to run the ipmi_sensors.php script manually like this:
php ipmi/ipmi_sensors.php VOLTAGE 192.168.98.131 "" "" query sensorreading
At first it was cutting off the last character of the hostname so it wasn't working so I had to patch it.
I'm a newbie at using cacti so I'm not able to make it work as a plugin. Someone said that you just put the .php scripts in /usr/share/cacti/scripts/ but that doesn't seem to work.
I imported the .xml files. Those seem to be looking for files like:
/usr/share/cacti/rra/<hostname>_sensorreading_11.rrd
But no sensorreading files have been created so it's not working. :/
What am I doing wrong?
php ipmi/ipmi_sensors.php VOLTAGE 192.168.98.131 "" "" query sensorreading
At first it was cutting off the last character of the hostname so it wasn't working so I had to patch it.
Code: Select all
--- ipmi/ipmi_sensors.php.orig 2006-02-16 17:39:18.000000000 -0800
+++ ipmi/ipmi_sensors.php 2006-02-16 17:39:26.000000000 -0800
@@ -62,7 +62,7 @@
#
# 2nd parameter is always $hostname
#
-$hostname = substr($_SERVER['argv'][2],0,(strlen($_SERVER['argv'][2]) - 1));
+$hostname = substr($_SERVER['argv'][2],0,(strlen($_SERVER['argv'][2])));
if ($hostname == (exec ('hostname -f 2>/dev/null'))) {
I imported the .xml files. Those seem to be looking for files like:
/usr/share/cacti/rra/<hostname>_sensorreading_11.rrd
But no sensorreading files have been created so it's not working. :/
What am I doing wrong?
I've tried in several manner but...
I've corrected the script as above shown,
The script runs from console,
I've imported for now only the single (not 8x ) template without modifing them,
I've tried setup input method in several way but...
I haven't obtained nothig... only an empty graph
I spent several full day on it, I read most docs in this site but nothing...
I think that a single post is necessary to show how to setup it...
TNX
DvD
The script runs from console,
I've imported for now only the single (not 8x ) template without modifing them,
I've tried setup input method in several way but...
I haven't obtained nothig... only an empty graph
I spent several full day on it, I read most docs in this site but nothing...
I think that a single post is necessary to show how to setup it...
TNX
DvD
Don't do that. The query definition XML uses comma-separated parameters, and the script chops the commas off. Since your patch is not doing that anymore, hostname lookups are now going to be for "hostname," (with the comma) and the subsequently fields will also be imbalanced.error27 wrote:I'm trying to run the ipmi_sensors.php script manually like this:
php ipmi/ipmi_sensors.php VOLTAGE 192.168.98.131 "" "" query sensorreading
At first it was cutting off the last character of the hostname so it wasn't working so I had to patch it.
First make sure that the script works with the commas using something simple like "php ipmi_sensors.php VOLTAGE, 192.168.98.131, ," (the empty parameters will be filled in by the script).I'm a newbie at using cacti so I'm not able to make it work as a plugin. Someone said that you just put the .php scripts in /usr/share/cacti/scripts/ but that doesn't seem to work.
I imported the .xml files. Those seem to be looking for files like:
/usr/share/cacti/rra/<hostname>_sensorreading_11.rrd
But no sensorreading files have been created so it's not working. :/
What am I doing wrong?
Second make sure the files are in the right place. The PHP script file should be in your $cacti/scripts/ directory (you seem to have it in an ipmi subdirectory), and the XML files should be imported (using the "Import Templates" menu option on the left side of the console screen).
Third make sure the IPMI device has an IP address, and that it responds to SNMP or ICMP ping (set community string to blank to bypass SNMP lookups). Cacti will not execute any lookups for the device if it does not respond to basic probes.
Once that's all working, add the data query to the device in the console screen, and then use the verbose option to display the discovered sensors. If there aren't any sensors and the error isn't obvious, copy and paste the verbose output here and I'll see if I can spot the problem.
My setup
OK, fixes now script goes like this:ehall wrote:Don't do that. The query definition XML uses comma-separated parameters, and the script chops the commas off. Since your patch is not doing that anymore, hostname lookups are now going to be for "hostname," (with the comma) and the subsequently fields will also be imbalanced.error27 wrote:I'm trying to run the ipmi_sensors.php script manually like this:
php ipmi/ipmi_sensors.php VOLTAGE 192.168.98.131 "" "" query sensorreading
At first it was cutting off the last character of the hostname so it wasn't working so I had to patch it.
Code: Select all
/usr/bin/php ./scripts/ipmi_sensors.php TEMPERATURE "", "", "", query sensorname
1:Temp
2:Temp
3:Ambient Temp
4:Planar Temp
5:Riser Temp
6:Temp
7:Temp
8:Temp
9:Temp
10:Ambient Temp
11:Planar Temp
12:Riser Temp
13:Temp
14:Temp
Attention permission for /var/lib/cacti/ where scripts and rras are stored. In fedora FC4 with SELinux enable the are also the context permission -> try withI'm a newbie at using cacti so I'm not able to make it work as a plugin. Someone said that you just put the .php scripts in /usr/share/cacti/scripts/ but that doesn't seem to work.
I imported the .xml files. Those seem to be looking for files like:
/usr/share/cacti/rra/<hostname>_sensorreading_11.rrd
But no sensorreading files have been created so it's not working. :/
What am I doing wrong?
Code: Select all
chcon -R --reference=/var/www/html/ /var/lib/cacti/
I setup the scritps to "" - (empty) -> localhost now in "Data Inputs Method" I haveehall wrote: First make sure that the script works with the commas using something simple like "php ipmi_sensors.php VOLTAGE, 192.168.98.131, ," (the empty parameters will be filled in by the script).
- IPMI - Tools - Temperature
- Script query
- /usr/bin/php <path_cacti>/scripts/ipmi_sensors.php TEMPERATURE "", "", "",
- Input - nothing
- Output - nothing
OK Done.ehall wrote: Second make sure the files are in the right place. The PHP script file should be in your $cacti/scripts/ directory (you seem to have it in an ipmi subdirectory), and the XML files should be imported (using the "Import Templates" menu option on the left side of the console screen).
I setup this to "" (empty) -> localhost (cacti is running on the same server to monitor)ehall wrote: Third make sure the IPMI device has an IP address, and that it responds to SNMP or ICMP ping (set community string to blank to bypass SNMP lookups). Cacti will not execute any lookups for the device if it does not respond to basic probes.
Graph are emptyehall wrote: Once that's all working, add the data query to the device in the console screen, and then use the verbose option to display the discovered sensors. If there aren't any sensors and the error isn't obvious, copy and paste the verbose output here and I'll see if I can spot the problem.
Code: Select all
RRDTool Command:
/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title="Localhost - Thermal Sensor - |query_sensorName|" \
--rigid \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
--vertical-label="Celsius" \
DEF:a="/usr/share/cacti/rra/localhost_sensorreading_14.rrd":sensorReading:AVERAGE \
LINE2:a#0000FF:"|query_sensorName|" \
GPRINT:a:LAST:"Current\:%8.2lf %s" \
GPRINT:a:AVERAGE:"Average\:%8.2lf %s" \
GPRINT:a:MIN:"Minimum\:%8.2lf %s" \
GPRINT:a:MAX:"Maximum\:%8.2lf %s\n"
RRDTool Says:
OK
Bye Bye
DvD
Re: My setup
You need to specify the hostname ("" will be treated as the hostname in the example above). You do not need to specify the "" pairs for username or password either, since they will be provided as empty strings if no SNMPv1/v2 username or password are provided.dgrossato wrote:OK, fixes now script goes like this:
Code: Select all
/usr/bin/php ./scripts/ipmi_sensors.php TEMPERATURE "", "", "", query sensorname
Just use something like:
Code: Select all
/usr/bin/php ./scripts/ipmi_sensors.php TEMPERATURE localhost, , , query sensorname
php ipmi_sensors.php TEMPERATURE ip_address, , , query sensorname
This returns nothing to me. It queries something, because it takes about 15 seconds to run over (normal ipmitool sdr query time...). I dont know anymore what kind of query to do!
But hey Ehall!
There is a feature to use local cache file for ipmitool sdr queries.
man ipmitool:
-S <sdr_cache_file>
Use local file for remote SDR cache. Using a local SDR cache can drasti-
cally increase performance for commands that require knowledge of the
entire SDR to perform their function. Local SDR cache from a remote sys-
tem can be created with the sdr dump command.
That increase performance of ipmitool dramatically indeed!
This returns nothing to me. It queries something, because it takes about 15 seconds to run over (normal ipmitool sdr query time...). I dont know anymore what kind of query to do!
But hey Ehall!
There is a feature to use local cache file for ipmitool sdr queries.
man ipmitool:
-S <sdr_cache_file>
Use local file for remote SDR cache. Using a local SDR cache can drasti-
cally increase performance for commands that require knowledge of the
entire SDR to perform their function. Local SDR cache from a remote sys-
tem can be created with the sdr dump command.
That increase performance of ipmitool dramatically indeed!
Data Query XML data definitions missing
I just tried the scripts and I have followed the rather obscure directions on how to install this plugin. However, I still get an empty graph. I am able to get information using the ipmi_sensor.php script, but I cannot make the data available to rrdtool, or get stored in the cacti database for all that matters. I read that the data query must be entered, but I do not know what the xml data definitions file is, or how I will enter the username and password into the query so that it will work.
I have 64 servers I need to constantly monitor temperature-wise, and so far this is the best way I found. I also found something about lm_sensors, but again the documentation on how to implement this is very limited. I will be more than happy to write the steps necessary to get this thing up and running if I only had enough information to do it.
I have 64 servers I need to constantly monitor temperature-wise, and so far this is the best way I found. I also found something about lm_sensors, but again the documentation on how to implement this is very limited. I will be more than happy to write the steps necessary to get this thing up and running if I only had enough information to do it.
-
- Posts: 4
- Joined: Thu Feb 01, 2007 8:09 am
Re: Data Query XML data definitions missing
Hi all,
I have similar problems. I've tried to use the script and xml-files, ehall has build, but I think, there are several additional steps to do, which I don't understand.
As far as I understood, the files from ehal provides data and graph templates and a script to collect the data.
The script is working without problems. So I tried to create the cacti graphs.
To do this, I need the "appropriate data query" for the host. This data query is not in the zip-file and i have no idea, how to create it manually.
Anybody here, who can give two beginners in cacti the needed help, to get this working?
Many thanks in advance,
Michael
I have similar problems. I've tried to use the script and xml-files, ehall has build, but I think, there are several additional steps to do, which I don't understand.
As far as I understood, the files from ehal provides data and graph templates and a script to collect the data.
The script is working without problems. So I tried to create the cacti graphs.
To do this, I need the "appropriate data query" for the host. This data query is not in the zip-file and i have no idea, how to create it manually.
Anybody here, who can give two beginners in cacti the needed help, to get this working?
Many thanks in advance,
Michael
It doesn't appear that the original tar file had all of the templates. Don't know how it went so long without being noticed, but all of the dependencies were supposed to have been included. Anyway, I uploaded a new one that should have everything.
All of the XML files are exported from cacti 0.8.6i. Import them all, starting with the data templates, then the data queries, then finally the graphs.
Copy the .php script to your cacti scripts directory.
IPMI uses authentication, but cacti does not provide any means to specify additional variables to the script-query interface, so you have to figure out some kind of way around this.
One option (what I use here) is to create a null IPMI operator account on your machines. You can do this with "ipmitool user enable" (with no username) and then use ipmitool to further tweak the privileges and whatnot. If the script does not receive any username parameters (see bottom of post) then it will use the special NULL username and password to perform the queries.
Another option is to change the script source code. By default, if no username is provided on the command line, then the script will use the special NULL username (referred to above) with a pair of empty quote marks. You can change this to use another username if you want, so that the absence of a username and password will cause the script to use the username and password that you want.
The username code block is here:
You'll need to do the same for password.
It is possible to pass a username and password on the command-line, but that comes from overloading the SNMPv3 fields in cacti, and that has very limited applicability in most cases. You would need to create a host definition that uses SNMPv3, make sure that the host responds to pings (and there may be some other cacti tweaks like not probing SNMP), etc. If your host uses IPMI on a different IP address than the operating system uses (pretty common) then this can be a feasible method, and I've used it here myself.
Generally speaking the absolute simplest thing to do is use the ipmisensors module for lm_sensors, and get the data from net-snmp lmsensors hooks. This script is really for people that need to use IPMI in particular. IPMI is hard and ugly, I know.
All of the XML files are exported from cacti 0.8.6i. Import them all, starting with the data templates, then the data queries, then finally the graphs.
Copy the .php script to your cacti scripts directory.
IPMI uses authentication, but cacti does not provide any means to specify additional variables to the script-query interface, so you have to figure out some kind of way around this.
One option (what I use here) is to create a null IPMI operator account on your machines. You can do this with "ipmitool user enable" (with no username) and then use ipmitool to further tweak the privileges and whatnot. If the script does not receive any username parameters (see bottom of post) then it will use the special NULL username and password to perform the queries.
Another option is to change the script source code. By default, if no username is provided on the command line, then the script will use the special NULL username (referred to above) with a pair of empty quote marks. You can change this to use another username if you want, so that the absence of a username and password will cause the script to use the username and password that you want.
The username code block is here:
Code: Select all
#
# check for username and use NULL if not provided
#
if ($username != "") {
$cmdtool = $cmdtool . " -U $username";
}
else {
$cmdtool = $cmdtool . " -U \"\"";
}
It is possible to pass a username and password on the command-line, but that comes from overloading the SNMPv3 fields in cacti, and that has very limited applicability in most cases. You would need to create a host definition that uses SNMPv3, make sure that the host responds to pings (and there may be some other cacti tweaks like not probing SNMP), etc. If your host uses IPMI on a different IP address than the operating system uses (pretty common) then this can be a feasible method, and I've used it here myself.
Generally speaking the absolute simplest thing to do is use the ipmisensors module for lm_sensors, and get the data from net-snmp lmsensors hooks. This script is really for people that need to use IPMI in particular. IPMI is hard and ugly, I know.
-
- Posts: 4
- Joined: Thu Feb 01, 2007 8:09 am
-
- Posts: 1
- Joined: Thu Feb 22, 2007 9:42 am
Same here. Also the file cacti_graph_template_sensors_ipmi_fan_sensors_8x.xml returns an error after importing it:Blackblade wrote:Hello,
but there are the "<path_cacti>/resource/script_queries/ipmi_*.xml" files still missing. I think
Do i have to create them manually? If yes, can you give me a hint, how?
Code: Select all
Cacti has imported the following items:
GPRINT Preset
[success] Exact Numbers [update]
Graph Template
[success] Sensors - IPMI - Fan Sensors (8x) [update]
+ Found Dependency: (GPRINT Preset) Exact Numbers
+ Unmet Dependency: (Data Template Item)
+ Unmet Dependency: (Data Template Item)
+ Unmet Dependency: (Data Template Item)
+ Unmet Dependency: (Data Template Item)
etc...
-
- Posts: 4
- Joined: Thu Feb 01, 2007 8:09 am
Who is online
Users browsing this forum: No registered users and 2 guests