Sensatronics TempTrax monitoring template and script set

Templates, scripts for templates, scripts and requests for templates.

Moderators: Moderators, Developers

Post Reply
Author
Message
pvenezia
Posts: 20
Joined: Mon Mar 13, 2006 12:39 pm

Sensatronics TempTrax monitoring template and script set

#1 Post by pvenezia » Mon Mar 13, 2006 12:48 pm

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
Attachments
cacti-temptrax-0.0.1.tar.gz
(3.9 KiB) Downloaded 1579 times

jafne
Posts: 6
Joined: Thu Aug 17, 2006 7:59 am

#2 Post by jafne » Thu Aug 17, 2006 3:01 pm

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
$tempdata{$1}{temp} = $4 if $3 eq 'INTEGER';
to this
$tempdata{$1}{temp} = $4 if $2 == 3;
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.
[[email protected] scripts]# perl query_temptrax.pl <IP Address> <IP Address> query probe
1:1
2:2
3:3
4:4
[[email protected] scripts]# perl query_temptrax.pl <IP Address> <IP Address> index
1:1
2:2
3:3
4:4
[[email protected] scripts]# perl query_temptrax.pl <IP Address> <IP Address> query name
1:Probe 1
2:Probe 2
3:Probe 3
4:Probe 4
It sees all four probes.
[[email protected] scripts]# perl query_temptrax.pl <IP Address> <IP Address> get temp 1
71
Probes 2-4 are not active, so they always report back that the temperature is -100.

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'

User avatar
adrianmarsh
Cacti User
Posts: 435
Joined: Wed Aug 17, 2005 8:51 am
Location: UK

#3 Post by adrianmarsh » Tue Apr 24, 2007 2:50 pm

I also only get 0's returned for my E4..

SNMP walk sample gives:
SNMPv2-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"
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.0

User avatar
adrianmarsh
Cacti User
Posts: 435
Joined: Wed Aug 17, 2005 8:51 am
Location: UK

#4 Post by adrianmarsh » Tue Apr 24, 2007 3:09 pm

ok... proved my point.. I changed it to:

open(WALK, "/usr/bin/snmpwalk -c $comm -v1 -On $probe .iso |grep -v 4.0|");


so that 4.0 was removed.. Its a crude hack but I don't know perl well enough to change the other code

pontybiker
Posts: 3
Joined: Tue Mar 04, 2008 9:42 am

#5 Post by pontybiker » Fri Mar 28, 2008 11:18 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

argon0
Cacti User
Posts: 443
Joined: Fri Mar 12, 2004 1:22 pm

#6 Post by argon0 » Wed Mar 04, 2009 6:53 am

Getting exactly the same thing.

Which version of Cacti are you running, I'm on .8.7d...
[size=50]No longer a n00by but[/size] not yet an 0ldby

Now Head of Technology at RSCH, back to the prickly subject of Monitorring....

akavya
Posts: 1
Joined: Fri Jul 17, 2009 2:21 am

#7 Post by akavya » Fri Jul 17, 2009 2:41 am

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.

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;
                }
        }
}

argon0
Cacti User
Posts: 443
Joined: Fri Mar 12, 2004 1:22 pm

#8 Post by argon0 » Fri Jul 17, 2009 3:21 am

E16 gave up the ghost the other day. We've just bought a Climate CM-2 which I will be setting up to monitor via Cacti shortly...
[size=50]No longer a n00by but[/size] not yet an 0ldby

Now Head of Technology at RSCH, back to the prickly subject of Monitorring....

User avatar
adrianmarsh
Cacti User
Posts: 435
Joined: Wed Aug 17, 2005 8:51 am
Location: UK

#9 Post by adrianmarsh » Mon Sep 07, 2009 6:52 am

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.

ottow
Posts: 17
Joined: Mon Oct 12, 2009 6:59 am

Re: Sensatronics TempTrax monitoring template and script set

#10 Post by ottow » Thu Oct 06, 2011 8:57 am

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
Attachments
query_temptrax.pl
(2.25 KiB) Downloaded 479 times

Post Reply