snmpv3 works but there are some problems

Post support questions that directly relate to Linux/Unix operating systems.

Moderators: Developers, Moderators

Post Reply
tecker2010
Posts: 24
Joined: Mon Jul 24, 2006 9:11 am
Location: Germany
Contact:

snmpv3 works but there are some problems

Post by tecker2010 »

Hi,

I have problems to view interface graphs.
I use snmpv3 and therefore i changed some things in my snmp.php as shown next:

Code: Select all

if (snmp_get_method($version) == SNMP_METHOD_PHP) {
                /* make sure snmp* is verbose so we can see what types of data
                we are getting back */
                snmp_set_quick_print(0);

                if ($version == "1") {
                        $snmp_value = @snmpget("$hostname:$port", $community, $oid, ($timeout * 1000), $retries);
                }elseif ($version == "2") {
                        $snmp_value = @snmp2_get("$hostname:$port", $community, $oid, ($timeout * 1000), $retries);
                }else{
                        $snmp_value = @snmp3_get("$hostname:$port", $username, "authPriv", "SHA", "DES", $password, "", "", $oid, ($timeout * 1000), $
retries);
[...]

Code: Select all

elseif ($version == "3") {
                        $snmp_auth = "-u $username -l authPriv -X read-only -x DES -a SHA -A $password"; /* v3 - username/password */
[...]

Code: Select all

snmp_set_quick_print(0);

                if ($version == "1") {
                        $temp_array = @snmprealwalk("$hostname:$port", $community, $oid, ($timeout * 1000), $retries);
                }elseif ($version == "2") {
                        $temp_array = @snmp2_real_walk("$hostname:$port", $community, $oid, ($timeout * 1000), $retries);
                }else{
                        $temp_array = @snmp3_real_walk("$hostname:$port", $username, "authPriv", "SHA", "DES", $password, "", "", $oid, ($timeout * 10
00), $retries);
My devices are UP and I get a CPU graph but no Interface statistics and the current(ms) and average(ms) time at the device-menu shows 0.

Debug on Interface Statisitcs prints "...no snmp data returned" but
"snmpwalk -v 3 -u read-user -A read-only -X read-only -l authPriv -x DES -a SHA 10.10.10.3 .1.3.6.1.2.1.2.2.1.1" works fine.

Output:

IF-MIB::ifIndex.1 = INTEGER: 1
IF-MIB::ifIndex.2 = INTEGER: 2
[...]

I made a snmp debug at the cisco switch and I saw, that there are 2 incoming snmp packets. one with level "noauth" and no username and one with level "priv" ... it 's also confusing.

Code: Select all

*Mar  8 03:44:55.949: SNMP: Packet received via UDP from 10.10.10.3 on Vlan11
*Mar  8 03:44:55.949:
Incoming SNMP packet
*Mar  8 03:44:55.949: v3 packet         security model: v3       security level: noauth
*Mar  8 03:44:55.949: username:
*Mar  8 03:44:55.949: snmpEngineID: 8000000903000019E81E8640
*Mar  8 03:44:55.949: snmpEngineBoots: 0        snmpEngineTime: 0
*Mar  8 03:44:55.949: SNMP: Report, reqid 1136794396, errstat 0, erridx 0
 internet.6.3.15.1.1.4.0 = 39
*Mar  8 03:44:55.949: SNMP: Packet sent via UDP to 10.10.10.3
*Mar  8 03:44:55.958: SNMP: Packet received via UDP from 10.10.10.3 on Vlan11
*Mar  8 03:44:55.958: SNMP: Get request, reqid 1136794395, errstat 0, erridx 0
 lsystem.58.0 = NULL TYPE/VALUE
*Mar  8 03:44:55.958:
Incoming SNMP packet
*Mar  8 03:44:55.958: v3 packet         security model: v3       security level: priv
*Mar  8 03:44:55.958: username: read-user
*Mar  8 03:44:55.958: snmpEngineID: 8000000903000019E81E8640
*Mar  8 03:44:55.958: snmpEngineBoots: 1        snmpEngineTime: 618227
*Mar  8 03:44:55.958: SNMP: Response, reqid 1136794395, errstat 0, erridx 0
 lsystem.58.0 = 4
Anyone with ideas or help?? :)

greetings
User avatar
TheWitness
Developer
Posts: 17061
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Get the output comming back with Numeric OID's and you should be in better shape.

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
tecker2010
Posts: 24
Joined: Mon Jul 24, 2006 9:11 am
Location: Germany
Contact:

Post by tecker2010 »

looks ok

Code: Select all

cacti@oslo$ snmpwalk -v 3 -u read-user -A read-only -X read-only -l authPriv -x DES -a SHA -On 10.10.10.3 .1.3.6.1.2.1.2.2.1.1
.1.3.6.1.2.1.2.2.1.1.1 = INTEGER: 1
.1.3.6.1.2.1.2.2.1.1.2 = INTEGER: 2
.1.3.6.1.2.1.2.2.1.1.3 = INTEGER: 3
.1.3.6.1.2.1.2.2.1.1.4 = INTEGER: 4
[...]
tecker2010
Posts: 24
Joined: Mon Jul 24, 2006 9:11 am
Location: Germany
Contact:

Post by tecker2010 »

ok, everything looks good. problem was a little typing error in my snmp.php *grrr*

greetings
Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests