|
|
| Author |
Message |
chummers
Joined: 02 Jul 2008 Posts: 6
|
Posted: Thu Jul 03, 2008 7:21 am Post subject: Getting Temptrax working... |
|
|
Hello all,
I have recently installed cacti on a VM server, I am looking to monitor several sensatronics temperature sensors.
I am looking at monitoring a couple of E4's a few E8's, and an E16.
I have installed the temptrax template, and i have it working for one of the E4's
But this is where my problems start, I can add the others into the devices section, but the temptrax query displays 0 rows, 0 colums. I get this for the other few E4's, E8's and E16.
I have tried to do the snmpwalk without success. but if i run perl temptrax 192.168.1.1 192.168.1.1 query name on the good sensor, i get the four probes displayed.
but if i do the same for the other sensatronics boxes, i just get a time out..
I can incidently ping the others, and get sensor data from them using nagios(its running a temptrax binary) and the web front end....
I have spent a few days struggling, and reading posts on here but i have not discovered a solution...Is there anyone who can help please??
Thanks! |
|
| Back to top |
|
 |
gandalf Developer
Joined: 02 Dec 2004 Posts: 11223 Location: Muenster, Germany
|
Posted: Thu Jul 03, 2008 10:42 am Post subject: |
|
|
Well, this depends on how the Data Query works. As I do not have access to such a device, I'm not able to test on my own. Are you able to debug the script? Perhaps, it has a fiexd limitation to 4 probes?
The other way round would be to use the nagios stuff and feed data into cacti. See 1st link of my sig for a start
Reinhard |
|
| Back to top |
|
 |
chummers
Joined: 02 Jul 2008 Posts: 6
|
Posted: Fri Jul 04, 2008 2:40 am Post subject: |
|
|
Thanks Gandalf!
I have since discovered that this may be a mis-configuration with the temp sensors..
I just seems funny that one E4 works and the other E4's dont...
I am using the same templates and same method, and even when i smtpwalk the others they just time out, this is not the case for the working one., so logic says it is something to do with the sensors, and not the way that cacti is handling them??
I wiil make sure the rest are configured the same as the working one and i will get back to you..
Thanks for your help so far!!
Regards,
Chummers |
|
| Back to top |
|
 |
chummers
Joined: 02 Jul 2008 Posts: 6
|
Posted: Tue Jul 22, 2008 6:50 am Post subject: |
|
|
I have managed to get all the E4's and E8's working just need to get the last E16 working....
Right i have been doing some more looking around and this is what i have discovered...
I have been looking at the perl script that reads the OID's
If i walk the OID's from all different type of temp sensors i get the following...
E4
the result from OID .1.3.6.1.4.1.16174.1.1.1.1.2.0 is :
SNMPv2-SMI::enterprises.16174.1.1.1.1.2.0 = STRING: "E4"
E8
The result from OID .1.3.6.1.4.1.16174.1.1.1.1.2.0 is :
SNMPv2-SMI::enterprises.16174.1.1.1.1.2.0 = STRING: "E8"
E16
The result from OID .1.3.6.1.4.1.16174.1.1.1.1.2.0 is :
SNMPv2-SMI::enterprises.16174.1.1.1.1.2.0 = Hex-STRING: 50 38 21 17 02
So it looks like the E16 has some different enteries, but being i know no perl whatsoever, i am finding this very difficult to change.
below is the script i am using, so i will need to call it a different name (i had to do this for the differences between the E4's and the E8's)
(so one script for the E4, one for the E8 and so on....)
| Code: | #!/usr/bin/perl
#
# Cacti TempTrax query script, 03.05.06 Paul Venezia (pvenezia@jpj.net)
#
# It's pretty ugly, but the non-standard SNMP support in these
# devices makes this necessary. Sigh.
#
#
use strict;
use Data::Dumper;
my ($probecount);
my %tempdata;
my $probe = $ARGV[0];
my $comm = 'secret';
#my $comm = $ARGV[1];
my $func = $ARGV[2];
open(WALK, "/usr/bin/snmpwalk -c $comm -v1 -On $probe .iso |grep -v 4.0|");
foreach my $snmpret (<WALK>) {
chomp($snmpret);
if ($snmpret =~ /\.1\.3\.6\.1\.4\.1\.16174\.1\.1\.1\.1\.2\.0\s=\sSTRING:\s\"(.+)\"/) {
my $pcount = $1;
$pcount =~ s/^E//;
$probecount = $pcount;
}
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}{name} =~ s/\"//;
$tempdata{$1}{temp} = $4 if $3 eq 'INTEGER';
}
}
}
#print Dumper %tempdata;
if ($func eq "index") {
foreach my $pindex ( sort keys %tempdata ) {
print "$pindex:$pindex\n";
}
} elsif ($func eq "get") {
foreach my $pindex ( sort keys %tempdata ) {
print "$tempdata{$pindex}{$ARGV[3]}" if $ARGV[4] == $pindex;
}
} elsif ($func eq "query") {
foreach my $pindex ( sort keys %tempdata ) {
print "$pindex:$tempdata{$pindex}{$ARGV[3]}\n";
}
}
#print Dumper %licstatus;
|
I think i should be using the OID .1.3.6.1.4.1.16174.1.1.1.1.9 (which will return the value of 16 (just what i need) but its an integer, not a string
I do not know how to use the new OID, everytime i change a value, it just seems to break the script.... - get no output...
I know what i need to do but dont know the perl syntax to accomplish it...
Can anyone help me please - not sure if this is in the right place, if not sorry ...... |
|
| Back to top |
|
 |
chummers
Joined: 02 Jul 2008 Posts: 6
|
Posted: Thu Jul 24, 2008 10:11 am Post subject: |
|
|
Respectfully bumping
I could really use some help please...
Seem so close yet so far... |
|
| Back to top |
|
 |
TheWitness Developer
Joined: 14 May 2002 Posts: 9255 Location: MI, USA
|
Posted: Thu Jul 24, 2008 11:18 pm Post subject: |
|
|
Gandolf is taking a well deserved vacation. He may get back to you in a week or so.
TheWitness |
|
| Back to top |
|
 |
TheWitness Developer
Joined: 14 May 2002 Posts: 9255 Location: MI, USA
|
Posted: Thu Jul 24, 2008 11:20 pm Post subject: |
|
|
IMHO, that script sucks. It is very inefficient and would be very prone to latency, and spike the CPU on the device (depending on it's clock). It should be "respectfully" rewritten. There are many examples. I would do it for $$, if I could find the time.
TheWitness |
|
| Back to top |
|
 |
chummers
Joined: 02 Jul 2008 Posts: 6
|
Posted: Fri Jul 25, 2008 2:24 am Post subject: |
|
|
Hi TheWitness!,
Thank you for your reply, Gandalf does look like a busy person indeed!
I will wait for his return - I hope he enjoys his break
Something you may be able to answer in the meantime...
Since i do not know any perl whatsoever, can i rewrite this script in another language - is cacti really fussed (as long as it can query the values?) i was thinking about bash or something....
I guess it would just be a case of pointing the .xml file to a .sh rather than a .pl file??
I think it may be better for me to do this, since i have to get the E16 working, and then the EM1 (which outputs temperature, humidity, and wetness....)
I makes it rather awkward to actually know what this perl script does, since the auther did not put any comments in whatsoever... |
|
| Back to top |
|
 |
TheWitness Developer
Joined: 14 May 2002 Posts: 9255 Location: MI, USA
|
Posted: Fri Jul 25, 2008 12:11 pm Post subject: |
|
|
You are correct. I prefer the PHP Script Server cause it's very fast, I have some systems using Script Server that poll 100% scripts 50k calls in less than 30 seconds, but shell script bash/ksh/csh work all fine as well.
TheWitness |
|
| Back to top |
|
 |
|