snmp_function() error

Post support questions that relate to the Windows 2003/2000/XP operating systems.

Moderators: Developers, Moderators

Post Reply
namvi

snmp_function() error

Post by namvi »

Hello, I have installed Apache2/cacti8.3/rrdtool1.0.40/mysql3.23.56.
everything install correctly. I can log in the cacti web interface.
I added a host. It works !
but when I want to create a graph I always get the following error !
can anyone tell me what happen please ? Thanks

"Warning: implode() [function.implode]: Bad arguments. in C:\Apache2\htdocs\cacti\include\snmp_functions.php on line 51

Warning: implode() [function.implode]: Bad arguments. in C:\Apache2\htdocs\cacti\include\snmp_functions.php on line 51

Warning: implode() [function.implode]: Bad arguments. in C:\Apache2\htdocs\cacti\include\snmp_functions.php on line 51

Warning: Cannot modify header information - headers already sent by (output started at C:\Apache2\htdocs\cacti\include\snmp_functions.php:51) in C:\Apache2\htdocs\cacti\host.php on line 174"
raX
Lead Developer
Posts: 2243
Joined: Sat Oct 13, 2001 7:00 pm
Location: Carlisle, PA
Contact:

Post by raX »

This is probably caused by Cacti not being able to find your data query XML files. Make sure your "cacti Web Root" and "Web Server Document Root" settings form a valid path when concatinated together. Make sure neither of the paths contain a trailing slash. Lastly, make sure you have files in your 'resource/snmp_queries' directory.

-Ian
BChirhart
Posts: 29
Joined: Fri Jun 20, 2003 6:24 am

Post by BChirhart »

I am having the same problem. I checked the path and it seems fine:
Cacti Web Root - /cacti
Web Server Doc Root - C:/Progra~1/Apache~1/Apache2/htdocs
This is for Apache 2.0 of course.

I have the following files in my Resource/snmp_queries directory:
09/22/2003 04:31p <DIR> .
09/22/2003 04:31p <DIR> ..
08/30/2003 01:13a 1,330 host_disk.xml
08/30/2003 01:13a 3,911 interface.xml
08/30/2003 01:13a 3,049 kbridge.xml
08/30/2003 01:13a 1,379 net-snmp_disk.xml
08/30/2003 01:13a 1,577 netware_cpu.xml
08/30/2003 01:13a 1,944 netware_disk.xml
6 File(s) 13,190 bytes
2 Dir(s) 16,882,323,456 bytes free
Any other avenues I can go down to troubleshoot this? Cacti is no longer collecting stats - and that's bad!!!! :)
raX
Lead Developer
Posts: 2243
Joined: Sat Oct 13, 2001 7:00 pm
Location: Carlisle, PA
Contact:

Post by raX »

Let's try to debug this. Replace your 'include/snmp_functions.php' with the following:

http://www.raxnet.net/downloads/patches ... ns.php.txt

Along with the error you should see a "GOING TO PARSE:" and hopefully a path after that.

Let me know what you see.

-Ian
BChirhart
Posts: 29
Joined: Fri Jun 20, 2003 6:24 am

Post by BChirhart »

Ian - Here is the response
Warning: implode() [function.implode]: Bad arguments. in C:\Program Files\Apache Group\Apache2\htdocs\cacti\include\snmp_functions.php on line 52
GOING TO PARSE:


No path though???
raX
Lead Developer
Posts: 2243
Joined: Sat Oct 13, 2001 7:00 pm
Location: Carlisle, PA
Contact:

Post by raX »

We'll get this narrowed down... Try this one:

http://www.raxnet.net/downloads/patches ... ns.php.txt

-Ian
BChirhart
Posts: 29
Joined: Fri Jun 20, 2003 6:24 am

Post by BChirhart »

Here is the first several lines that I get:
SQL: 'select xml_path from snmp_query where id=', RETURNS:
WEBROOT: C:/Progra~1/Apache~1/Apache2/htdocs, WEBCACTI: /cacti

Warning: implode() [function.implode]: Bad arguments. in C:\Program Files\Apache Group\Apache2\htdocs\cacti\include\snmp_functions.php on line 53
SQL: 'select xml_path from snmp_query where id=', RETURNS:
WEBROOT: C:/Progra~1/Apache~1/Apache2/htdocs, WEBCACTI: /cacti
CharlieZ
Posts: 3
Joined: Fri Jul 18, 2003 3:34 pm

Post by CharlieZ »

I've duplicated the symptoms and was wondering if any progress has been made.

Originially installed:
Apache-2.0.47\rrdtool-1.0.40\php-4.3.1\mysql-3.23.58\cacti-0.8.3a

Currently running:
IIS5\rrdtool-1.0.40\php-4.3.1\mysql-3.23.58\cacti-0.8.3a
raX
Lead Developer
Posts: 2243
Joined: Sat Oct 13, 2001 7:00 pm
Location: Carlisle, PA
Contact:

Post by raX »

From the debug output above, it is fairly clear what is causing the problem. The problem is that the offending function is called by another function, which is called by yet another function on multiple pages. To ease debugging for me, can someone walk me through the Cacti UI to produce the error? Telling me the exact click that causes the error to appear would be very useful.

Thanks for all of the help debugging this!

Edit: I just ran across a post that might be applicable here.

-Ian
CharlieZ
Posts: 3
Joined: Fri Jul 18, 2003 3:34 pm

Post by CharlieZ »

I hope this helps. I also looked at the other post and made the change to php.ini, but my graphs still lock up my session. I may have more than one problem.

login
polling hosts
add
fill out information
create

SQL: 'select xml_path from snmp_query where id=1', RETURNS: /resource/snmp_queries/interface.xml
WEBROOT: c:/inetpub/wwwroot, WEBCACTI: /cacti

Warning: Cannot modify header information - headers already sent by (output started at c:\inetpub\wwwroot\cacti\include\snmp_functions.php:45) in c:\inetpub\wwwroot\cacti\host.php on line 165

back
polling host
select host
select interface
save
(save successful)
create

SQL: 'select xml_path from snmp_query where id=1', RETURNS: /resource/snmp_queries/interface.xml
WEBROOT: c:/inetpub/wwwroot, WEBCACTI: /cacti
SQL: 'select xml_path from snmp_query where id=1', RETURNS: /resource/snmp_queries/interface.xml
WEBROOT: c:/inetpub/wwwroot, WEBCACTI: /cacti

Warning: Cannot modify header information - headers already sent by (output started at c:\inetpub\wwwroot\cacti\include\snmp_functions.php:45) in c:\inetpub\wwwroot\cacti\host.php on line 174

back "Warning: Page has Expired"
back
select graph management
select graph
turn on graph debug mode
wait...
Graph Items displayed
Graph Item Inputs displayed
Graph Debug RED X

Polling hosts
wait...
page cannot be displayed
close browser

new browser
login
polling hosts
localhost
using dropdown box - create Host MIB - Available Disk Space
save (save successful)
create

SQL: 'select xml_path from snmp_query where id=', RETURNS:
WEBROOT: c:/inetpub/wwwroot, WEBCACTI: /cacti

Warning: implode() [function.implode]: Bad arguments. in c:\inetpub\wwwroot\cacti\include\snmp_functions.php on line 53

Warning: Cannot modify header information - headers already sent by (output started at c:\inetpub\wwwroot\cacti\include\snmp_functions.php:45) in c:\inetpub\wwwroot\cacti\host.php on line 174



EDIT:

login
utilities
view poller cache
clear poller cache

SQL: 'select xml_path from snmp_query where id=1', RETURNS: /resource/snmp_queries/interface.xml
WEBROOT: c:/inetpub/wwwroot, WEBCACTI: /cacti
SQL: 'select xml_path from snmp_query where id=1', RETURNS: /resource/snmp_queries/interface.xml
WEBROOT: c:/inetpub/wwwroot, WEBCACTI: /cacti
SQL: 'select xml_path from snmp_query where id=1', RETURNS: /resource/snmp_queries/interface.xml
WEBROOT: c:/inetpub/wwwroot, WEBCACTI: /cacti
SQL: 'select xml_path from snmp_query where id=', RETURNS:
WEBROOT: c:/inetpub/wwwroot, WEBCACTI: /cacti

Warning: implode() [function.implode]: Bad arguments. in c:\inetpub\wwwroot\cacti\include\snmp_functions.php on line 53
BChirhart
Posts: 29
Joined: Fri Jun 20, 2003 6:24 am

Post by BChirhart »

YES - that is the same process that I go through and get the same error messages.
lucky
Cacti User
Posts: 62
Joined: Mon Sep 30, 2002 3:23 am
Location: Germany

Post by lucky »

hi,

i have the same problem. when i am going to create a new graph i am getting the following errors:

Code: Select all

Warning: file("") - No error in C:\Inetpub\wwwroot\cacti\include\snmp_functions.php on line 51

Warning: Bad arguments to implode() in C:\Inetpub\wwwroot\cacti\include\snmp_functions.php on line 51

Warning: file("") - No error in C:\Inetpub\wwwroot\cacti\include\snmp_functions.php on line 51

Warning: Bad arguments to implode() in C:\Inetpub\wwwroot\cacti\include\snmp_functions.php on line 51

Warning: Cannot add header information - headers already sent by (output started at C:\Inetpub\wwwroot\cacti\include\snmp_functions.php:51) in C:\Inetpub\wwwroot\cacti\host.php on line 174
can somebody help??

my configuration: w2k / IIS5 / PHP 4.2.2 / cacti 0.83a

tanks for help
youphoric

Warning: implode() [function.implode]: Bad arguments

Post by youphoric »

is there a solution to this issue yet? using the debug snmp_functions.php, when I try to add an Interface data source, i get the following error:

SQL: 'select xml_path from snmp_query where id=', RETURNS:
WEBROOT: c:/apache/htdocs, WEBCACTI: /cacti

Warning: implode() [function.implode]: Bad arguments. in c:\apache\htdocs\cacti\include\snmp_functions.php on line 53
SQL: 'select xml_path from snmp_query where id=', RETURNS:
WEBROOT: c:/apache/htdocs, WEBCACTI: /cacti

Warning: implode() [function.implode]: Bad arguments. in c:\apache\htdocs\cacti\include\snmp_functions.php on line 53

Warning: Cannot modify header information - headers already sent by (output started at c:\apache\htdocs\cacti\include\snmp_functions.php:45) in c:\apache\htdocs\cacti\data_sources.php on line 255
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests