Sensatronics TempTrax monitoring template and script set
Moderators: Developers, Moderators
Sensatronics TempTrax monitoring template and script set
Since I couldn't find anything useful for the Sensatronics 3000 environmental probes, I wrote this template and script set.
INSTALLATION:
Import the cacti_host_template_temptrax.xml file into Cacti using the Web interface. Then, copy the temptrax.xml file to |cacti_path|/resource/script_queries, and copy query_temptrax.pl to |cacti_path|/scripts. Edit query_temptrax.pl and change $comm to a valid SNMP read community for your temptrax devices.
(I can't use the Cacti host_snmp_community var here, since Cacti can't think that it's actually an SNMP query, so all your TempTrax devices will need to have the same RO community.)
Chown both files to your cacti user.
Add a new device, choose TempTrax as the host template, enter a description, the IP/hostname of the temptrax device, *REMOVE* the SNMP community, and click create. The data query at the bottom should populate with the names of the probes configured on the device. Click Add Graphs and group select them, and click save.
Note: I've only tested this on an E4, but the query script does parse out how many probes exist and should handle them all.
-P
INSTALLATION:
Import the cacti_host_template_temptrax.xml file into Cacti using the Web interface. Then, copy the temptrax.xml file to |cacti_path|/resource/script_queries, and copy query_temptrax.pl to |cacti_path|/scripts. Edit query_temptrax.pl and change $comm to a valid SNMP read community for your temptrax devices.
(I can't use the Cacti host_snmp_community var here, since Cacti can't think that it's actually an SNMP query, so all your TempTrax devices will need to have the same RO community.)
Chown both files to your cacti user.
Add a new device, choose TempTrax as the host template, enter a description, the IP/hostname of the temptrax device, *REMOVE* the SNMP community, and click create. The data query at the bottom should populate with the names of the probes configured on the device. Click Add Graphs and group select them, and click save.
Note: I've only tested this on an E4, but the query script does parse out how many probes exist and should handle them all.
-P
- Attachments
-
- cacti-temptrax-0.0.1.tar.gz
- (3.9 KiB) Downloaded 1711 times
I'm not getting the graphs. I've tested the script from the command line, and it's working fine there, but it's not getting into the graphs for some reason. Here's some output of things I've seen. I'm new to cacti (using 0.8.6h and perl 5.8.6 on a Red Hat FC4 system), so if you need more info, let me know.
I did make one change to the .pl script because when doing a "get temp 1" it was always returning "0". I changed this line
I created the device as instructed, removing the SNMP Community string. When I do the "Verbose Query" from the cacti interface, I get this:
I did make one change to the .pl script because when doing a "get temp 1" it was always returning "0". I changed this line
to this$tempdata{$1}{temp} = $4 if $3 eq 'INTEGER';
to get the temperature. It returns the STRING value of the temperature rather then the INTEGER value, but I couldn't get it to work if I told it to print if $2==2.$tempdata{$1}{temp} = $4 if $2 == 3;
[root@cactihost scripts]# perl query_temptrax.pl <IP Address> <IP Address> query probe
1:1
2:2
3:3
4:4
[root@cactihost scripts]# perl query_temptrax.pl <IP Address> <IP Address> index
1:1
2:2
3:3
4:4
It sees all four probes.[root@cactihost scripts]# perl query_temptrax.pl <IP Address> <IP Address> query name
1:Probe 1
2:Probe 2
3:Probe 3
4:Probe 4
Probes 2-4 are not active, so they always report back that the temperature is -100.[root@cactihost scripts]# perl query_temptrax.pl <IP Address> <IP Address> get temp 1
71
I created the device as instructed, removing the SNMP Community string. When I do the "Verbose Query" from the cacti interface, I get this:
+ Running data query [10].
+ Found type = '4 '[script query].
+ Found data query XML file at '/usr/share/cacti/resource/script_queries/temptrax.xml'
+ XML file parsed ok.
+ Executing script for list of indexes 'perl /usr/share/cacti/scripts/query_temptrax.pl <IP Address> <IP Address> index'
+ Executing script query 'perl /usr/share/cacti/scripts/query_temptrax.pl <IP Address> <IP Address> query probe'
+ Found item [probe='1'] index: 1
+ Found item [probe='2'] index: 2
+ Found item [probe='3'] index: 3
+ Found item [probe='4'] index: 4
+ Executing script query 'perl /usr/share/cacti/scripts/query_temptrax.pl <IP Address> <IP Address> query name'
+ Found item [name='Probe 1'] index: 1
+ Found item [name='Probe 2'] index: 2
+ Found item [name='Probe 3'] index: 3
+ Found item [name='Probe 4'] index: 4
+ Found data query XML file at '/usr/share/cacti/resource/script_queries/temptrax.xml'
+ Found data query XML file at '/usr/share/cacti/resource/script_queries/temptrax.xml'
+ Found data query XML file at '/usr/share/cacti/resource/script_queries/temptrax.xml'
+ Found data query XML file at '/usr/share/cacti/resource/script_queries/temptrax.xml'
- adrianmarsh
- Cacti User
- Posts: 437
- Joined: Wed Aug 17, 2005 8:51 am
- Location: UK
I also only get 0's returned for my E4..
SNMP walk sample gives:
SNMP walk sample gives:
If I understand the perl script correctly, it sorts and parses for the INTEGER string, and takes the value as the result. But I think its taking .4.0 rather than the .3.0SNMPv2-SMI::enterprises.16174.1.1.1.3.1.1.0 = STRING: "CAB1"
SNMPv2-SMI::enterprises.16174.1.1.1.3.1.2.0 = STRING: "26.0"
SNMPv2-SMI::enterprises.16174.1.1.1.3.1.3.0 = INTEGER: 26
SNMPv2-SMI::enterprises.16174.1.1.1.3.1.4.0 = INTEGER: 0
SNMPv2-SMI::enterprises.16174.1.1.1.3.1.5.0 = STRING: "OPEN"
SNMPv2-SMI::enterprises.16174.1.1.1.3.2.1.0 = STRING: "CAB3"
SNMPv2-SMI::enterprises.16174.1.1.1.3.2.2.0 = STRING: "-99.9"
SNMPv2-SMI::enterprises.16174.1.1.1.3.2.3.0 = INTEGER: -100
SNMPv2-SMI::enterprises.16174.1.1.1.3.2.4.0 = INTEGER: 0
SNMPv2-SMI::enterprises.16174.1.1.1.3.2.5.0 = STRING: "OPEN"
- adrianmarsh
- Cacti User
- Posts: 437
- Joined: Wed Aug 17, 2005 8:51 am
- Location: UK
-
- Posts: 3
- Joined: Tue Mar 04, 2008 9:42 am
Hi guy's. I hope some of you are still on these forums!
I'd love to get this script working but I'm getting the following information when I do a Verbose Query
+ Running data query [18].
+ Found type = '4 '[script query].
+ Found data query XML file at 'C:/Inetpub/wwwroot/cacti/resource/script_queries/temptrax.xml'
+ XML file parsed ok.
+ Executing script for list of indexes 'perl C:\Inetpub\wwwroot\cacti\scripts\query_temptrax.pl 192.168.199.201 192.168.199.201 index'
+ Executing script query 'perl C:\Inetpub\wwwroot\cacti\scripts\query_temptrax.pl 192.168.199.201 192.168.199.201 query probe'
+ Executing script query 'perl C:\Inetpub\wwwroot\cacti\scripts\query_temptrax.pl 192.168.199.201 192.168.199.201 query name'
+ Found data query XML file at 'C:/Inetpub/wwwroot/cacti/resource/script_queries/temptrax.xml'
+ Found data query XML file at 'C:/Inetpub/wwwroot/cacti/resource/script_queries/temptrax.xml'
+ Found data query XML file at 'C:/Inetpub/wwwroot/cacti/resource/script_queries/temptrax.xml'
I'm not able to create any graphs? I'm running Cacti on windows.
I would really appreciate it if someone could help!!!!
Kind regards,
Jamie
I'd love to get this script working but I'm getting the following information when I do a Verbose Query
+ Running data query [18].
+ Found type = '4 '[script query].
+ Found data query XML file at 'C:/Inetpub/wwwroot/cacti/resource/script_queries/temptrax.xml'
+ XML file parsed ok.
+ Executing script for list of indexes 'perl C:\Inetpub\wwwroot\cacti\scripts\query_temptrax.pl 192.168.199.201 192.168.199.201 index'
+ Executing script query 'perl C:\Inetpub\wwwroot\cacti\scripts\query_temptrax.pl 192.168.199.201 192.168.199.201 query probe'
+ Executing script query 'perl C:\Inetpub\wwwroot\cacti\scripts\query_temptrax.pl 192.168.199.201 192.168.199.201 query name'
+ Found data query XML file at 'C:/Inetpub/wwwroot/cacti/resource/script_queries/temptrax.xml'
+ Found data query XML file at 'C:/Inetpub/wwwroot/cacti/resource/script_queries/temptrax.xml'
+ Found data query XML file at 'C:/Inetpub/wwwroot/cacti/resource/script_queries/temptrax.xml'
I'm not able to create any graphs? I'm running Cacti on windows.
I would really appreciate it if someone could help!!!!
Kind regards,
Jamie
I also only got 0's returned for my E4... so I changed the perl script a little. It also returns the 2.0 value instead of the 3.0 one now.
According to the documentation I found about the Sensatronics MIBS, .16174.1.1.1.1.9.0 returns the number of probes, so I used that line of
data instead of stripping the E from the model returned in .16174.1.1.1.1.2.0.
According to the documentation I found about the Sensatronics MIBS, .16174.1.1.1.1.9.0 returns the number of probes, so I used that line of
data instead of stripping the E from the model returned in .16174.1.1.1.1.2.0.
Code: Select all
foreach my $snmpret (<WALK>) {
chomp($snmpret);
$snmpret =~ s/\"//g;
if ($snmpret =~ /\.1\.3\.6\.1\.4\.1\.16174\.1\.1\.1\.1\.9\.0\s=\sINTEGER:\s(.+)/) {
$probecount = $1;
}
if ($snmpret =~ /\.1\.3\.6\.1\.4\.1\.16174\.1\.1\.1\.3\.(\d)\.(\d)\.0\s=\s(\w+):\s(.*)/) {
if ($1 <= $probecount) {
$tempdata{$1}{probe} = $1;
$tempdata{$1}{name} = $4 if $2 == 1;
$tempdata{$1}{temp} = $4 if $2 == 2;
}
}
}
- adrianmarsh
- Cacti User
- Posts: 437
- Joined: Wed Aug 17, 2005 8:51 am
- Location: UK
I've been using this script for a while now.. but I do keep seeing script timeouts, so had a quick look at under the hood.
Why do we need a script at all?
Cacti can poll the matrix of values on its own I think though I've not done this for Sentronix kit yet, I may well try. But before I do I figure there must be a reason why the script exists.
Why do we need a script at all?
Cacti can poll the matrix of values on its own I think though I've not done this for Sentronix kit yet, I may well try. But before I do I figure there must be a reason why the script exists.
Re: Sensatronics TempTrax monitoring template and script set
We have been using this solution for quite some time to plot temperature data from several Sensatronix E4 units without any issues.
However, we recently bought a Sensatronix U16 (16 port) unit and found that the script did not work for it (no data presented at all).
Further digging revealed that Sensatronics has changed the OIDs between the models, possibly because of updated firmware.
In any case, this forced us to re-write the query_temptrax.pl script to handle both the old E4 units and the new U16 unit.
Please find the updated script attached.
It has been tested and found working on the following Sensatronix units (plotting temperature):
Sensatronix E4, firmware version 6.0 with release date June 17, 2008
Sensatronix U16, firmware version 6.2 with release date March 9, 2009
/Otto
However, we recently bought a Sensatronix U16 (16 port) unit and found that the script did not work for it (no data presented at all).
Further digging revealed that Sensatronics has changed the OIDs between the models, possibly because of updated firmware.
In any case, this forced us to re-write the query_temptrax.pl script to handle both the old E4 units and the new U16 unit.
Please find the updated script attached.
It has been tested and found working on the following Sensatronix units (plotting temperature):
Sensatronix E4, firmware version 6.0 with release date June 17, 2008
Sensatronix U16, firmware version 6.2 with release date March 9, 2009
/Otto
- Attachments
-
- query_temptrax.pl
- (2.25 KiB) Downloaded 606 times
Who is online
Users browsing this forum: No registered users and 5 guests