Cheshire Cat Computing

Software support and information
It is currently Sat Jan 20, 2018 12:21 pm

All times are UTC + 12 hours [ DST ]




Post new topic Reply to topic  [ 28 posts ]  Go to page Previous  1, 2, 3
Author Message
PostPosted: Thu Feb 06, 2014 9:30 am 
Offline
Silver User

Joined: Thu Jan 26, 2012 11:32 am
Posts: 29
Location: Linköping, Sweden
As I got the need to monitor the CPU temperatures of a machine I added this functionality to the generic host template.

To get any values lm-sensors must be configured on the host:

Code:
bash-4.1$ sensors
via_cputemp-isa-0000
Adapter: ISA adapter
Core 0:      +79.0 C                                   

(no need to run the above as root)

And also, snmpd must be built with support for lm-sensors. This might not be the defult, but must be configured before building from sources. To check if snmpd has support for lm-sensors:

Code:
snmpwalk -c public -v2c machine1 lmSensors
LM-SENSORS-MIB::lmTempSensorsIndex.1 = INTEGER: 1
LM-SENSORS-MIB::lmTempSensorsDevice.1 = STRING: Core 0
LM-SENSORS-MIB::lmTempSensorsValue.1 = Gauge32: 79000


This tamplate should be fully backwards compatible. If the monitored host does not support lm-sensors the resulting mrtg.cfg will be the same as with the unmodified template.

Once again I used Factor to scale to Celsius, I hope it doesn't look too bad not having Celsius in the log files but 1000*Celsius. Celsius isn't any SI unit anyway. (The SI unit for temperature is Kelvin)

regards Henrik


Attachments:
File comment: Added support for CPU core temperatures when the host is running snmpd with lm-sensors
host-generic-lm.htp [16.12 KiB]
Downloaded 300 times
Top
 Profile Send private message  
 
PostPosted: Thu Feb 06, 2014 10:08 am 
Offline
Site Admin

Joined: Tue Jul 29, 2003 11:42 am
Posts: 3039
Location: Auckland, New Zealand
Thanks for providing this.

I would think it might be better to use " / 1000" on the Target[] line to convert to degrees Celsius, rather than using Factor[]:0.001, in the CPU temperature definition, so that the values are stored in Celsius. If you do this, it makes it easier to potentially use the c2fin options to display in Farenheit (for the benefit of Americans). I also think that (while technicaly Kelvin is the SI) it's still best to store the data in Celsius rather man in millidegrees. I think that it's always best to do the calculations on the Target line rather than using Factor if you have the choice.

S

_________________
Steve Shipway
UNIX Systems, ITSS, University of Auckland, NZ
Woe unto them that rise up early in the morning... -- Isaiah 5:11


Top
 Profile Send private message  
 
PostPosted: Fri Feb 07, 2014 10:52 am 
Offline
Silver User

Joined: Thu Jan 26, 2012 11:32 am
Posts: 29
Location: Linköping, Sweden
Sorry about the Factor in my first version. I first hacked the host template file together, then returned to this forum and was reminded about the preference for SI units in the thread about DELL UPS host template.

Included with this message is a fixed host template which no longer relies on Factor to fix the scaling.

Even though I have added some host template files to this forum I must admit that I am no expert in template writing. I would not be able to write a new host template from scratch without heavy consulting of documentation. Instead my method of writing or modifying templates usually are: copy and paste from something similar and then more or less random hacking with trial and error until the template behaves as expected. :roll:

regards Henrik


Attachments:
File comment: No longer relies on Factor to fix temperature scaling to Celsius.
host-generic-lm.htp [16.07 KiB]
Downloaded 318 times
Top
 Profile Send private message  
 
PostPosted: Sat Feb 08, 2014 8:55 am 
Offline
Silver User

Joined: Thu Jan 26, 2012 11:32 am
Posts: 29
Location: Linköping, Sweden
stevesh wrote:
I think that it's always best to do the calculations on the Target line rather than using Factor if you have the choice.


As I now happen to have different hosts configured with different versions of the host template I can see a difference in the result.

The hosts which has an mrgt.conf generated with "/1000" on the target line allways shows temperatures like 43.0 °C with the fraction being zero.

The hosts which has an mrtg.conf generated with Factor 0.001 might show temperatures like 43.2 °C with a fraction which might have other values than zero.

Looking at the mrtg log files this is easy to understand, with "/1000" on the target line the log file will contain values like "43", but with Fraction 0.001 the log file will instead contain values like "43200".

Having made this observation I think that I might prefer the first version with Factor even though the log contains millidegrees.

Using the host template on several machines has also shown that there is a need to update the template. Some motherboards are able to give temperatures of other things than the CPUs, so the description should not be "CPU Temperature...". Also some motherboards are able to give other lm-sensor values like fan speeds. It would be nice to add those graphs too.

Which version of the template file would you prefer that I added fan speeds and renamed temperature labels? The first Factor-version or the second target/1000-version?

regards Henrik


Top
 Profile Send private message  
 
PostPosted: Thu Feb 13, 2014 8:57 am 
Offline
Silver User

Joined: Thu Jan 26, 2012 11:32 am
Posts: 29
Location: Linköping, Sweden
I have now updated the host template to also support fan speeds and voltages. As before, the host template is fully backwards compatible for hosts which does not support lm-sensors.

As the lm-sensors MIB states that the temperature shall be given in millidegrees Celsius and the voltages in milliVolt I have also reverted back to the usage of Factor for temperatures and also for the new voltage functionality.
As far as the temperatures are concerned, I think it wouldn't harm much to use "/1000" on the Target instead, but for some of the voltages those fractions really get significant. You would not want to lose the precision and be unable to tell the difference between 3.31 V and 3.0 V.

I have also now gotten some experience from a little weirdness of net-snmp:

If the lm-sensors gives the same name for two different sensors, like "fan1" on both the motherboard and the graphics card, using the lm-sensors command "sensors" will display the values of both these "fan1". However, snmpwalk and then also of course my host template will only show the value of one of these sensors. The solution to this problem is to rename at least one of these sensors, this is done by editing a file named something like /etc/sensors.conf. Once that file has been edited, snmpd should be restarted on that host. After that snmpwalk will be able to tell the sensors apart and my host template will give graphs for both sensors.

regards Henrik


Attachments:
File comment: Now also displays fan speeds and voltages
host-generic-lm.htp [19.9 KiB]
Downloaded 339 times
Top
 Profile Send private message  
 
PostPosted: Tue Mar 24, 2015 8:41 am 
Offline
Silver User

Joined: Thu Jan 26, 2012 11:32 am
Posts: 29
Location: Linköping, Sweden
I have made one more addition to the template file... I have found that a graph showing the machines uptime is rather useful. Fortunately uptime is provided as a timestamp by snmp. Unfortunately mrtg does not support timestamps natively. Therefore I have done the following ugly hack:

Code:
#######################################
# Uptime
# This is an ugly hack to get Timeticks into MRTG, you might have to change
# the path to your installation of snmpget.
Target[$router_name-uptime]: `/usr/bin/snmpget -v2c -c public -O vt $router_name .1.3.6.1.2.1.25.1.1.0; echo 0; echo 0; echo $router_name`/86400
PageTop[$router_name-uptime]: <h1>$router_name Uptime</h1>


By calling the command snmpget with "-O vt" I get the uptime as an integer. If your system for some reason lacks the snmpget command the snmpwalk command also works fine for this purpose.

regards Henrik


Attachments:
host-generic-lm.htp [21.36 KiB]
Downloaded 240 times
Top
 Profile Send private message  
 
PostPosted: Sun May 01, 2016 7:04 am 
Offline
Silver User

Joined: Thu Jan 26, 2012 11:32 am
Posts: 29
Location: Linköping, Sweden
I find those uptime graphs really useful, but unfortunately I can't find any uptime value which doesn't wrap after 497 days. I have looked at all snmp values that I can come to think of, but even snmpEngineTime which is supposed to allow up to 24855 days of uptime still wraps after 497 days on all systems I have checked with long uptimes.

So I have made my ugly hack even more ugly by leaving snmp and start relying on rup. I happen to have daemons answering rup on all my intranet systems.

Code:
#######################################
# Uptime
# This is an ugly hack to get Timeticks into MRTG, assuming rup works...
Target[$router_name-uptime]: `/usr/bin/rup -s $router_name | awk '{print \$3}'; echo 0; echo 0; echo $router_name`/864
PageTop[$router_name-uptime]: <h1>$router_name Uptime</h1>


This solution is not for everyone. First of all you will need something like rstad installed on all monitored machines.
http://rstatd.sourceforge.net/
The sad thing with rstatd is that it seems to be a rather abandoned project. It won't even compile out of the box on a modern system, but the sourceforge site has some patches that will make it work.

I really wish there was a better way to get remote system uptime using snmp.

regards Henrik


Attachments:
File comment: Making system call to rup to find uptime
host-generic-lm-rup.htp [21.29 KiB]
Downloaded 213 times
Top
 Profile Send private message  
 
PostPosted: Sun Dec 10, 2017 10:20 am 
Offline
Diamond User
User avatar

Joined: Wed Dec 06, 2017 2:34 am
Posts: 837
Location: Philippines
плитка испания памеса вин бланко kerama marazzi салон керамической плитки и сантехники плитка белый мрамор для ванной комнаты фото плитка на фартук бежевая с геометрическим декором плитка на стену дизайн кухни щелочное моющее средство для керамической плитки керамическая плитка улица борисовские пруды флоранс кафельная плитка керамическая плитка для пола 40х40 купить минск плитка испания monopole toscana утепление дома с облицовкой керамической плиткой фото ванной комнаты с плиткой фиеста укладка плитки в ванной до потолка плитка для ванны с рыбками фото виды панно из кафельной плитки для ванной комнаты интернет магазин мебели в спб стеллажей для книг как мыть потолочную плитку на кухне керамическая плитка прыщи на лбу лечение тарифы на замену напольной плитки керамогранит керамическая плитка апрель варианты укладки
http://holyfamilykuru.abestmodel.com/in ... &id=422607
http://rufoeventos.com/index.php?option ... r&id=44971
http://abh.co.il/index.php?option=com_k ... &id=683857
http://mothobiattorneys.co.za/index.php ... &id=479407
http://www.inpatmos.gr/index.php?option ... &id=419175
смартфон kyocera купить в россии телефонный номер оператора мтс купить телефон планшет купить без предоплаты смартфоны андроид 4 регистратор для автомобиля купить в москве телефон samsung с 5212 купить в жуковском телефоны без рст купить спб что купить планшет или нетбук или ноутбук планшет самсунг купить в екатеринбурге смартфон на 2 сим карты нокиа 311 купить где купить самые дешевые смартфоны якутске купить наушники g501 планшет microsoft surface rt 32gb 9hr 00016 купить где в городе зернограде можно купить телефон дисплеи мобильных телефонов купить смартфоны б у купить через интернет магазин планшет htc купить спб купить дисплей для смартфона lenovo a1000 защищенный смартфон купить в новороссийске смартфон apple iphone 5s 16gb space gray me432ru a купить смартфоны inew купить в новосибирске изменение фамилии в авиабилете чешских авиалиний http://verticearq.com.mx/index.php?opti ... id=1167444
http://ptacademie.fr/component/k2/itemlist/user/360753
куда подавать документы на приватизацию квартиры в московской области квартира в кредит для молодоженов в москве сколько стоит снять 2 комнатная квартира в москве купить 1 комнатную квартиру в москве бабушкинская y квартиру в подмосковье в микрорайон светлый стоматит лечение яичным белком стоматит лечение у детей по комаровському глаза красные и чешутся лечение народными средствами зуд после молочницы лечение xiaomi redmi note 2 keddr com
http://mothobiattorneys.co.za/index.php ... &id=477127
http://larutadelyo.cl/component/k2/item ... er/2151480

_________________
http://espacioilusorio.com/index.php?op ... r&id=17612


Top
 Profile Send private message  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 28 posts ]  Go to page Previous  1, 2, 3

All times are UTC + 12 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 3 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

Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group