Issue with perl script in changing from cmd.php to spine

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

Moderators: Developers, Moderators

Post Reply
jenssri
Posts: 2
Joined: Thu Jan 08, 2009 9:40 am

Issue with perl script in changing from cmd.php to spine

Post by jenssri »

Operating System: WIN2K3
Webserver: IIS
Cacti: 8.7c
Spine: 8.7a
MySQL: 5.1.11
PHP: 5.2.5
RRDTool (Cygwin or Win32 version): 1.2.15 Win32
Net-SNMP: 5.4.1-3 win32
Cygwin (cygwin1.dll version): 1.5.24
Plugin Architecture: 2.3


I have been looking through the posts trying to determine how to resolve my issue. I am in the process of moving to use spine as my poller instead of cmd.php and am having issues with one script. All others I have been able to convert. Attached please find the script and script query I am using.

If using cmd.php the following is logged under debug.

02/05/2009 03:11:21 PM - CMDPHP: Poller[0] Host[190] DS[9185] CMD: \win-ids\perl\bin\perl C:\Inetpub\wwwroot\cacti\scripts\qospol.pl hostname community 2 get QoSbitrate 1.COS2.2, output: 16000
02/05/2009 03:11:17 PM - CMDPHP: Poller[0] Host[190] DS[9184] CMD: \win-ids\perl\bin\perl C:\Inetpub\wwwroot\cacti\scripts\qospol.pl hostname community 2 get QoSdropbitrate 1.COS2.2, output: 0


If using spine we run into the issue with the following in the logs.
02/05/2009 03:50:01 PM - SPINE: Poller[0] Host[190] DS[9199] SCRIPT: \win-ids\perl\bin\perl C:\Inetpub\wwwroot\cacti\scripts\qospol.pl hostname community 2 get QoSbitrate 1.COS1.2, output: U
02/05/2009 03:50:01 PM - SPINE: Poller[0] Host[190] DS[9199] WARNING: Result from SCRIPT not valid. Partial Result: ...
02/05/2009 03:50:01 PM - SPINE: Poller[0] Host[190] ERROR: Empty result [hostname]: '\win-ids\perl\bin\perl C:\Inetpub\wwwroot\cacti\scripts\qospol.pl hostname community 2 get QoSbitrate 1.COS1.2'
02/05/2009 03:50:01 PM - SPINE: Poller[0] Host[190] DEBUG: The POPEN returned the following File Descriptor 38


If run at the command line the command and output are....
\win-ids\perl\bin\perl C:\Inetpub\wwwroot\cacti\scripts\qospol.pl hostname community 2 get QoSbitrate 1.COS1.2
164000


When using cmd.php data is returned properly by the script, and converted into RRDs, so I have not attached any screen shots of data/graph templates as these do not appear to be the problem. However upon converting to spine incorrect data appears to be returned to the script. I have verified all of my paths for executables in the files are using the full path name (including attempting to add .exe to end of file name) as recommended. Have rebuilt poller cache, and also deleted and recreated the data sources. The only thing I have not attempted to do is install spine 0.8.7c as the link for the Windows binary appears to still be source and I have not had time to compile.

Any suggestions would be greatly appreciated. Also let me know if I can provide any additonal info. Usually I have been able to resolve all my issues by reading the forums but this one is stumping me.
Thanks.
Attachments
qospol.pl
Perl script
(8.59 KiB) Downloaded 167 times
qos.xml
script query
(3.4 KiB) Downloaded 172 times
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

"\win-ids\perl\bin\perl" doesn't seem to be a valid path regardless. Anyways, with Spine, you will need to specify the FULL path to the Perl binary in the data input method template.
mcutting
Cacti Guru User
Posts: 1884
Joined: Mon Oct 16, 2006 5:57 am
Location: United Kingdom
Contact:

Post by mcutting »

Does SPINE fail to work for all perl scripts, or just this one ? Often, the scripts won't work properly unless the spine binary (exe) is placed into the same folder as cygwin\bin

Regds
Cacti Version 0.8.8b
Cacti OS Ubuntu LTS
RRDTool Version RRDTool 1.4.7
Poller Information
Type SPINE 0.8.8b
jenssri
Posts: 2
Joined: Thu Jan 08, 2009 9:40 am

Post by jenssri »

It appears that I had to take the "full path" statement one step further than I thought. /win-ids/perl/bin/perl (this is the correct path as I share the perl install with a previously installed program) changed to C:/win-ids/perl/bin/perl rebuilt the poller cache and all works well with the script under Spine. All previous posts that I had read never mentioned the drive letter so maybe this is more windows specific.
Thanks for the suggestions.
Operating System: WIN2K3
Webserver: IIS
Cacti: 8.7c
Spine: 8.7a
MySQL: 5.1.11
PHP: 5.2.5
RRDTool (Cygwin or Win32 version): 1.2.15 Win32
Net-SNMP: 5.4.1-3 win32
Cygwin (cygwin1.dll version): 1.5.24
Plugin Architecture: 2.3
mcutting
Cacti Guru User
Posts: 1884
Joined: Mon Oct 16, 2006 5:57 am
Location: United Kingdom
Contact:

Post by mcutting »

If you are running SPINE using Windows, you will always need the full path to Perl (example, C:\Perl\Bin\perl.exe)
Cacti Version 0.8.8b
Cacti OS Ubuntu LTS
RRDTool Version RRDTool 1.4.7
Poller Information
Type SPINE 0.8.8b
User avatar
TheWitness
Developer
Posts: 17061
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

I prefer Linux, rather recommend, for any real hard core installs.

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 »

Come back to the dark side. It's warm and squishy.
User avatar
TFC
Cacti Pro User
Posts: 739
Joined: Wed Apr 09, 2003 2:17 am
Location: Izmir/Turkey

Post by TFC »

I have same problem in Ubuntu even i wrote full path of perl.
When I switch to cmd.php graph created. But with spine.. not work :(
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests