poller.php and cmd.php errors

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

Moderators: Developers, Moderators

Post Reply
SteveV
Posts: 5
Joined: Sun Oct 23, 2005 11:16 am

poller.php and cmd.php errors

Post by SteveV »

I get:
C:\www\cacti>c:\php\php.exe poller.php
Content-type: text/html
X-Powered-By: PHP/4.4.0

<br><strong>This script is only meant to run at the command line.</strong>

I've tried several versions of PHP to ensure it wasn't a bug or incompatability, no luck.
Current environment:
Windows XP Pro SP2 with current patches (errr, hotfixes).
Cacti 0.8.6g
Cactid 0.8.6f
PHP 4.0.0 (tried 5, tried 4.4, 4.3.11, tried 4.1...)
rrdtool cygwin 1.2.11
net-snmp 5.2.2
Apache 2.0

After tooling around with various environmental variables, paths, etc I am still hitting a wall.
When I remmed the checks for browser calls the scripts NEARLY properly run...

10/23/2005 07:10:34 PM - POLLER: Poller[0] DEBUG: About to Spawn a Remote Process [CMD: c:/php/php.exe, ARGS: -q C:/www/cacti/poller_export.php]
10/23/2005 07:10:34 PM - POLLER: Poller[0] DEBUG: About to Spawn a Remote Process [CMD: c:/php/php.exe, ARGS: -q C:/www/cacti/poller_commands.php]
10/23/2005 07:10:34 PM - SYSTEM STATS: Time:1.1432 Method:cmd.php Processes:1 Threads:N/A Hosts:4 HostsPerProcess:4 DataSources:11 RRDsProcessed:0
10/23/2005 07:10:34 PM - CMDPHP: Poller[0] ERROR: Either there are no items in the cache or polling is disabled
10/23/2005 07:10:34 PM - CMDPHP: Poller[0] ERROR: Invalid Number of Arguments. You must specify 0 or 2 arguments.
10/23/2005 07:10:33 PM - POLLER: Poller[0] DEBUG: About to Spawn a Remote Process [CMD: c:/php/php.exe, ARGS: -q c:/www/cacti/cmd.php 0 8]

No rrd files, no graphs.

With cactid:

10/23/2005 07:11:31 PM - POLLER: Poller[0] DEBUG: About to Spawn a Remote Process [CMD: c:/php/php.exe, ARGS: -q C:/www/cacti/poller_export.php]
10/23/2005 07:11:30 PM - POLLER: Poller[0] DEBUG: About to Spawn a Remote Process [CMD: c:/php/php.exe, ARGS: -q C:/www/cacti/poller_commands.php]
10/23/2005 07:11:30 PM - SYSTEM STATS: Time:8.1663 Method:cactid Processes:1 Threads:1 Hosts:4 HostsPerProcess:4 DataSources:11 RRDsProcessed:0
10/23/2005 07:11:30 PM - CACTID: Poller[0] Time: 7.7550 s, Threads: 1, Hosts: 4
10/23/2005 07:11:30 PM - CACTID: Poller[0] DEBUG: MYSQL Free & Close Completed
10/23/2005 07:11:30 PM - CACTID: Poller[0] CACTID: Shutting down Net-SNMP API
10/23/2005 07:11:30 PM - CACTID: Poller[0] DEBUG: Allocated Variable Memory Freed
10/23/2005 07:11:30 PM - CACTID: Poller[0] DEBUG: PHP Script Server Pipes Closed
10/23/2005 07:11:30 PM - CACTID: Poller[0] DEBUG: Thread Cleanup Complete
10/23/2005 07:11:30 PM - CACTID: Poller[0] DEBUG: SQLCMD: insert into poller_time (poller_id, start_time, end_time) values (0, NOW(), NOW())
10/23/2005 07:11:30 PM - CACTID: Poller[0] DEBUG: SQLCMD: replace into settings (name,value) values ('date',NOW())
10/23/2005 07:11:30 PM - CACTID: Poller[0] DEBUG: The Value of Active Threads is 0
10/23/2005 07:11:30 PM - CACTID: Poller[0] Host[8] DEBUG: HOST COMPLETE: About to Exit Host Polling Thread Function

10/23/2005 07:11:30 PM - CACTID: Poller[0] DEBUG: SQLCMD: update host set status='1',status_event_count='7', status_fail_date='0000-00-00 00:00:00',status_rec_date='0000-00-00 00:00:00',status_last_error='Host did not respond to SNMP',min_time='9.999990',max_time='0.000000',cur_time='0.000000',avg_time='0.000000',total_polls='8',failed_polls='8',availability='0.0000' where id='8'
10/23/2005 07:11:30 PM - CACTID: Poller[0] Host[8] SNMP Result: Host did not respond to SNMP
10/23/2005 07:11:28 PM - CACTID: Poller[0] MYSQL: Connected to MySQL database 'cacti' on '127.0.0.1'...
10/23/2005 07:11:28 PM - CACTID: Poller[0] DEBUG: The Value of Active Threads is 1
10/23/2005 07:11:28 PM - CACTID: Poller[0] MYSQL: Connecting to MySQL database 'cacti' on '127.0.0.1'...
10/23/2005 07:11:28 PM - CACTID: Poller[0] DEBUG: Valid Thread to be Created
10/23/2005 07:11:28 PM - CACTID: Poller[0] DEBUG: In Poller, About to Start Polling of Host
10/23/2005 07:11:28 PM - CACTID: Poller[0] DEBUG: The Value of Active Threads is 0
10/23/2005 07:11:28 PM - CACTID: Poller[0] Host[4] DEBUG: HOST COMPLETE: About to Exit Host Polling Thread Function

10/23/2005 07:11:28 PM - CACTID: Poller[0] DEBUG: SQLCMD: update host set status='1',status_event_count='7', status_fail_date='0000-00-00 00:00:00',status_rec_date='0000-00-00 00:00:00',status_last_error='Host did not respond to SNMP',min_time='9.999990',max_time='0.000000',cur_time='0.000000',avg_time='0.000000',total_polls='8',failed_polls='8',availability='0.0000' where id='4'
10/23/2005 07:11:28 PM - CACTID: Poller[0] Host[4] SNMP Result: Host did not respond to SNMP
10/23/2005 07:11:26 PM - CACTID: Poller[0] MYSQL: Connected to MySQL database 'cacti' on '127.0.0.1'...
10/23/2005 07:11:26 PM - CACTID: Poller[0] DEBUG: The Value of Active Threads is 1
10/23/2005 07:11:26 PM - CACTID: Poller[0] MYSQL: Connecting to MySQL database 'cacti' on '127.0.0.1'...
10/23/2005 07:11:26 PM - CACTID: Poller[0] DEBUG: Valid Thread to be Created
10/23/2005 07:11:26 PM - CACTID: Poller[0] DEBUG: In Poller, About to Start Polling of Host
10/23/2005 07:11:26 PM - CACTID: Poller[0] DEBUG: The Value of Active Threads is 0
10/23/2005 07:11:26 PM - CACTID: Poller[0] Host[3] DEBUG: HOST COMPLETE: About to Exit Host Polling Thread Function

10/23/2005 07:11:26 PM - CACTID: Poller[0] DEBUG: SQLCMD: update host set status='1',status_event_count='8', status_fail_date='0000-00-00 00:00:00',status_rec_date='0000-00-00 00:00:00',status_last_error='Host did not respond to SNMP',min_time='9.999990',max_time='0.000000',cur_time='0.000000',avg_time='0.000000',total_polls='9',failed_polls='9',availability='0.0000' where id='3'
10/23/2005 07:11:26 PM - CACTID: Poller[0] Host[3] SNMP Result: Host did not respond to SNMP
10/23/2005 07:11:24 PM - CACTID: Poller[0] MYSQL: Connected to MySQL database 'cacti' on '127.0.0.1'...
10/23/2005 07:11:24 PM - CACTID: Poller[0] MYSQL: Connecting to MySQL database 'cacti' on '127.0.0.1'...
10/23/2005 07:11:24 PM - CACTID: Poller[0] DEBUG: The Value of Active Threads is 1
10/23/2005 07:11:24 PM - CACTID: Poller[0] DEBUG: Valid Thread to be Created
10/23/2005 07:11:24 PM - CACTID: Poller[0] DEBUG: In Poller, About to Start Polling of Host
10/23/2005 07:11:24 PM - CACTID: Poller[0] DEBUG: The Value of Active Threads is 0
10/23/2005 07:11:24 PM - CACTID: Poller[0] Host[0] DEBUG: HOST COMPLETE: About to Exit Host Polling Thread Function
10/23/2005 07:11:24 PM - CACTID: Poller[0] MYSQL: Connected to MySQL database 'cacti' on '127.0.0.1'...
10/23/2005 07:11:24 PM - CACTID: Poller[0] DEBUG: The Value of Active Threads is 1
10/23/2005 07:11:24 PM - CACTID: Poller[0] MYSQL: Connecting to MySQL database 'cacti' on '127.0.0.1'...
10/23/2005 07:11:24 PM - CACTID: Poller[0] DEBUG: Valid Thread to be Created
10/23/2005 07:11:24 PM - CACTID: Poller[0] DEBUG: In Poller, About to Start Polling of Host
10/23/2005 07:11:24 PM - CACTID: Poller[0] DEBUG: Initial Value of Active Threads is 0
10/23/2005 07:11:24 PM - CACTID: Poller[0] DEBUG: Parent pid=4152, Script Server pid=0
10/23/2005 07:11:24 PM - CACTID: Poller[0] CACTID: Initializing PHP Script Server
10/23/2005 07:11:23 PM - CACTID: Poller[0] CACTID: Initializing Net-SNMP API
10/23/2005 07:11:23 PM - CACTID: Poller[0] MYSQL: Connected to MySQL database 'cacti' on '127.0.0.1'...
10/23/2005 07:11:23 PM - CACTID: Poller[0] MYSQL: Connecting to MySQL database 'cacti' on '127.0.0.1'...
10/23/2005 07:11:23 PM - CACTID: Poller[0] CACTID: Version 0.8.6f starting
10/23/2005 07:11:23 PM - CACTID: Poller[0] DEBUG: The Maximum SNMP OID Get Size is 10
10/23/2005 07:11:23 PM - CACTID: Poller[0] DEBUG: The PHP Script Server is Not Required
10/23/2005 07:11:23 PM - CACTID: Poller[0] DEBUG: StartHost='0', EndHost='8', TotalPHPScripts='0'
10/23/2005 07:11:23 PM - CACTID: Poller[0] DEBUG: The script timeout is 25
10/23/2005 07:11:23 PM - CACTID: Poller[0] DEBUG: The number of concurrent processes is 1
10/23/2005 07:11:23 PM - CACTID: Poller[0] DEBUG: The polling interval is the system default
10/23/2005 07:11:23 PM - CACTID: Poller[0] DEBUG: The threads variable is 1
10/23/2005 07:11:23 PM - CACTID: Poller[0] DEBUG: The log_pstats variable is 1
10/23/2005 07:11:23 PM - CACTID: Poller[0] DEBUG: The log_pwarn variable is 1
10/23/2005 07:11:23 PM - CACTID: Poller[0] DEBUG: The log_perror variable is 1
10/23/2005 07:11:23 PM - CACTID: Poller[0] DEBUG: The ping_timeout variable is 400
10/23/2005 07:11:23 PM - CACTID: Poller[0] DEBUG: The ping_retries variable is 1
10/23/2005 07:11:23 PM - CACTID: Poller[0] DEBUG: The ping_method variable is 2
10/23/2005 07:11:23 PM - CACTID: Poller[0] DEBUG: The ping_failure_count variable is 2
10/23/2005 07:11:23 PM - CACTID: Poller[0] DEBUG: The ping_recovery_count variable is 3
10/23/2005 07:11:23 PM - CACTID: Poller[0] DEBUG: The availability_method variable is 2
10/23/2005 07:11:23 PM - CACTID: Poller[0] DEBUG: The path_php variable is c:/php/php.exe
10/23/2005 07:11:23 PM - CACTID: Poller[0] DEBUG: The log_destination variable is 1
10/23/2005 07:11:22 PM - POLLER: Poller[0] DEBUG: About to Spawn a Remote Process [CMD: C:/cactid/cactid.exe, ARGS: 0 8]

I expect the no response from some items, they're my next science project here... Subbing out the cheap-o-matic home routers for my Cisco ones, however I have one computer set for SNMP and a Cisco switch set as well.
I'm sure I'm missing something stupid, but my brain is running from my ears now...
Ideas?
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Cacti is not supported in php 4.0.0. Please update to at least 4.3.6.

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?
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

1) Use php 4.4.0 or 5.0.x
2) Follow my updated windows install guide
3) Start out with using the cmd.php poller, then when everything is working switch to cactid.exe.
SteveV
Posts: 5
Joined: Sun Oct 23, 2005 11:16 am

Post by SteveV »

Went back again to PHP 4.4.0.
STILL getting:
C:\www\cacti>php poller.php
Content-type: text/html
X-Powered-By: PHP/4.4.0

<br><strong>This script is only meant to run at the command line.</strong>
C:\www\cacti>edit \php\php.ini

Then, of course nothing gets stored in rra for processing nor made into a graph.

Paths have been modified, even a bit overmodified for test. Environmental vars MIBDIRS=c:\hph\mibs, PHPRC=c:\php in place.
SOMETHING is being missed that is convincing the script and PHP to think my dos window is a browser window, unfortunately I am quite non-conversant with PHP, so can not quite understand what the !isset($_SERVER["argv"][0] is testing for...
OR MickeySoft is attempting a new legal defense for the EU by making a DOS window act like a browser now... <ducking>

I'd set it up on my linux box, but the OS version is QUITE ancient (SuSE 9.0), my updated box is back in the US. I didn't bring ALL of my machines to Qatar with me... :/

Ideas? Comments, criticisms. dirty jokes?
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

After searching the forum for the error you're getting, I stumbled upon a post....by myself.

1) How closely did you read the updated install guide? which php.ini file did you initially use? Try changing PHP SafeMode to off.

2) Run the following:
c:\mysql\bin\mysql -u root -p cacti
> truncate table poller_output;
> exit
SteveV
Posts: 5
Joined: Sun Oct 23, 2005 11:16 am

Post by SteveV »

OK, used the wrong php.ini, when I went with the .dist (and added the extension lines) the problem went away for the browser check.
Did the MIBS=. and life is good with the script not bombing.
No graphs, no rrd files and no SNMP cache viewable through the web interface.
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

ok, now that the cacti poller is working.

Turn the polling level in cacti to debug (Settings | Polling level) for one cycle and paste the output of the actual log file (./cacti/log/cacti.log). If it contains WEBLOG entries, then don't bother posting since they just clutter up the log. Turn off WEBEVENTS logging and try again.
SteveV
Posts: 5
Joined: Sun Oct 23, 2005 11:16 am

Post by SteveV »

10/24/2005 07:13:53 AM - POLLER: Poller[0] DEBUG: About to Spawn a Remote Process [CMD: c:/php/php.exe, ARGS: -q C:/www/cacti/poller_export.php]
10/24/2005 07:13:53 AM - POLLER: Poller[0] DEBUG: About to Spawn a Remote Process [CMD: c:/php/php.exe, ARGS: -q C:/www/cacti/poller_commands.php]
10/24/2005 07:13:53 AM - SYSTEM STATS: Time:8.1438 Method:cmd.php Processes:1 Threads:N/A Hosts:5 HostsPerProcess:5 DataSources:11 RRDsProcessed:0
10/24/2005 07:13:53 AM - CMDPHP: Poller[0] Time: 7.1158 s, Theads: N/A, Hosts: 4
10/24/2005 07:13:53 AM - PHPSVR: Poller[0] DEBUG: PHP Script Server Shutdown request received, exiting
10/24/2005 07:13:53 AM - CMDPHP: Poller[0] Host[8] SNMP: Host did not respond to SNMP
10/24/2005 07:13:51 AM - CMDPHP: Poller[0] Host[4] SNMP: Host did not respond to SNMP
10/24/2005 07:13:49 AM - CMDPHP: Poller[0] Host[3] SNMP: Host did not respond to SNMP
10/24/2005 07:13:46 AM - CMDPHP: Poller[0] PHP Script Server Started Properly
10/24/2005 07:13:46 AM - PHPSVR: Poller[0] PHP Script Server has Started - Parent is cmd
10/24/2005 07:13:46 AM - PHPSVR: Poller[0] DEBUG: FILENM: c:\www\cacti\script_server.php
10/24/2005 07:13:46 AM - PHPSVR: Poller[0] DEBUG: DIRNAM: c:/www/cacti
10/24/2005 07:13:46 AM - PHPSVR: Poller[0] DEBUG: GETCWD: c:/www/cacti
10/24/2005 07:13:46 AM - PHPSVR: Poller[0] DEBUG: SERVER: cmd
10/24/2005 07:13:45 AM - POLLER: Poller[0] DEBUG: About to Spawn a Remote Process [CMD: c:/php/php.exe, ARGS: -q c:/www/cacti/cmd.php 0 10]
SteveV
Posts: 5
Joined: Sun Oct 23, 2005 11:16 am

Post by SteveV »

Well, now I finally at least get to see that nobody is responding to SNMP requests.
Lemme check the switch, it *SHOULD* be responding...
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests