Cacti (home)ForumsRepositoryDocumentation
Cacti: offical forums and support  

 FAQFAQ   SearchSearch   MemberlistMemberlist    RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in    


Sensatronics TempTrax monitoring template and script set

 
Post new topic   Reply to topic    Cacti Forum Index -> Scripts and Templates
Author Message
pvenezia



Joined: 13 Mar 2006
Posts: 20

PostPosted: Mon Mar 13, 2006 12:48 pm    Post subject: Sensatronics TempTrax monitoring template and script set Reply with quote

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



cacti-temptrax-0.0.1.tar.gz
 Description:

Download
 Filename:  cacti-temptrax-0.0.1.tar.gz
 Filesize:  3.9 KB
 Downloaded:  747 Time(s)

Back to top
jafne



Joined: 17 Aug 2006
Posts: 4

PostPosted: Thu Aug 17, 2006 3:01 pm    Post subject: Reply with quote

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:
[root@cactihost scripts]# perl query_temptrax.pl <IP Address> <IP Address> query probe
1:1
2:2
3:3
4:4

Quote:
[root@cactihost scripts]# perl query_temptrax.pl <IP Address> <IP Address> index
1:1
2:2
3:3
4:4

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


It sees all four probes.

Quote:
[root@cactihost 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'
Back to top
adrianmarsh
Cacti User


Joined: 17 Aug 2005
Posts: 417
Location: UK

PostPosted: Tue Apr 24, 2007 2:50 pm    Post subject: Reply with quote

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
Back to top
adrianmarsh
Cacti User


Joined: 17 Aug 2005
Posts: 417
Location: UK

PostPosted: Tue Apr 24, 2007 3:09 pm    Post subject: Reply with quote

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
Back to top
pontybiker



Joined: 04 Mar 2008
Posts: 3

PostPosted: Fri Mar 28, 2008 11:18 am    Post subject: Reply with quote

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
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Cacti Forum Index -> Scripts and Templates All times are GMT - 5 Hours
Page 1 of 1

 



Powered by phpBB © 2001, 2005 phpBB Group