Cacti (home)ForumsDocumentation
Cacti: offical forums and support
It is currently Sun May 28, 2017 1:38 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 155 posts ]  Go to page 1, 2, 3, 4, 5 ... 11  Next
Author Message
 Post subject: ucd/net-SNMP lmSensors -- update November 11, 2010
PostPosted: Wed Jan 25, 2006 12:06 pm 
Offline
Cacti User

Joined: Fri Dec 09, 2005 3:42 pm
Posts: 246
I have been working to get different kinds of hardware monitoring working in a consistent manner. This is the ucd/net-snmp lmSensors package.

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:

Image

There are some caveats here. Obviously, you must have lm_sensors installed and working, and you must have the ucd-snmp/lmSensors extension compiled into your version of net-snmp. Alos note that net-snmp uses textual string parsing to determine what kind of sensor you are using---sensor names with a "V" are mapped to voltage sensors, sensor names with "fan" are mapped to fans, and sensor names with "temp" are mapped to thermals. If you don't use that naming, your sensors will end up in the miscellaneous pool, and this script doesn't look in that pool.

--> see this page for the tarball and instructions <--


Last edited by ehall on Thu Nov 11, 2010 9:20 pm, edited 21 times in total.

Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 25, 2006 12:35 pm 
Offline
Developer
User avatar

Joined: Thu Dec 02, 2004 2:46 am
Posts: 22461
Location: Muenster, Germany
Wow, nice! Was just googling around for this bit. But to be honest, I'm currently not getting lmSensors to give me data. net-snmp-config tells me it is included. Is there anything else to be aware of? (Forgive me to be off-topic)
For used software, please see my signature.
Reinhard

_________________
Official Cacti Documentation
Official Debugging Help
Central Plugin Repository
Central Templates Repository


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 25, 2006 1:03 pm 
Offline
Cacti User

Joined: Fri Dec 09, 2005 3:42 pm
Posts: 246
Do you have lm_sensors configured and working? That's the first step and can be a kind of a pain to get fully working automatically.

First things first: do you have the "sensors" command in your path, and does it display any meaningful output?

If not, you should have a "sensors-detect" command installed somewhere that will probe for the different kinds of sensors available. If it it detects them, it will spit out a series of modprobe lines that tell you which sensors were discovered. Once those modules are loaded you can tweak /etc/sensors.conf to manipulate things like labels, fan multipliers, and so forth.

sensors-detect will also offer to create an /etc/sysconfig/lm_sensors control file (or something like it, depending on platform). I usually expirement with those and other availalbe modules, and put them into the sysconfig/kernel file so that they are loaded on boot too.

All of the above comes from installing the appropriate lm_sensors package, of course (check the links in top message). Once that's all working, adding support to net-snmp usually just requires tweaking the configure script and building a new package, but that's not even needed on some platforms.

Once you spend enough time with it to wrap your head around the architecture, it is pretty straightforward.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 26, 2006 3:49 am 
Offline
Developer
User avatar

Joined: Thu Dec 02, 2004 2:46 am
Posts: 22461
Location: Muenster, Germany
Thanks for the links. IBM systems are supposed not to work with current lm_sensors ...Damn it
Reinhard

_________________
Official Cacti Documentation
Official Debugging Help
Central Plugin Repository
Central Templates Repository


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 26, 2006 12:13 pm 
Offline
Cacti User

Joined: Fri Dec 09, 2005 3:42 pm
Posts: 246
lm_sensors talks to regular kernel modules, and there are some independent modules floating around separate from the ones that are bundled into lm_sensors itself. Not saying that you'll find one for your boxes but it's worth googling for.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 26, 2006 12:59 pm 
Offline
Developer/Forum Admin
User avatar

Joined: Mon Nov 17, 2003 6:35 pm
Posts: 5945
Location: Michigan, USA
From what I remember when I was playing with lm_sensors, you have to load a module for the base, and then each componet you want to monitor. Or was that APCI?

...

_________________
Tony Roman
Experience is what causes a person to make new mistakes instead of old ones.
There are only 3 way to complete a project: Good, Fast or Cheap, pick two.
With age comes wisdom, what you choose to do with it determines whether or not you are wise.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 26, 2006 7:11 pm 
Offline
Cacti User

Joined: Fri Dec 09, 2005 3:42 pm
Posts: 246
More or less, but on the lesser end of the scale it's so generic as to not matter. Some of the higher end sensor modules can have a lot of dependencies but the lower end sensors just need an SMBus or ISA driver (both of which are bundled into lm_sensors already).


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 27, 2006 3:41 pm 
Offline
Developer
User avatar

Joined: Thu Dec 02, 2004 2:46 am
Posts: 22461
Location: Muenster, Germany
ehall wrote:
... lower end sensors just need an SMBus...
:evil: lower end: as to IBM, that's not the lower end. It is not supported and lm_sensors is supposed to destroy the boot EEPROM as to the current documentation. It refers only to Thinkpads (my testing host), but does not run on Blade Centers either cause only the Vendor is taken into account. :evil:
SO: no data for me :cry:
Reinhard

_________________
Official Cacti Documentation
Official Debugging Help
Central Plugin Repository
Central Templates Repository


Top
 Profile  
 
 Post subject: What do I do?
PostPosted: Mon Jan 30, 2006 3:37 pm 
Offline
User avatar

Joined: Thu Feb 24, 2005 11:02 am
Posts: 12
Location: MA
I'm confused what to do with the files. I was able to import the XML files, and that looks fine.

What kind of values do I put in for Index Type, Index Value, and Output Type ID?

What do I do with the PHP file? In the scripts directory?

I'm used to the older verions of cacti (before the xml), and haven't worked with the xml files before. (I'm now using the most current version)


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 30, 2006 3:48 pm 
Offline
Cacti User

Joined: Fri Dec 09, 2005 3:42 pm
Posts: 246
From the main console you can use the "import templates" menu on the left to pull in the XML files. That will create the graph templates, the data query, and so forth. Then go into the device screen, and add the data query to a device that has lmsensors and net-snmp (compiled with lmsensors support). If everything is working on the back-end system the sensors should show up.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 31, 2006 11:53 am 
Offline
User avatar

Joined: Thu Feb 24, 2005 11:02 am
Posts: 12
Location: MA
I'm almost there. When I add the data query to the device, click create, I get this message. I don't know what it's asking.

Is the Index Type = LM-SENSORS-MIB::lmFanSensorsValue
Is the Index Value = (1,2,3, number of fans)
(as in LM-SENSORS-MIB::lmFanSensorsValue.1)

No idea what Output Typ ID is. I'm guessing that's a number that I would assign to make this fan different from other fans I might track on this device.


Attachments:
File comment: Screen shot
cacti-question.jpg
cacti-question.jpg [ 13.89 KiB | Viewed 116435 times ]
Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 31, 2006 12:59 pm 
Offline
Cacti User

Joined: Fri Dec 09, 2005 3:42 pm
Posts: 246
You shouldn't be getting prompted for that information, since the script will populate the data as needed.

One possibility is that you are not using 0.8.6h which is what the XML and scripts were written to work with.

Although actually it kind of looks like you tried to add the graph template or data template to the device. You need to add the data query to the device and let it do the work. Once that is done, click the "Verbose Query" link in the Associated Data Query list, and you should get some debug output. Mine shows:

Code:
+ Running data query [32].
+ Found type = '4 '[script query].
+ Found data query XML file at '/var/lib/cacti/resource/script_queries/lmsensors_fan.xml'
+ XML file parsed ok.
+ Executing script for list of indexes '/usr/bin/php -q /var/lib/cacti/scripts/netsnmp_lmsensors.php fan goose.ehsco.com, public, 2, , , 161, 3000 index'
+ Executing script query '/usr/bin/php -q /var/lib/cacti/scripts/netsnmp_lmsensors.php fan goose.ehsco.com, public, 2, , , 161, 3000 query sensorDevice'
+ Found item [sensorDevice='1'] index: 1
+ Found item [sensorDevice='2'] index: 2
+ Executing script query '/usr/bin/php -q /var/lib/cacti/scripts/netsnmp_lmsensors.php fan goose.ehsco.com, public, 2, , , 161, 3000 query sensorName'
+ Found item [sensorName='CPU Fan'] index: 1
+ Found item [sensorName='Case Fan'] index: 2
+ Found data query XML file at '/var/lib/cacti/resource/script_queries/lmsensors_fan.xml'
+ Found data query XML file at '/var/lib/cacti/resource/script_queries/lmsensors_fan.xml'
+ Found data query XML file at '/var/lib/cacti/resource/script_queries/lmsensors_fan.xml'
+ Found data query XML file at '/var/lib/cacti/resource/script_queries/lmsensors_fan.xml'
+ Found data query XML file at '/var/lib/cacti/resource/script_queries/lmsensors_fan.xml'


That shows two fan sensors, named "CPU Fan" and "Case Fan" respectively.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 31, 2006 1:42 pm 
Offline
User avatar

Joined: Thu Feb 24, 2005 11:02 am
Posts: 12
Location: MA
Ahhh, Maybe that's the source of my confusion. Should the tar file have contained lmsensors_fan.xml?

The contents look like all graph templates:

Code:
cacti_graph_template_ucdnet_lmsensors_fan_sensors_8x.xml
cacti_graph_template_ucdnet_lmsensors_fan_sensor.xml
cacti_graph_template_ucdnet_lmsensors_thermal_sensors_8x.xml
cacti_graph_template_ucdnet_lmsensors_thermal_sensor.xml
cacti_graph_template_ucdnet_lmsensors_voltage_sensors_8x.xml
cacti_graph_template_ucdnet_lmsensors_voltage_sensor.xml
netsnmp_lmsensors.php


Did I get the complete archive?

(Thanks for being patient with me on this)


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 01, 2006 12:58 am 
Offline
Cacti User

Joined: Fri Dec 09, 2005 3:42 pm
Posts: 246
I'm pretty sure that the 0.8.6h graph templates include all the other templates. I exported them with all dependencies. The 8x templates don't (they are just additional graphs) but the regular ones should have all the data query templates and everything.

Look in the Data Queries screen. Does it have three "ucd/net-snmp - lmSensors - Get XXX Sensors" queries?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 01, 2006 11:37 am 
Offline
User avatar

Joined: Thu Feb 24, 2005 11:02 am
Posts: 12
Location: MA
First, I tried to re-import the xml file.

Code:

Cacti has imported the following items:

Round Robin Archive
[success] Daily (5 Minute Average) [update]
[success] Weekly (30 Minute Average) [update]
[success] Monthly (2 Hour Average) [update]
[success] Yearly (1 Day Average) [update]

GPRINT Preset
[success] Exact Numbers [update]

Data Input Method
[success] Get Script Data (Indexed) [update]

Data Template
[success] ucd/net - lmSensors - Fan Sensor Reading [update]

Graph Template
[success] ucd/net - lmSensors - Fan Sensor [update]



Then I view the data queries

Code:

Karlnet - Wireless Bridge Statistics
Netware - Get Available Volumes
Netware - Get Processor Information
SNMP - Get Mounted Partitions
SNMP - Get Processor Information
SNMP - Interface Statistics
ucd/net - Get Monitored Partitions
Unix - Get Mounted Partitions



I'm using the Import Templates link to import this xml file.

I was able to write my own perl script to get the fan data via snmp, and get that into Cacti. So I know I have lm_sensors running and net-snmp compiled (./configure --prefix=/usr --with-mib-modules="ucd-snmp/lmSensors" ; make; make install)

Any of this help?


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 155 posts ]  Go to page 1, 2, 3, 4, 5 ... 11  Next

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 8 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Protected by Anti-Spam ACP Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group