HA7Net scripts for Cacti
Moderators: Developers, Moderators
HA7Net scripts for Cacti
Here are the scripts and necessary xml for tracking 1-wire temp and humidity sensors with the HA7Net.
I'm calling them beta but they have run fine over the last couple of months on both windows and linux.
Please report any bugs or requests to this thread.
See this thread for more info on room temperature monitors.
Special thanks go to Phibes for the use of his equipment and permission to release this as open-source.
EDIT:
Updated to support alternate http port
no bug reports so I'm removing the beta
enjoy!
I'm calling them beta but they have run fine over the last couple of months on both windows and linux.
Please report any bugs or requests to this thread.
See this thread for more info on room temperature monitors.
Special thanks go to Phibes for the use of his equipment and permission to release this as open-source.
EDIT:
Updated to support alternate http port
no bug reports so I'm removing the beta
enjoy!
- Attachments
-
- ha7net.zip
- added support for different http ports
- (12.69 KiB) Downloaded 3883 times
-
- ha7net_device.jpg (159.2 KiB) Viewed 36472 times
-
- ha7net_cacti_graph.jpg (72.43 KiB) Viewed 36472 times
-
- ha7net_cacti.jpg (128.71 KiB) Viewed 36472 times
The changes you noticed are most likely from the HVAC kicking on and off. The i-wire stuff seems to be dead on in the temp department, I have verified temps to within .5 degree in most cases with both a mercury thermometer and an infrared thermometer. In some of the cabinets I monitor I can tell when a server has been powered within a minute or two just by the spike in temp.
ok, i got everything wired up for cacti. problem is the script doesnt return any values to me and my graph is sitting at NAN. when i run the script manually here is what i get:
chang# /usr/bin/perl /usr/local/share/cacti/scripts/ha7net.pl 192.168.0.252 get 2D0008010FC6D510
chang#
same with the log, says incomplete result. i checked from the read temp page on the web interface of the ha7net and it reports a temp back to me. i am using a practically brand new firmware if that has anything to do with it. version 1.0.0.13.
EDIT: i just downgraded to 1.0.0.11 and the scripts now work. something about 1.0.0.13 that the script doesnt like. i wasnt attached to .13 though so im good. if you do update it, let me know so i can stay with the flow of things. just so you dont have to figure out what is broken, it seems to me that only the get function isnt working anymore. the index, and num_indexes worked for me and i cant remember which other ones i tested. dont have a humidity sensor though so i cannot test that out yet either.
EDIT EDIT: im also noticing that both of the graphs i have right now are showing the temperature numbers on the left side more than once. it is showing in your humidity graph. any reason why that might be?
chang# /usr/bin/perl /usr/local/share/cacti/scripts/ha7net.pl 192.168.0.252 get 2D0008010FC6D510
chang#
same with the log, says incomplete result. i checked from the read temp page on the web interface of the ha7net and it reports a temp back to me. i am using a practically brand new firmware if that has anything to do with it. version 1.0.0.13.
EDIT: i just downgraded to 1.0.0.11 and the scripts now work. something about 1.0.0.13 that the script doesnt like. i wasnt attached to .13 though so im good. if you do update it, let me know so i can stay with the flow of things. just so you dont have to figure out what is broken, it seems to me that only the get function isnt working anymore. the index, and num_indexes worked for me and i cant remember which other ones i tested. dont have a humidity sensor though so i cannot test that out yet either.
EDIT EDIT: im also noticing that both of the graphs i have right now are showing the temperature numbers on the left side more than once. it is showing in your humidity graph. any reason why that might be?
Doesn't work below 0 degrees C
Hello,
I've been happily using your cacti scripts with my HA7Net for months to monitor a number of different things, including my solar hot water system. I also have a probe outside to measure ambient temperature and winter has identified a bug. Whenever the temperature is below 0 degrees celsius the script doesn't work right.
I've looked at the code and I'm pretty sure that it's the regular expression that is parsing the temp. Perhaps it doesn't handle the - sign? However, I'm very slow with regular expressions and am hopeful someone else can identify a fix faster than I.
I'm attaching an image of what the graph looks like with the error. Whenever it dips below 0 C it flatlines.
I've been happily using your cacti scripts with my HA7Net for months to monitor a number of different things, including my solar hot water system. I also have a probe outside to measure ambient temperature and winter has identified a bug. Whenever the temperature is below 0 degrees celsius the script doesn't work right.
I've looked at the code and I'm pretty sure that it's the regular expression that is parsing the temp. Perhaps it doesn't handle the - sign? However, I'm very slow with regular expressions and am hopeful someone else can identify a fix faster than I.
I'm attaching an image of what the graph looks like with the error. Whenever it dips below 0 C it flatlines.
- Attachments
-
- Graph showing the bug for cold temperatures.
- graph_image.png (33.77 KiB) Viewed 35252 times
Problem with Negative Celsius Fixed
Okay, this wasn't as hard as I thought. I wrote a quick perl test to make sure that this would work. It should fix it up.
Simply modify line 102 that reads
and change it to
The addition of the "-?" in the regex will catch the negative sign when present. Everything else is fine.
I would suggest making the same change on line 115. I don't have any analog probes so it doesn't matter, but the same problem would happen here.
Now I just have to wait for it to get below freezing again to make sure it works.
Simply modify line 102 that reads
Code: Select all
for (my $i;$CONTENT =~ /<td colspan=1><INPUT CLASS="HA7Value" NAME="Temperature_\d+".*?VALUE="([0-9\.]+)">/g;$i++){
Code: Select all
for (my $i;$CONTENT =~ /<td colspan=1><INPUT CLASS="HA7Value" NAME="Temperature_\d+".*?VALUE="(-?[0-9\.]+)">/g;$i++){
I would suggest making the same change on line 115. I don't have any analog probes so it doesn't matter, but the same problem would happen here.
Now I just have to wait for it to get below freezing again to make sure it works.
I got the ha7net.pl script working against HA7Net firmware version 1.0.0.22_Beta1 with minimal changes in Ubuntu 8.10. Diff and complete script below:
Thanks for psyber for great and easy to set up addon for Cacti!
Best regards,
-make
Code: Select all
39c40
< my $UA = new LWP::UserAgent;
---
> my $UA = new LWP::UserAgent($agent);
101c102
< for (my $i;$CONTENT =~ /<INPUT CLASS="HA7Value".*NAME="Temperature_\d+".*?VALUE="(-?[0-9\.]+)">/g;$i++){
---
> for (my $i;$CONTENT =~ /<td><INPUT CLASS="HA7Value" NAME="Temperature_\d+".*?VALUE="([0-9\.]+)">/g;$i++){
Best regards,
-make
- Attachments
-
- ha7net.pl.gz
- Complete ha7net.pl script.
- (1.76 KiB) Downloaded 3320 times
Many Thanks
I downloaded your script and tried it - and it works great.
Thank you so much!
does not show minus temperatures
Ubuntu 8.04
ha7net with 1-wire temp sensors works well for positive C temperatures, however the weather right now has some minus temperatures that we have not been able to see.
Help anyone?
Thanks
ha7net with 1-wire temp sensors works well for positive C temperatures, however the weather right now has some minus temperatures that we have not been able to see.
Help anyone?
Thanks
- Attachments
-
- This is what the graph shows
- graph.png (21.8 KiB) Viewed 29837 times
Out-of-the-box cacti_data_query_get_ha7net_readings.xml do have minimum value for temperature set as 0.
So no below-zero values are stored at the rrd database files by default.
Changing the minimum should help for new installations.
For existing graphs rrdtool tune -command should help in future below zero temperatures. For example
Of course it will not generate the missing (below zero) data lost earlier.
-make
Code: Select all
<rrd_minimum>0</rrd_minimum>
Changing the minimum should help for new installations.
For existing graphs rrdtool tune -command should help in future below zero temperatures. For example
Code: Select all
rrdtool tune /var/lib/cacti/rra/ha7net_device_value_65.rrd -minimum value:-40
-make
Who is online
Users browsing this forum: No registered users and 0 guests