cmd.php errors

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

Moderators: Developers, Moderators

Post Reply
User avatar
eddy
Posts: 32
Joined: Wed Apr 03, 2002 8:48 am
Location: Mississauga, Ontario

cmd.php errors

Post by eddy »

I have installed cacti on a win2k /apache server. I have succesfully created rrd files but there is no data being collected. when I run cmd.php manually I get these error messages:

C:\Apache\htdocs\cacti>php cmd.php
Cannot find module (IP-MIB): At line 0 in (none)
Cannot find module (IF-MIB): At line 0 in (none)
Cannot find module (TCP-MIB): At line 0 in (none)
Cannot find module (UDP-MIB): At line 0 in (none)
Cannot find module (SNMPv2-MIB): At line 0 in (none)
Cannot find module (SNMPv2-SMI): At line 0 in (none)
X-Powered-By: PHP/4.1.2
Content-type: text/html

<br>
<b>Warning</b>: Unable to jump to row 0 on MySQL result index 9 in <b>C:\Apache
\htdocs\cacti\cmd.php</b> on line <b>147</b><br>
<br>
<b>Warning</b>: Supplied argument is not a valid MySQL result resource in <b>C:
\Apache\htdocs\cacti\cmd.php</b> on line <b>150</b><br>
<br>
<b>Warning</b>: Unable to jump to row 0 on MySQL result index 9 in <b>C:\Apache
\htdocs\cacti\cmd.php</b> on line <b>157</b><br>
<br>
<b>Warning</b>: Unable to jump to row 0 on MySQL result index 21 in <b>C:\Apach
e\htdocs\cacti\cmd.php</b> on line <b>147</b><br>
<br>
<b>Warning</b>: Supplied argument is not a valid MySQL result resource in <b>C:
\Apache\htdocs\cacti\cmd.php</b> on line <b>150</b><br>
<br>
<b>Warning</b>: Unable to jump to row 0 on MySQL result index 21 in <b>C:\Apach
e\htdocs\cacti\cmd.php</b> on line <b>157</b><br>
ERROR: Not enough arguments
<br>
<b>Warning</b>: Unable to jump to row 0 on MySQL result index 33 in <b>C:\Apach
e\htdocs\cacti\cmd.php</b> on line <b>147</b><br>
<br>
<b>Warning</b>: Supplied argument is not a valid MySQL result resource in <b>C:
\Apache\htdocs\cacti\cmd.php</b> on line <b>150</b><br>
<br>
<b>Warning</b>: Unable to jump to row 0 on MySQL result index 33 in <b>C:\Apach
e\htdocs\cacti\cmd.php</b> on line <b>157</b><br>
ERROR: Not enough arguments
<br>
<b>Warning</b>: Unable to jump to row 0 on MySQL result index 45 in <b>C:\Apach
e\htdocs\cacti\cmd.php</b> on line <b>147</b><br>
<br>
<b>Warning</b>: Supplied argument is not a valid MySQL result resource in <b>C:
\Apache\htdocs\cacti\cmd.php</b> on line <b>150</b><br>
<br>
<b>Warning</b>: Unable to jump to row 0 on MySQL result index 45 in <b>C:\Apach
e\htdocs\cacti\cmd.php</b> on line <b>157</b><br>
<br>
<b>Warning</b>: Unable to jump to row 0 on MySQL result index 57 in <b>C:\Apach
e\htdocs\cacti\cmd.php</b> on line <b>147</b><br>
<br>
<b>Warning</b>: Supplied argument is not a valid MySQL result resource in <b>C:
\Apache\htdocs\cacti\cmd.php</b> on line <b>150</b><br>
<br>
<b>Warning</b>: Unable to jump to row 0 on MySQL result index 57 in <b>C:\Apach
e\htdocs\cacti\cmd.php</b> on line <b>157</b><br>
<br>
<b>Warning</b>: Unable to jump to row 0 on MySQL result index 69 in <b>C:\Apach
e\htdocs\cacti\cmd.php</b> on line <b>147</b><br>
<br>
<b>Warning</b>: Supplied argument is not a valid MySQL result resource in <b>C:
\Apache\htdocs\cacti\cmd.php</b> on line <b>150</b><br>
<br>
<b>Warning</b>: Unable to jump to row 0 on MySQL result index 69 in <b>C:\Apach
e\htdocs\cacti\cmd.php</b> on line <b>157</b><br>
ERROR: Not enough arguments
<br>
<b>Warning</b>: Unable to jump to row 0 on MySQL result index 81 in <b>C:\Apach
e\htdocs\cacti\cmd.php</b> on line <b>147</b><br>
<br>
<b>Warning</b>: Supplied argument is not a valid MySQL result resource in <b>C:
\Apache\htdocs\cacti\cmd.php</b> on line <b>150</b><br>
<br>
<b>Warning</b>: Unable to jump to row 0 on MySQL result index 81 in <b>C:\Apach
e\htdocs\cacti\cmd.php</b> on line <b>157</b><br>
ERROR: Not enough arguments
<br>
<b>Warning</b>: Unable to jump to row 0 on MySQL result index 93 in <b>C:\Apach
e\htdocs\cacti\cmd.php</b> on line <b>147</b><br>
<br>
<b>Warning</b>: Supplied argument is not a valid MySQL result resource in <b>C:
\Apache\htdocs\cacti\cmd.php</b> on line <b>150</b><br>
<br>
<b>Warning</b>: Unable to jump to row 0 on MySQL result index 93 in <b>C:\Apach
e\htdocs\cacti\cmd.php</b> on line <b>157</b><br>
ERROR: Not enough arguments

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

Post by raX »

There is some definate breaking of SQL going on there :o Download the following patch so we can narrow it down further:

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

Replace your current 'cmd.php' with the downloaded copy and run 'php cmd.php' from the command line. You should get some additonal useful output. You can either paste that here or e-mail it to me. Hopefully we can track down the cause...

-Ian
Guest

Post by Guest »

The first part of the errors have to do with your PHP.INI file. Make sure it has something like this (your config might vary):

extension_dir="C:\php\extensions\"
User avatar
eddy
Posts: 32
Joined: Wed Apr 03, 2002 8:48 am
Location: Mississauga, Ontario

Post by eddy »

sorry to take so long to get back to you on this my "real" job got in the way.

When i run php cmd.php now i get these errors:

C:\Apache\htdocs\cacti>php cmd.php
Cannot find module (IP-MIB): At line 0 in (none)
Cannot find module (IF-MIB): At line 0 in (none)
Cannot find module (TCP-MIB): At line 0 in (none)
Cannot find module (UDP-MIB): At line 0 in (none)
Cannot find module (SNMPv2-MIB): At line 0 in (none)
Cannot find module (SNMPv2-SMI): At line 0 in (none)
X-Powered-By: PHP/4.1.2
Content-type: text\html


select
id
from src_fields
where dataname="octets"
and srcid=11
and inputoutput="out"
<br>
<b>Warning</b>: Unable to jump to row 0 on MySQL result index 9 in <b>C:\Apache
\htdocs\cacti\cmd.php</b> on line <b>153</b><br>
<br>
<b>Warning</b>: Supplied argument is not a valid MySQL result resource in <b>C:
\Apache\htdocs\cacti\cmd.php</b> on line <b>156</b><br>
<br>
<b>Warning</b>: Unable to jump to row 0 on MySQL result index 9 in <b>C:\Apache
\htdocs\cacti\cmd.php</b> on line <b>163</b><br>
ERROR: Not enough arguments

select
id
from src_fields
where dataname="octets"
and srcid=11
and inputoutput="out"
<br>
<b>Warning</b>: Unable to jump to row 0 on MySQL result index 21 in <b>C:\Apach
e\htdocs\cacti\cmd.php</b> on line <b>153</b><br>
<br>
<b>Warning</b>: Supplied argument is not a valid MySQL result resource in <b>C:
\Apache\htdocs\cacti\cmd.php</b> on line <b>156</b><br>
<br>
<b>Warning</b>: Unable to jump to row 0 on MySQL result index 21 in <b>C:\Apach
e\htdocs\cacti\cmd.php</b> on line <b>163</b><br>
ERROR: Not enough arguments

eddy
Guest

Post by Guest »

Did you copy the mibs directory in C:\php to C:\usr\mibs ?
User avatar
eddy
Posts: 32
Joined: Wed Apr 03, 2002 8:48 am
Location: Mississauga, Ontario

Post by eddy »

i created a \usr\mibs directory and copied the mibs into it. the has eliminated the can't find mib-module errors.
User avatar
eddy
Posts: 32
Joined: Wed Apr 03, 2002 8:48 am
Location: Mississauga, Ontario

Post by eddy »

I have applied the patch and created the mib directory. Thanks.
However i have used get snmp network to create serveral data sources and to create the graphs. and that "seem" to work just as expected but the rrd files are never updated and cron output shows all blanks. I ran cmd.php from a command prompt and this was the output along with the results of running rrdtool manually as well.

C:\Apache\htdocs\cacti>php cmd.php
X-Powered-By: PHP/4.2.0
Content-type: text/html


select
id
from src_fields
where dataname="octets"
and srcid=11
and inputoutput="out"

select
id
from src_fields
where dataname="octets"
and srcid=11
and inputoutput="out"

select
id
from src_fields
where dataname="octets"
and srcid=11
and inputoutput="out"

select
id
from src_fields
where dataname="octets"
and srcid=11
and inputoutput="out"

select
id
from src_fields
where dataname="octets"
and srcid=11
and inputoutput="out"

select
id
from src_fields
where dataname="octets"
and srcid=11
and inputoutput="out"

C:\Apache\htdocs\cacti>cd\

C:\>c:/rrdtool/rrdtool.exe update c:/apache/htdocs/cacti/rra/traf_10_249_2_11_2_
in.rrd --template traf_10_249_2_11_2_ N:270622681

Thanks for all the help.
raX
Lead Developer
Posts: 2243
Joined: Sat Oct 13, 2001 7:00 pm
Location: Carlisle, PA
Contact:

Post by raX »

The output of the patch really does not say much...except that you are using the "Get SNMP Network Data" script. By the looks of your 'update' command, I can see that SNMP does appear to be working ok. I also noticed that you did not receive any output when executing the 'update' command. This is also good.

At this point, you want to make sure that 'php cmd.php' is scheduled to run every 5 minutes properly and that the user it runs as has write access to 'rra/' directory. Does your log file get updated as well?

-Ian
User avatar
eddy
Posts: 32
Joined: Wed Apr 03, 2002 8:48 am
Location: Mississauga, Ontario

Post by eddy »

I found the problem. once I had created the \user\mib directory and applied the patch i found that i had to install ucd-snmp and update cacti setup accordingly. also there was an error in the setup of my scheduled task. Now everything is great!! Thanks very much. :P
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests