cmd.php errors

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

Moderators: Developers, Moderators

Post Reply
Notromda

cmd.php errors

Post by Notromda »

when I run the command: php cmd.php I get lots of errors:

ping: bad number of packets to transmit.
mysqladmin: connect to server at '-u' failed
error: 'Unknown MySQL Server Host '-u' (2)'
Check that mysqld is running on -u and that the port is 3306.
You can check this by doing 'telnet -u 3306'
Unknown parameter encountered: "ssl ca certfile"
Ignoring unknown parameter "ssl ca certfile"

When I run it under sh instead of bash, as cron does, I get:

sh: -c: line 1: unexpected EOF while looking for matching `''
sh: -c: line 2: syntax error: unexpected end of file
sh: -c: line 1: syntax error near unexpected token `>>'
sh: -c: line 1: `echo '10/01/2002 8:25 PM - CMD: update --template N' >> '
ping: bad number of packets to transmit.
sh: -c: line 1: unexpected EOF while looking for matching `''
sh: -c: line 2: syntax error: unexpected end of file
sh: -c: line 1: syntax error near unexpected token `>>'
sh: -c: line 1: `echo '10/01/2002 8:25 PM - CMD: update --template N' >> '
mysqladmin: connect to server at '-u' failed
error: 'Unknown MySQL Server Host '-u' (2)'
Check that mysqld is running on -u and that the port is 3306.
You can check this by doing 'telnet -u 3306'
sh: -c: line 1: unexpected EOF while looking for matching `''
sh: -c: line 2: syntax error: unexpected end of file
sh: -c: line 1: syntax error near unexpected token `>>'
sh: -c: line 1: `echo '10/01/2002 8:25 PM - CMD: update --template N' >> '
Unknown parameter encountered: "ssl ca certfile"
Ignoring unknown parameter "ssl ca certfile"
sh: -c: line 1: unexpected EOF while looking for matching `''
sh: -c: line 2: syntax error: unexpected end of file
sh: -c: line 1: syntax error near unexpected token `>>'
sh: -c: line 1: `echo '10/01/2002 8:25 PM - CMD: update --template N' >> '
sh: -c: line 1: unexpected EOF while looking for matching `''
sh: -c: line 2: syntax error: unexpected end of file
sh: -c: line 1: syntax error near unexpected token `>>'
sh: -c: line 1: `echo '10/01/2002 8:25 PM - CMD: update --template N' >> '
sh: -c: line 1: unexpected EOF while looking for matching `''
sh: -c: line 2: syntax error: unexpected end of file
sh: -c: line 1: syntax error near unexpected token `>>'
sh: -c: line 1: `echo '10/01/2002 8:25 PM - CMD: update --template N' >> '
sh: -c: line 1: unexpected EOF while looking for matching `''
sh: -c: line 2: syntax error: unexpected end of file
sh: -c: line 1: syntax error near unexpected token `>>'
sh: -c: line 1: `echo '10/01/2002 8:25 PM - CMD: update --template N' >> '
sh: -c: line 1: unexpected EOF while looking for matching `''
sh: -c: line 2: syntax error: unexpected end of file
sh: -c: line 1: syntax error near unexpected token `>>'
sh: -c: line 1: `echo '10/01/2002 8:25 PM - CMD: update --template N' >> '
sh: -c: line 1: unexpected EOF while looking for matching `''
sh: -c: line 2: syntax error: unexpected end of file
sh: -c: line 1: syntax error near unexpected token `>>'
sh: -c: line 1: `echo '10/01/2002 8:25 PM - CMD: update --template N' >> '
sh: -c: line 1: unexpected EOF while looking for matching `''
sh: -c: line 2: syntax error: unexpected end of file
sh: -c: line 1: syntax error near unexpected token `>>'
sh: -c: line 1: `echo '10/01/2002 8:25 PM - CMD: update --template N' >> '
sh: -c: line 1: unexpected EOF while looking for matching `''
sh: -c: line 2: syntax error: unexpected end of file
sh: -c: line 1: syntax error near unexpected token `>>'
sh: -c: line 1: `echo '10/01/2002 8:25 PM - CMD: update --template N' >> '
sh: -c: line 1: unexpected EOF while looking for matching `''
sh: -c: line 2: syntax error: unexpected end of file
sh: -c: line 1: syntax error near unexpected token `>>'
sh: -c: line 1: `echo '10/01/2002 8:25 PM - CMD: update --template N' >> '
sh: -c: line 1: unexpected EOF while looking for matching `''
sh: -c: line 2: syntax error: unexpected end of file
sh: -c: line 1: syntax error near unexpected token `>>'
sh: -c: line 1: `echo '10/01/2002 8:25 PM - CMD: update --template N' >> '
Notromda

partial fix

Post by Notromda »

I had to add a "cd /path/to/cacti/installation; " before the php command in the crontab entry. It seems that runing cmd.php only works when your working directory is set properly.

It still doesn't seem to run this command correctly:
/usr/local/bin/php -q /usr/local/src/cacti-0.6.8a//scripts/sql.php

I can run it by hand just fine, but the cron job doesn't call it right. When run by cron, it yields:

mysqladmin: connect to server at '-u' failed
error: 'Unknown MySQL Server Host '-u' (2)'
Check that mysqld is running on -u and that the port is 3306.
You can check this by doing 'telnet -u 3306'
Notromda

Another fix

Post by Notromda »

Ok, the other two fixes are: change ping command to use ping-new.pl instead of ping.pl and hardcode the full path to the include statement in the sql.php script.
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests