No. Its irrelevent. The underlying issue is that the command line works but cacti will not return query results, no matter whether its v1 or v3 or what host I make the query against.
In a PM conversation, I was also asked for the following detail. Here is the XML file for the query I am writing (v3) and the associated command line data:
Code: Select all
<interface>
<name>Get SNMP Fan Speed</name>
<description>Queries an SS4200-E for a list of internal fans</description>
<oid_index>.1.3.6.1.4.1.1139.10.6.1.1.1</oid_index>
<oid_num_indexes>.1.3.6.1.4.1.1139.10.6.1.1.1.3</oid_num_indexes>
<index_order_type>numeric</index_order_type>
<fields>
<fanIndex>
<name>Index</name>
<method>walk</method>
<source>value</source>
<direction>input</direction>
<oid>.1.3.6.1.4.1.1139.10.6.1.1.1</oid>
</fanIndex>
<fanName>
<name>Name</name>
<method>walk</method>
<source>value</source>
<direction>input</direction>
<oid>.1.3.6.1.4.1.1139.10.6.1.1.2</oid>
</fanName>
<fanSpeed>
<name>Speed</name>
<method>walk</method>
<source>value</source>
<direction>output</direction>
<oid>.1.3.6.1.4.1.1139.10.6.1.1.3</oid>
</fanSpeed>
</fields>
</interface>
Also so you can see what the output would be expected to be:
Code: Select all
[dev@Falconnest snmp_queries]# snmpwalk -v 3 -a SHA -u cacti -A seekritSquirrelPassword -x AES 192.168.3.93 .1.3.6.1.4.1.1139.10.6.1.1.1
SNMPv2-SMI::enterprises.1139.10.6.1.1.1.1 = INTEGER: 1
SNMPv2-SMI::enterprises.1139.10.6.1.1.1.2 = INTEGER: 2
SNMPv2-SMI::enterprises.1139.10.6.1.1.1.3 = INTEGER: 3
[dev@Falconnest snmp_queries]# snmpwalk -v 3 -a SHA -u cacti -A seekritSquirrelPassword -x AES 192.168.3.93 .1.3.6.1.4.1.1139.10.6.1.1.1.3
SNMPv2-SMI::enterprises.1139.10.6.1.1.1.3 = INTEGER: 3
[dev@Falconnest snmp_queries]# snmpwalk -v 3 -a SHA -u cacti -A seekritSquirrelPassword -x AES 192.168.3.93 .1.3.6.1.4.1.1139.10.6.1.1.2
SNMPv2-SMI::enterprises.1139.10.6.1.1.2.1 = STRING: "CPU Fan"
SNMPv2-SMI::enterprises.1139.10.6.1.1.2.2 = STRING: "Internal Fan 1"
SNMPv2-SMI::enterprises.1139.10.6.1.1.2.3 = STRING: "Internal Fan 2"
[dev@Falconnest snmp_queries]# snmpwalk -v 3 -a SHA -u cacti -A seekritSquirrelPassword -x AES 192.168.3.93 .1.3.6.1.4.1.1139.10.6.1.1.3
SNMPv2-SMI::enterprises.1139.10.6.1.1.3.1 = Gauge32: 0
SNMPv2-SMI::enterprises.1139.10.6.1.1.3.2 = Gauge32: 1562
SNMPv2-SMI::enterprises.1139.10.6.1.1.3.3 = Gauge32: 1480
Here is essentially the same functionality, done as a PERL script invoking the command line net-smtp tools which
does work. Beautifully, in fact.
Code: Select all
#!/usr/bin/perl -w
use strict;
use Getopt::Long;
##########################
#
# SS4200-E_getFans.pl - Retrieve fan information using SMTP v3 from an Intel SS4200-E
#
#########################
# SYNOPSIS
#
# SS4200-E_getFans.pl -h <host> -u <user> -p <password> [-v]
#
# SS4200-E_getFans.pl -h 192.168.3.93 -u admin -p secretSquirrel -v
#
#########################
############
# Setup key variables we are going to need to track globally.
#
# Host is a string FQDN or IP address that is the target of our query.
#
# User is a string for the username to authenticate against the SS4200-E SMTP.
#
# Password is a string for the password to authenticate against the SS4200-E SMTP.
#
# Verbose is a boolean/binary value of whether we are going to dump verbose error data. Defaults to off (0).
#
###
my ($host, $user, $password, $verbose, $output);
# Get the options from the command line.
GetOptions (
"h=s" => \$host,
"u=s" => \$user,
"p=s" => \$password,
"v!" => \$verbose,
);
# To be able to run at all, we need the host, user and password.
# Without any of the three, we need to terminate immediately.
if (!$host || !$user || !$password) {
print "Not enough arguments. Require at least host, user, and password specified. \n";
exit(0);
}
# Set our default for the verbosity if it was not specified on the commandline.
if (!$verbose) {$verbose= 0;}
# Setup some temporary variable data.
my ($query, $fancpu, $fansysone, $fansystwo);
#################
# Get the fan data.
# This is based on the EMC SOHO MIB, which has an odd but known OID.
#
# Requires 5 values. host, user, password, fanid, verbose
###
sub getFanData {
#variables to hold our input
my ($Hhost, $Huser, $Hpassword, $Hfanid, $Hverbose) = @_;
#variable to return output
my $fanspeed;
my $query;
$query = `snmpwalk -v 3 -a SHA -u $Huser -A $Hpassword -l noAuthNoPriv -x AES $Hhost .1.3.6.1.4.1.1139.10.6.1.1.3.$Hfanid`;
# Check for a match against the regex for the end of an expected single line.
if($query =~ m/Gauge32: (\d+)$/) {
# We got a match against our check looking for the fan RPM value.
$fanspeed = $1;
} else {
# We couldnt get our regex match, so if verbose is set, lets drop an error.
$fanspeed = 0;
if($Hverbose) {
print "\n";
print "CPU Fan SMTP Query failed.\n\n";
print "$query\n";
print "\n";
}
}
return $fanspeed;
}
####
#
# End Sub for getting fan data.
#
###
$fancpu = &getFanData($host, $user, $password, 1, $verbose);
$fansysone = &getFanData($host, $user, $password, 2, $verbose);
$fansystwo = &getFanData($host, $user, $password, 3, $verbose);
# Lets drop the output line.
print "cpufan:$fancpu sysonefan:$fansysone systwofan:$fansystwo";