|
|
| Author |
Message |
psyber
Joined: 02 Aug 2005 Posts: 46
|
Posted: Sun May 14, 2006 2:13 am Post subject: 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!
| Description: |
|
| Filesize: |
128.71 KB |
| Viewed: |
5727 Time(s) |

|
| Description: |
|
| Filesize: |
72.43 KB |
| Viewed: |
5727 Time(s) |

|
| Description: |
|
| Filesize: |
159.2 KB |
| Viewed: |
5727 Time(s) |

|
| Description: |
| added support for different http ports |
|
 Download |
| Filename: |
ha7net.zip |
| Filesize: |
12.69 KB |
| Downloaded: |
337 Time(s) |
|
|
| Back to top |
|
 |
Diceman Cacti User
Joined: 25 Oct 2005 Posts: 139
|
Posted: Fri Jun 23, 2006 11:55 am Post subject: |
|
|
| the data seems to be real jittery. any reason why that might be? are the sensors you use just being a pain?
|
|
| Back to top |
|
 |
psyber
Joined: 02 Aug 2005 Posts: 46
|
Posted: Fri Jun 23, 2006 12:13 pm Post subject: |
|
|
| 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.
|
|
| Back to top |
|
 |
Diceman Cacti User
Joined: 25 Oct 2005 Posts: 139
|
Posted: Fri Jun 23, 2006 3:27 pm Post subject: |
|
|
i was actually referring to your graphs shown above. after thinking about it, it really is only a few small spikes throughout the course of the hour interval.
i just ordered the parts i need for mine, we'll see how it goes.
|
|
| Back to top |
|
 |
Diceman Cacti User
Joined: 25 Oct 2005 Posts: 139
|
Posted: Wed Jun 28, 2006 5:15 pm Post subject: |
|
|
got things working on the physical side. i am tinkering with different ways of wiring the devices though. it will probably end up with as a 110 punch down block that distributes the 1-wire signal. typical me, overcomplicate stuff.
|
|
| Back to top |
|
 |
Diceman Cacti User
Joined: 25 Oct 2005 Posts: 139
|
Posted: Wed Jun 28, 2006 9:58 pm Post subject: |
|
|
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?
|
|
| Back to top |
|
 |
thingles
Joined: 15 Oct 2006 Posts: 4
|
Posted: Sun Oct 15, 2006 3:24 pm Post subject: 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.
| Description: |
| Graph showing the bug for cold temperatures. |
|
| Filesize: |
33.77 KB |
| Viewed: |
4507 Time(s) |

|
|
|
| Back to top |
|
 |
thingles
Joined: 15 Oct 2006 Posts: 4
|
Posted: Sun Oct 15, 2006 4:56 pm Post subject: 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
| Code: | | for (my $i;$CONTENT =~ /<td colspan=1><INPUT CLASS="HA7Value" NAME="Temperature_\d+".*?VALUE="([0-9\.]+)">/g;$i++){ |
and change it to
| Code: | | for (my $i;$CONTENT =~ /<td colspan=1><INPUT CLASS="HA7Value" NAME="Temperature_\d+".*?VALUE="(-?[0-9\.]+)">/g;$i++){ |
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.
|
|
| Back to top |
|
 |
|