snmpwalk error in apache logs

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

Moderators: Developers, Moderators

Post Reply
jrichardson
Cacti User
Posts: 66
Joined: Tue Mar 22, 2005 10:11 am

snmpwalk error in apache logs

Post by jrichardson »

Hi all,

I am trying to reload the SNMP - Interface Statistics for several cisco devices in my cacti (0.8.6g) install in order to get new interface descriptions from the devices. When I click the little circle I get the following error in my apache error_log file:

Code: Select all

Unknown output option passed to -O: U.
USAGE: snmpwalk [OPTIONS] AGENT [OID]

  Version:  5.0.6
  Web:      http://www.net-snmp.org/
  Email:    net-snmp-coders@lists.sourceforge.net

OPTIONS:
  -h, --help            display this help message
  -H                    display configuration file directives understood
  -v 1|2c|3             specifies SNMP version to use
  -V, --version         display package version number
SNMP Version 1 or 2c specific
  -c COMMUNITY          set the community string
SNMP Version 3 specific
  -a PROTOCOL           set authentication protocol (MD5|SHA)
  -A PASSPHRASE         set authentication protocol pass phrase
  -e ENGINE-ID          set security engine ID (e.g. 800000020109840301)
  -E ENGINE-ID          set context engine ID (e.g. 800000020109840301)
  -l LEVEL              set security level (noAuthNoPriv|authNoPriv|authPriv)
  -n CONTEXT            set context name (e.g. bridge1)
  -u USER-NAME          set security name (e.g. bert)
  -x PROTOCOL           set privacy protocol (DES|AES)
  -X PASSPHRASE         set privacy protocol pass phrase
  -Z BOOTS,TIME         set destination engine boots/time
General communication options
  -r RETRIES            set the number of retries
  -t TIMEOUT            set the request timeout (in seconds)
Debugging
  -d                    dump input/output packets in hexadecimal
  -D TOKEN[,...]        turn on debugging output for the specified TOKENs
                           (ALL gives extremely verbose debugging output)
General options
  -m MIB[:...]          load given list of MIBs (ALL loads everything)
  -M DIR[:...]          look in given list of directories for MIBs
  -P MIBOPTS            Toggle various defaults controlling MIB parsing:
                          u:  allow the use of underlines in MIB symbols
                          c:  disallow the use of "--" to terminate comments
                          d:  save the DESCRIPTIONs of the MIB objects
                          e:  disable errors when MIB symbols conflict
                          w:  enable warnings when MIB symbols conflict
                          W:  enable detailed warnings when MIB symbols conflict
                          R:  replace MIB symbols from latest module
  -O OUTOPTS            Toggle various defaults controlling output display:
                          b:  do not break OID indexes down
                          e:  print enums numerically
                          E:  escape quotes in string indices
                          f:  print full OIDs on output
                          n:  print OIDs numerically
                          q:  quick print for easier parsing
                          Q:  quick print with equal-signs
                          s:  print only last symbolic element of OID
                          S:  print MIB module-id plus last element
                          t:  print timeticks unparsed as numeric integers
                          T:  print human-readable text along with hex strings
                          u:  print OIDs using UCD-style prefix suppression
                          v:  print values only (not OID = value)
                          X:  extended index format
  -I INOPTS             Toggle various defaults controlling input parsing:
                          b:  do best/regex matching to find a MIB node
                          r:  do not check values for range/type legality
                          R:  do random access to OID labels
                          u:  top-level OIDs must have '.' prefix (UCD-style)
  -C APPOPTS            Set various application specific behaviours:
                          p:  print the number of variables found
                          i:  include given OID in the search range
                          c:  do not check returned OIDs are increasing

Why is this and where can I fix this?
jrichardson
Cacti User
Posts: 66
Joined: Tue Mar 22, 2005 10:11 am

Solved, maybe? Is this a bug?

Post by jrichardson »

Ok here's some more info and I think I fixed it....


This is on a RedHat 9.0 box with net-snmp 5.0.6-17. In this version the U parameter is not implemented in this version. (In SuSE 10 net-snmp version 5.2.1-10.2). This option is there.

What I've done is changed the line (around) 234 in lib/snmp.php from:

Code: Select all

$temp_array = exec_into_array(read_config_option("path_snmpwalk") . " -O QfntUe $snmp_auth -v $version -t $timeout -r $retries $hostname:$port $oid");
To:

Code: Select all

$temp_array = exec_into_array(read_config_option("path_snmpwalk") . " -O Qfnte $snmp_auth -v $version -t $timeout -r $retries $hostname:$port $oid");

Basically this removes the "U" parameter from the -O option to snmpwalk. What affects will this have and when was this changed? I do not remember this being an issue in 0.8.6c.

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

Post by TheWitness »

James,

You are using the binary version of net-snmp. The way to fix it is to upgrade net-snmp to 5.2.1 or above or use the php_snmp extension. Of course, what you did works as well...

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?
jrichardson
Cacti User
Posts: 66
Joined: Tue Mar 22, 2005 10:11 am

Post by jrichardson »

Yes, it does "fix" it, I'm curious if it is the best fix though.

What would upgrading net-snmp gain me (besides the obvious of having the U parameter working as expected. I'm worried about what other issues will I encounter.

What is the difference between the binary version of net-snmp and php_snmp? Is there a performance difference? Is it available in my version of PHP (RH9)?

Since this worked previouslly, why was the U added?
User avatar
TheWitness
Developer
Posts: 17047
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Well in Windows anyway, it provides quicker UI responses for things like data queries and the like. Also, if you are using cmd.php, it will speed polling. Cactid uses the net-snmp API. So, if you use it, you will not see any polling speed changes.

Another benefit, if you are using PHP 5.1.x, php_snmp utilizes bulk walk operations that will again speed the UI from a data query perspective. It's a marginal gain, but good for managing large internet routers.

I am not sure what you can get for RH 9 though. Give me a few months and I will definately know more.

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?
jrichardson
Cacti User
Posts: 66
Joined: Tue Mar 22, 2005 10:11 am

Post by jrichardson »

Thanks for the help....

I'm running PHP 4.2.2 and I do have the php-snmp extention loaded in my PHP config. How would one choose this method over the net-snmp binary method?

I've looked through the settings dialogs and have not seen any choices. I am using cmd.php and not cactid.

Is the change simply a bit that needs to be flipped and everything else would just magically work? Is the php-snmp considered stable?
User avatar
TheWitness
Developer
Posts: 17047
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Goto the Cacti Web Site and click on the cacti. After doing so, you will see a page with my name on it. At the bottom of the page, you will see if Cacti recognizes the PHP_SNMP extension for your web site.
Let me know what it says.

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?
jrichardson
Cacti User
Posts: 66
Joined: Tue Mar 22, 2005 10:11 am

Post by jrichardson »

Here is the information you requested:

Code: Select all

Cacti Variables
Operating System: unix
PHP SNMP Support: yes
It would appear that even if it has php-snmp support, cacti will still call the net-snmp net-snmp binaries from snmp.php. Is this the expected behavior? From your posts above, it sounds like this is not the expected behavior.
User avatar
TheWitness
Developer
Posts: 17047
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

This would only be the expected behavior if your host is snmpv2 and the PHP installation is so old that it does not include the v2 native function calls.

To test you could create a php file with the following "<?php print function_exists("snmp2_walk"); ?>". If the result is 0, the function does not exist. If it's 1, then I don't know.

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?
jrichardson
Cacti User
Posts: 66
Joined: Tue Mar 22, 2005 10:11 am

Post by jrichardson »

My hosts are SNMPv2 (I don't think 64bit counters are available in SNMPv1).

I did the test as you described, but I always got a "0" even if I tested for a builtin like echo :P
User avatar
TheWitness
Developer
Posts: 17047
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

You should update PHP to a more recent version, say 4.4.x or 5.1.x.

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?
jrichardson
Cacti User
Posts: 66
Joined: Tue Mar 22, 2005 10:11 am

Post by jrichardson »

Can you give some good reasons why to upgrade to a newer 4.x series PHP? I am in need of concrete reasons to justify the upgrade (which will impact other services on the machine); more than just "better/faster/newer".
User avatar
bulek
Cacti Pro User
Posts: 854
Joined: Mon May 20, 2002 2:07 am
Location: Poland
Contact:

Post by bulek »

There are some mentioned here http://www.php.net/ChangeLog-4.php

- Piotr
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests