Warning: Invalid Argument Supplied- snmp.php

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

Post Reply
hgrueber
Posts: 4
Joined: Tue Sep 15, 2009 7:25 pm

Warning: Invalid Argument Supplied- snmp.php

Post by hgrueber »

Hi,

When adding devices into Cacti I receive the following warning messages in the console after walking via snmp:

Warning: Invalid argument supplied for foreach() in /usr/share/cacti/site/lib/snmp.php on line 277

Warning: Invalid argument supplied for foreach() in /usr/share/cacti/site/lib/snmp.php on line 483

Warning: Cannot modify header information - headers already sent by (output started at /usr/share/cacti/site/lib/snmp.php:277) in /usr/share/cacti/site/host.php on line 164


I have checked snmp.php and line 277 refers to:

foreach($banned_snmp_strings as $item) {
if(strstr($value, $item) != "") {
unset($temp_array[$key]);
continue 2;


Also line 483:

foreach($banned_snmp_strings as $item) {
if(strstr($string, $item) != "") {
$string = "";
break;


Line 164 in host.php refers to:

header("Location: host.php?action=edit&id=" . (empty($host_id) ? $_POST["id"] : $host_id));^M

I can't see any errors in the cacti log.

It appears that Cacti is polling devices and graphing correctly however I'd like to fix these warning messages. Any suggestions on how to fix?

Versions:
snmp: 5.4.1
php-snmp: 5.2.6
apache2: apache2.2.11
rrdtool: 1.3.x
OS: Ubuntu 9.0.4
Cacti version: 0.8.7e with current official patches and plugin architecture installed - no plugins installed/enabled.

Poller is cmd.php.

Hansy
hgrueber
Posts: 4
Joined: Tue Sep 15, 2009 7:25 pm

Post by hgrueber »

I found the answer to my problem.

PIA 2.5 causes these errors when installed with 0.8.7e + official patches.

Argh I regret installing PIA 2.5 now. :x

http://forums.cacti.net/viewtopic.php?p=172375

http://cactiusers.org/forums/topic2135.html

So basically I either wait for a new version of PIA 2.5 or uninstall PIA 2.5. Is there a way to uninstall 2.5 or do I have to reinstall Cacti from scratch? :cry:
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

Reinstalling the original cacti 0.8.7e FILES + official patches will work fine.
hgrueber
Posts: 4
Joined: Tue Sep 15, 2009 7:25 pm

Post by hgrueber »

Yeah cheers BSOD. :wink:

I ended up reinstalling 0.8.7e, installing PIA 2.5 + weathermap and then I applied the official 0.8.7e patches.

All good now. :D
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

There is an updated PIA 2.5 at the top of this forum which should fix the issues.
Post Reply

Who is online

Users browsing this forum: tylorjefcoat and 4 guests