cactid poller error using perl script

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

Moderators: Developers, Moderators

User avatar
magoo95
Posts: 18
Joined: Tue Nov 15, 2005 9:39 am
Location: Paris, FRANCE

Post by magoo95 »

Hi,

You neither sleep ?

I normally work with "distribution" packages but i can try to use this new one from source.
Is it already somewhere ?

Pascal
User avatar
TheWitness
Developer
Posts: 17062
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

I will make one. Give me a few. I will post.

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
TheWitness
Developer
Posts: 17062
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Here it is.

TheWitness
Attachments
Cactid086g-pre-beta-win32.zip
(550.62 KiB) Downloaded 236 times
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
magoo95
Posts: 18
Joined: Tue Nov 15, 2005 9:39 am
Location: Paris, FRANCE

Post by magoo95 »

Sorry for the delay but i'm currently downloading again cygwin as your new cactid.exe vesrion request the cygcrypto-0.8.9.dll that i haven't on my disk.
The result of the test in 10 minutes.

In all cases, i appreciate your help.

Pascal
User avatar
magoo95
Posts: 18
Joined: Tue Nov 15, 2005 9:39 am
Location: Paris, FRANCE

Post by magoo95 »

Master Witness,

!!!!!!!!! CHAMPAGNE !!!!!!!

With your package, i have been able to run my first perl script:
1°) without errors
2°) with a correct result

Just for your information (in case of)

i added the following dlls to the cactid folder in order to be able to use it as they seems to be mandatory now:
cygcrypto-0.9.8.dll
cygz.dll

Launching manually cactid under a cmd window, the following error occurs :
C:/netsnmp/etc/snmp/snmp.conf: line 1: Warning: Unknown token: mibdirs.

i will have a look later.

Thanks for your help and long life to cactid

Pascal
jagbarcelo
Posts: 23
Joined: Mon Nov 21, 2005 4:28 am
Location: Spain

Post by jagbarcelo »

TheWitness:

I had the same problem too. I suppose it wil be fixed using your latest Cactid086g-pre-beta-win32.zip but I'm at home now and I have no way to give it a try. In the meantime, can you re-release the file including the needed DLLs so that people (or maybe just me?) don't need to download and install full cygwin just for the need of those 2 files:
  • cygcrypto-0.9.8.dll
    cygz.dll
Thanks in advance and regards.
User avatar
TheWitness
Developer
Posts: 17062
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

magoo95,

Please edit the snmp.conf file and remove the mibdirs from that file. Then you will no longer have that error message.

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
TheWitness
Developer
Posts: 17062
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

jagbarcelo,

I am still working an issue with one user in Germany that until it is fixed, I can not release. Therefore, the code you have is a workaround. Thanks for testing it for me.

In the mean time, here are the extra files.

TheWitness
Attachments
cacti_dlls.zip
(518.34 KiB) Downloaded 295 times
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?
jagbarcelo
Posts: 23
Joined: Mon Nov 21, 2005 4:28 am
Location: Spain

Post by jagbarcelo »

No luck: I have installed your latest patch and the dlls you have just uploaded but I still get the following errors in the log file:

Code: Select all

11/24/2005 08:50:01 AM - CACTID: Poller[0] Host[2] ERROR: Empty result [10.0.1.5]: 'perl C:/Inetpub/wwwroot/cacti/scripts/w32_query_logicaldisk.pl 10.0.1.5 get freespace,size C:'
11/24/2005 08:50:01 AM - CACTID: Poller[0] Host[2] DS[84] WARNING: Result from SCRIPT not valid. Partial Result: ...
11/24/2005 08:50:01 AM - CACTID: Poller[0] Host[2] DS[84] SCRIPT: perl C:/Inetpub/wwwroot/cacti/scripts/w32_query_logicaldisk.pl 10.0.1.5 get freespace,size C:, output: U
11/24/2005 08:50:01 AM - CACTID: Poller[0] Host[2] ERROR: Empty result [10.0.1.5]: 'perl C:/Inetpub/wwwroot/cacti/scripts/w32_query_logicaldisk.pl 10.0.1.5 get freespace,size D:'
11/24/2005 08:50:01 AM - CACTID: Poller[0] Host[2] DS[85] WARNING: Result from SCRIPT not valid. Partial Result: ...
11/24/2005 08:50:01 AM - CACTID: Poller[0] Host[2] DS[85] SCRIPT: perl C:/Inetpub/wwwroot/cacti/scripts/w32_query_logicaldisk.pl 10.0.1.5 get freespace,size D:, output: U
11/24/2005 08:50:01 AM - CACTID: Poller[0] Host[2] ERROR: Empty result [10.0.1.5]: 'perl C:/Inetpub/wwwroot/cacti/scripts/w32_query_logicaldisk.pl 10.0.1.5 get freespace,size E:'
11/24/2005 08:50:01 AM - CACTID: Poller[0] Host[2] DS[86] WARNING: Result from SCRIPT not valid. Partial Result: ...
11/24/2005 08:50:01 AM - CACTID: Poller[0] Host[2] DS[86] SCRIPT: perl C:/Inetpub/wwwroot/cacti/scripts/w32_query_logicaldisk.pl 10.0.1.5 get freespace,size E:, output: U
11/24/2005 08:50:01 AM - CACTID: Poller[0] Host[2] ERROR: Empty result [10.0.1.5]: 'perl C:/Inetpub/wwwroot/cacti/scripts/w32_query_logicaldisk.pl 10.0.1.5 get freespace,size F:'
11/24/2005 08:50:01 AM - CACTID: Poller[0] Host[2] DS[87] WARNING: Result from SCRIPT not valid. Partial Result: ...
11/24/2005 08:50:01 AM - CACTID: Poller[0] Host[2] DS[87] SCRIPT: perl C:/Inetpub/wwwroot/cacti/scripts/w32_query_logicaldisk.pl 10.0.1.5 get freespace,size F:, output: U
I have already uploaded my w32_query_logicaldisk.pl. If you need any other information or want me to test anything, just ask.

I really appreciate your help, TheWitness & BSOD2600. Regards.
User avatar
magoo95
Posts: 18
Joined: Tue Nov 15, 2005 9:39 am
Location: Paris, FRANCE

Post by magoo95 »

All,

I think i have the full explaination for this problem.
This is not entirely a cactid bug by itself.

When i have performed the new tests with this new cactid.exe, i have setup a full path in the "data input method" field as follow:
C:/perl/bin/perl.exe C:/cacti/scripts/w32cpu.pl <hostname> get LoadPercentage 2
and this working fine.
As i'm really curious, i have reinstalled from scratch cacti on my server and used this new cactid version, i again falled in the original problem:
CACTID: Host[2] ERROR: Empty result [129.227.81.125]: perl <path_cacti>/scripts/w32cpu.pl 129.227.81.125 get LoadPercentage 2'
CACTID: Host[2] DS[13] WARNING: Result from SCRIPT not valid. Partial Result: ..

damned :evil:

I then decided to modify the line itself and the problem is solved only if you set the full perl path as follow:
C:/perl/bin/perl <path_cacti>/scripts/w32cpu.pl 129.227.81.125 get LoadPercentage 2'

Conclusion, the problem is solved by using this new cactid version AND setting the full path for perl.
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

Odd. While I don't primarly use cactid for my polling, I do run a few perl scripts. Perl is in my system path, but I have not referenced the full path in Cacti data input methods. Everything works fine.
jagbarcelo
Posts: 23
Joined: Mon Nov 21, 2005 4:28 am
Location: Spain

Post by jagbarcelo »

This is really annoying... I have also tried what magoo95 suggested about defining the full path to perl.exe in the 'data input methods' without any difference. I can't make my RRD files get updated when associated to w32_query_logicaldisk.pl. All the rest datasources are beging updated (pings, network traffic, etc) and the GUI (web pages) seem to work fine too.

I have one little thing to add and it confuses me a lot: There is another perl script that runs perfectly but not w32_query_logicaldisk.pl. The script is a replacement for the distributed ping.pl. Since I'm running on a spanish localised windows server, the cacti-built-in ping.pl script does not work for me. I modified it to be:

Code: Select all

#!/usr/bin/perl 

$ping = `ping -n 1 $ARGV[0] -w 1000 | grep TTL`; 
$ping =~ m/(.*tiempo(<|=))(.*)m(.*)/; 

print $3;
Which, in fact, don't make much difference with the original one. Well... this script works fine with cactid and the associated RRD files are updated. However w32_query_logicaldisk.pl does not work. Maybe because it returns multiple values? I don't know.

Just in case I attach a FULL-DEBUG log file of a cactid run. I hope TheWitness or BSOD2600 have a little time to have a look at it and help me out. I'd really like to start using this new version of cacti and not be anchored in the past using cacti-0.8.5 forever.

Regards.
Attachments
cacti.txt
(134.58 KiB) Downloaded 178 times
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

It's weird how that script only some times returns stuff. Also, I didnt see any CACTI2RRD entries for your w32_query_logicaldisk.pl script. Mind posting a screenshot of the data input method?
jagbarcelo
Posts: 23
Joined: Mon Nov 21, 2005 4:28 am
Location: Spain

Post by jagbarcelo »

A screenshot of my W32 - Get Free Disk Space data input method:
The input string is too long and cannot be read completely. It should read:

perl.exe <path_cacti>/scripts/w32_query_logicaldisk.pl <hostname> get freespace,size <driveletter>

I have also tried to set it to:
c:/perl/bin/perl.exe <path_cacti>/scripts/w32_query_logicaldisk.pl <hostname> get freespace,size <driveletter>

With and without the .exe extension from 'perl.exe'

Note: Now I have 2 cacti's installed on my server. The old one in order to keep on retrieving data. And the new one just for testing (under /cactinew/). Of course, cactinew instance has its own database cactinew on MySQL and I have replaced all directory references from cacti to cactinew. This new instance called cactinew behaves the same way that I've commenting in this thread: w32_query_logicaldisk.pl does not update any RRD file.


-------------------


I decided to do one test more before sending this out: I have just seen my output fields called Size and FreeSpace (note the upper cases) and tried just to write them all using lowercases (size and freespace). Now the RRDs are updated and everything seems to run perfectly. I want, however make clear that this data input method worked also perfectly on version 0.8.5, so there must have been a change somewhere in the middle of versions 0.8.5 to 0.8.6g that changed this behaviour, making the names of output fields case-sensitive... or maybe it is just a cactid issue, and cacti is not to blame.

TheWitness: Can you check that? If cactid has this behaviour on purpose, it's ok, but if there is no real reason for being case-sensitive, I suppose it should be better to read the output fields not being case-sensitive.

Regards, and thanks a lot for your help and valuable time. Keep on working on this great tool ;)

You can mark this issue/post as closed.
Attachments
data input method.gif
data input method.gif (52.03 KiB) Viewed 6248 times
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest