Code: Select all
RRDTool Says:
ERROR: Not a valid vname: #4668E4 in line AREA:#4668E4:Temperature (Celcius)
Moderators: Developers, Moderators
Code: Select all
RRDTool Says:
ERROR: Not a valid vname: #4668E4 in line AREA:#4668E4:Temperature (Celcius)
Code: Select all
<interface>
<name>Get Omnitronix SL81 statistics</name>
<script_path>/usr/bin/perl |path_cacti|/scripts/omnitronix_sl81.pl</script_path>
<arg_prepend>|host_hostname| |host_snmp_community| </arg_prepend>
<arg_index>index</arg_index>
<arg_query>query</arg_query>
<arg_get>get</arg_get>
<arg_num_indexes>num_indexes</arg_num_indexes>
<output_delimeter>:</output_delimeter>
<index_order>omniID</index_order>
<index_order_type>numeric</index_order_type>
<index_title_format>|chosen_order_field|</index_title_format>
<fields>
<omniID>
<name>Temperature sensor Index Number</name>
<direction>input</direction>
<query_name>omniID</query_name>
</omniID>
<omniSensor>
<name>Omnitronix sensor device name</name>
<direction>input</direction>
<query_name>omniSensor</query_name>
</omniSensor>
<omniTemp>
<name>Omnitronix Temperature</name>
<direction>output</direction>
<query_name>omniTemp</query_name>
</omniTemp>
</fields>
</interface>
Code: Select all
#!/usr/bin/perl
use SNMP_util;
#print "0: $ARGV[0] 1: $ARGV[1] 2: $ARGV[2] 3: $ARGV[3] 4: $ARGV[4] \n";
if (($ARGV[2] ne "query") && ($ARGV[2] ne "get") && ($ARGV[2] ne "index")) {
print "usage:\n\n ./omnitronix_sl81.pl host community index \
\n./omnitronix_sl81.pl host community query {omniSensor, omniID, omniTemp} \
\n./omnitronix_sl81.pl host community get {omniSensor, omniID, omniTemp} DEVICE\n"; \
exit;
}
my $host = $ARGV[0];
my $community = $ARGV[1];
my ($connectfield) = $community . "\@" . $host;
my ($indexnum) = &snmpget($connectfield, "1.3.6.1.4.1.3052.5.2.1.1");
my ($oid) = "";
if($ARGV[2] eq "index") {
@id = &snmpwalk($connectfield, "1.3.6.1.4.1.3052.5.2.1.2.1.1");
foreach(@id) { my ($index, $val) = split(/:/); print $val."\n";}
}
if($ARGV[2] eq "query") {
@id = &snmpwalk($connectfield, "1.3.6.1.4.1.3052.5.2.1.2.1.1");
foreach (@id) {
my ($idx, $val) = split(/:/);
if($ARGV[3] eq "omniSensor") {
$name = &snmpget($connectfield, "1.3.6.1.4.1.3052.5.1.1.1.1.4.$val.1.1");
print "$val:$name\n";
}
elsif($ARGV[3] eq "omniID") {
print "$val:$val\n";
}
elsif($ARGV[3] eq "omniTemp") {
$value = &snmpget($connectfield, "1.3.6.1.4.1.3052.5.1.1.1.1.6.$val.1.1");
print "$val:$value\n";
}
else {
print $val.":\n";
}
}
}
elsif($ARGV[2] eq "get") {
$idx = $ARGV[4];
if($ARGV[3] eq "omniSensor") {
$name = &snmpget($connectfield, "1.3.6.1.4.1.3052.5.1.1.1.1.4.$idx.1.1");
print "$name";
}
elsif($ARGV[3] eq "omniID") {
print "$idx";
}
elsif($ARGV[3] eq "omniTemp") {
$value = &snmpget($connectfield, "1.3.6.1.4.1.3052.5.1.1.1.1.6.$idx.1.1");
print "$value";
}
else {
}
}
Users browsing this forum: No registered users and 12 guests