Cacti (home)ForumsDocumentation
Cacti: offical forums and support
It is currently Thu Jun 27, 2019 5:18 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 10 posts ] 
Author Message
 Post subject: Sensatronics TempTrax monitoring template and script set
PostPosted: Mon Mar 13, 2006 12:48 pm 
Offline

Joined: Mon Mar 13, 2006 12:39 pm
Posts: 20
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 1560 times
Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 17, 2006 3:01 pm 
Offline

Joined: Thu Aug 17, 2006 7:59 am
Posts: 6
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
Quote:
$tempdata{$1}{temp} = $4 if $3 eq 'INTEGER';

to this
Quote:
$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.

Quote:
[[email protected] scripts]# perl query_temptrax.pl <IP Address> <IP Address> query probe
1:1
2:2
3:3
4:4

Quote:
[[email protected] scripts]# perl query_temptrax.pl <IP Address> <IP Address> index
1:1
2:2
3:3
4:4

Quote:
[[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.

Quote:
[[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:

Quote:
+ 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'


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 24, 2007 2:50 pm 
Offline
Cacti User
User avatar

Joined: Wed Aug 17, 2005 8:51 am
Posts: 435
Location: UK
I also only get 0's returned for my E4..

SNMP walk sample gives:

Quote:
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


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 24, 2007 3:09 pm 
Offline
Cacti User
User avatar

Joined: Wed Aug 17, 2005 8:51 am
Posts: 435
Location: UK
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


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 28, 2008 11:18 am 
Offline

Joined: Tue Mar 04, 2008 9:42 am
Posts: 3
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


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 04, 2009 6:53 am 
Offline
Cacti User

Joined: Fri Mar 12, 2004 1:22 pm
Posts: 443
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....


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 17, 2009 2:41 am 
Offline

Joined: Fri Jul 17, 2009 2:21 am
Posts: 1
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:
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;
                }
        }
}


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 17, 2009 3:21 am 
Offline
Cacti User

Joined: Fri Mar 12, 2004 1:22 pm
Posts: 443
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....


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 07, 2009 6:52 am 
Offline
Cacti User
User avatar

Joined: Wed Aug 17, 2005 8:51 am
Posts: 435
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.


Top
 Profile  
 
 Post subject: Re: Sensatronics TempTrax monitoring template and script set
PostPosted: Thu Oct 06, 2011 8:57 am 
Offline

Joined: Mon Oct 12, 2009 6:59 am
Posts: 17
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 462 times
Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 1 guest


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

Search for:
Jump to:  

Protected by Anti-Spam ACP Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group