Spine problems with PHP script

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

Moderators: Developers, Moderators

Post Reply
ascendo
Posts: 21
Joined: Wed Dec 05, 2007 12:25 pm

Spine problems with PHP script

Post by ascendo »

Hi everyone

I've picked up a problem when using Spine and a PHP script to pull data from a Cisco ACE load balancer.

When I use Spine, the output is always 'U':

06/21/2009 08:59:05 PM - SPINE: Poller[0] Host[48] DS[995] SCRIPT: c:\php\php-win.exe -q C:\cacti\scripts\ss_ace_vserver.php a.b.c.8 48 2:161:999:blanked:::MD5::[None] get NumberOfC 1.51, output: U

However, when I run CMD.PHP, it works fine:

06/21/2009 08:56:08 PM - CMDPHP: Poller[0] Host[48] DS[995] CMD: c:\php\php-win.exe -q C:\cacti\scripts\ss_ace_vserver.php a.b.c.8 48 2:161:999:blanked:::MD5::[None] get NumberOfC 1.51, output: 66

If I run the script from the command line it works fine too. I'm running the latest Spine (from announcements forum), Cacti 0.8.7d, Windows 2003 32 bit, IIS6, PHP 5.2.5.

All other data sources are polling fine with Spine, it's just this one which does not work.

Any ideas?

Thanks

Ascendo
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

As of PHP 5, a new php-win.exe file is distributed. This is equal to the CLI version, except that php-win doesn't output anything and thus provides no console (no "dos box" appears on the screen). This behavior is similar to php-gtk. You should configure with --enable-cli-win32.
Give php.exe a try instead.
ascendo
Posts: 21
Joined: Wed Dec 05, 2007 12:25 pm

Post by ascendo »

I tried copying php.exe over php-win.exe, and I still get 'U' output. When I run from the command line now, I get this:

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)
Cannot find module (UCD-SNMP-MIB): At line 0 in (none)
Cannot find module (UCD-DEMO-MIB): At line 0 in (none)
Cannot find module (SNMP-TARGET-MIB): At line 0 in (none)
Cannot find module (SNMP-VIEW-BASED-ACM-MIB): At line 0 in (none)
Cannot find module (SNMP-COMMUNITY-MIB): At line 0 in (none)
Cannot find module (UCD-DLMOD-MIB): At line 0 in (none)
Cannot find module (SNMP-FRAMEWORK-MIB): At line 0 in (none)
Cannot find module (SNMP-MPD-MIB): At line 0 in (none)
Cannot find module (SNMP-USER-BASED-SM-MIB): At line 0 in (none)
Cannot find module (SNMP-NOTIFICATION-MIB): At line 0 in (none)
Cannot find module (SNMPv2-TM): At line 0 in (none)
7


So the output is displayed at the end, but all the errors I think are causing a problem - any way around this?
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

Why'd you copy it over? Just run php.exe instead of php-win.exe.

As for those MIB errors... they're because your MIBDIR environment variable is wrong/missing/missing MIB files. Read my FAQ/installation guide on how to fix.
ascendo
Posts: 21
Joined: Wed Dec 05, 2007 12:25 pm

Post by ascendo »

I've fixed the MIB error, but still no go.

I also changed the PHP path to c:\php\php.exe (from php-win.exe) without any luck.

Anything else I can try? Thanks for the assistance BSOD2600, really appreciate it.
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

ascendo wrote:I've fixed the MIB error, but still no go.
Cacti uses ANS.1 numbers and not MIB files, so that won't change anything.
ascendo wrote:I also changed the PHP path to c:\php\php.exe (from php-win.exe) without any luck.
Did you restore the original/real php.exe and php-win.exe first? They ARE different files.
ascendo wrote:Anything else I can try? Thanks for the assistance BSOD2600, really appreciate it.
Wait a minute... if you're trying to run a PHP Script server script, you shouldn't need to specify php at all. The Data Input Method Input String should only have the path to the script and parameters. i.e. <path_cacti>/scripts/ss_speedfan_fan.php ss_speedfan_fan <hostname> <snmp_community> <snmp_version> <snmp_port> <snmp_timeout> <snmpv3_auth_username> <snmpv3_auth_password>
ascendo
Posts: 21
Joined: Wed Dec 05, 2007 12:25 pm

Post by ascendo »

Hi BSOD2600

I did restore the php executables.

The data source uses PHP to collect its data - the template I imported containts this line:

<script_path>|path_php_binary| -q |path_cacti|/scripts/ss_ace_vserver.php</script_path>

The script and template are from here: http://forums.cacti.net/about29195.html.

Thanks

Ascendo
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests