Cactid: SNMP works / Script input does NOT work

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

Moderators: Developers, Moderators

claudio
Posts: 19
Joined: Wed May 04, 2005 11:38 am
Location: Switzerland

Cactid: SNMP works / Script input does NOT work

Post by claudio »

Hello

I have a problem with cactid.
Cactid works fine an fast, but only with SNMP.
When I try to gather some data from scripts, cactid says, that the script output is not valid. But I have this problem with all scripts and the same scripts were working before (older cacti without cactid).

At the moment, I'm using cactid 0.8.6e-rc23, but I have the same problems with older versions of cactid 0.8.6.d and 0.8.6.e...

Below some info about a ping latency script that does not work. I have no Idea, why this doesn't work:


Script command and output
D:\Programs\webserver\webpages\cacti\scripts\icmp-latency.pl 10.41.1.82
min:2.91 avg:4.42 max:6.08 dev:1.59 loss:0
Debug Log
06/17/2005 10:40:00 AM - CACTID: Poller[0] Host[6] DS[634] SCRIPT: perl D:\Programs\webserver\webpages\cacti/scripts/icmp-latency.pl 10.41.1.82, output: U
06/17/2005 10:40:00 AM - CACTID: Poller[0] Host[6] DS[634] WARNING: Result from SCRIPT not valid. Partial Result: ...
06/17/2005 10:40:00 AM - CACTID: Poller[0] Host[6] ERROR: Empty result [10.41.1.82]: 'perl D:\Programs\webserver\webpages\cacti/scripts/icmp-latency.pl 10.41.1.82'

Regards,

Claudio
Attachments
Data Input Method
Data Input Method
datainput.jpg (39.67 KiB) Viewed 6749 times
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

Perl in your system path?
The user thats running the scheduled task, have the proper rights to run perl & the script?
denow
Posts: 8
Joined: Mon Mar 15, 2004 2:10 am

Re: Cactid: SNMP works / Script input does NOT work

Post by denow »

claudio wrote:Hello

I have a problem with cactid.
Cactid works fine an fast, but only with SNMP.
When I try to gather some data from scripts, cactid says, that the script output is not valid. But I have this problem with all scripts and the same scripts were working before (older cacti without cactid).

At the moment, I'm using cactid 0.8.6e-rc23, but I have the same problems with older versions of cactid 0.8.6.d and 0.8.6.e...

Below some info about a ping latency script that does not work. I have no Idea, why this doesn't work:


Script command and output
D:\Programs\webserver\webpages\cacti\scripts\icmp-latency.pl 10.41.1.82
min:2.91 avg:4.42 max:6.08 dev:1.59 loss:0
Debug Log
06/17/2005 10:40:00 AM - CACTID: Poller[0] Host[6] DS[634] SCRIPT: perl D:\Programs\webserver\webpages\cacti/scripts/icmp-latency.pl 10.41.1.82, output: U
06/17/2005 10:40:00 AM - CACTID: Poller[0] Host[6] DS[634] WARNING: Result from SCRIPT not valid. Partial Result: ...
06/17/2005 10:40:00 AM - CACTID: Poller[0] Host[6] ERROR: Empty result [10.41.1.82]: 'perl D:\Programs\webserver\webpages\cacti/scripts/icmp-latency.pl 10.41.1.82'

Regards,

Claudio

If i am not wrong cactid doesn't allow multiple return values. Either u have to rewrite your perl script to return a single value at a time or use cmd.php
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

You must install the base cygwin and place c:\cygwin\bin in your path. Else, you must obtain a cygwin copy of the sh.exe program from the cygwin distribution and place it in the cactid binary directory.

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?
claudio
Posts: 19
Joined: Wed May 04, 2005 11:38 am
Location: Switzerland

Post by claudio »

Thank you for the feedback!

@BSOD2600:
The perl dir is in the PATH environment variable.
The script has the required privileges. I checked that, by scheduling the script directly with the same user cactid is running.

@denow
I think it should work.
But I tested a script with only one return value and the script also doesn't work.

@TheWitness
My cygwin is not on C:, its on D:\...\...\cygwin\. I hope thats no problem.
The directory is in the PATH environment variable.
I also tried it with a copy of sh.exe in the cactid directory, but it didn't work.

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

Post by BSOD2600 »

Are there spaces in the path to cygwin? If so, that might be the cause of the problem.

When you say you tried it with sh.exe, which user are you running it under? Sure the cygwin files have the proper rights that you're scheduled task runs under?

Since the script does work out side of Cacti, it really does sound like a permission issue to me.
claudio
Posts: 19
Joined: Wed May 04, 2005 11:38 am
Location: Switzerland

Post by claudio »

Path to cygwin: D:\Programs\webserver\cygwin
Path to cacti: D:\Programs\webserver\webpages\cacti

I'm ashamed to say that the scheduled task runs under the SYSTEM account at the moment, which is a security hole.
But I think, this user has the required privileges.

Is it not possible to log the real output of the scripts executed by cactid?
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

1) I would create a real user account for the scheduled task. Give it admin rights, or assign the proper security to the files/apps for it to work.

2) Turning on polling debug and running cactid.exe will give you the verbose output what it's doing.
claudio
Posts: 19
Joined: Wed May 04, 2005 11:38 am
Location: Switzerland

Post by claudio »

I executed cactid.exe in CMD an redirected the output to a logfile.
Then I saw the following error message in CMD:
D:\Programs\webserver\cygwin\bin\sh.exe (35656): *** cygheap base mismatch detected - 0x61810000/0x61820000.
This problem is probably due to using incompatible versions of the cygwin DLL.
Search for cygwin1.dll using the Windows Start->Find/Search facility
and delete all but the most recent version. The most recent version *should*
reside in x:\cygwin\bin, where 'x' is the drive on which you have
installed the cygwin distribution. Rebooting is also suggested if you
are unable to find another cygwin DLL.
I deleted the sh.exe in the cactid directory and after that it was working for the first time! :-) (but only when executing from CMD)

I tried it with a deticated local account with admin privileges for the sceduled task. But still the same problem.

After that I used my own User Account (of the AD Domain) - which has admin privileges on the server - for the sceduled task and it worked.

The server was migrated to a new Active Directory Domain a few weeks ago. I don't know why it doesent work with a local accounts, perhaps the server admins set some new policies.
Anyway, I requested a dedicated AD account for the sceduled poller and hope that will work with that account (At the moment it is running on my personal account).

Another problem I have since it is working is that the process sh.exe does not normally end every time an causes 100% CPU load...!..??
I have to kill it manually from time to time...
Any idea?

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

Post by BSOD2600 »

Did you install sh.exe from some website or through cygwin setup? Did you search your computer (more likely the cacti directories) for duplicate cygwin dlls (like the ones which come with rrdtool) ?

I've never experianced sh.exe not closing, but have with cmd.php. Unsure of why mine some times never closed, I now kill all extra runaway procoesses every 1 hour, just in case. Sounds

When you say it doesn't work as a local admin, what doesn't work exactly? Are you using WMI scripts to poll remote computers? Is the polling computer an AD controller?
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

The prior release's of Cactid had issues with lockups. Please insure that your are running either the latest release of cactid 0.8.6e-rc23 or wait for the production release.

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?
claudio
Posts: 19
Joined: Wed May 04, 2005 11:38 am
Location: Switzerland

Post by claudio »

@BSOD

I installed cygwin trough cygwin setup.

I found a duplicate cygwin1.dll in a Tivoli folder. I am not allowed to delete it, but this folder is not listed in the PATH variable, so it shouldn't be a problem or am I wrong?

After I disabled multithreading (P:1/T:10 => P:2/T:1) sh.exe seems closing well every time. Another cactid user has or had a similar problem. See http://forums.cacti.net/about3498-0.html...

The polling computer is not an AD controller. It is only a member of the AD domain.
Unfortunately the new AD account does not work too (Empty result for scripts in cacti log). I also did a login with the new user and run the poller manually. That was working...?!
I think I have to fix that with one of our server specialists because I'm not really familiar with Windows and AD.
Again my question: Is it not possible to log more details when cactid tries to execute sh.exe? In the logfile I only see "ERROR: Empty result", "Result from SCRIPT not valid. Partial Result: ..." and "output: U". I only see that it doesn't work, but not why...



@TheWitness

I'm using RC23.


- Claudio.
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Set logging to debug, log in as the poller user, change directories to either the <cacti_root> (cmd.php) or the <cactid_binary> (cactid) and run either "php <cacti_root>/cmd.php" or "cactid.exe" manually. You will get your answer.

Due to numerous inter *nix verndor issues, we removed the STDERR logging in Cacti in 0.8.6b.

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 »

If you have cygwin basic files installed and it's in your sytem path, then you should be able to remove cygwin1.dll in the Tivoli folder.
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

claudio,

Are you running the release copy of Cactid 0.8.6e? Also, as long as the Tivoli stuff is not in the path, you should be all set.

However, I don't know how the new cygwin1.dll will affect Tivoli if you have "c:\cygwin\bin" in your system path. That all depends on how the Tivoli app is written.

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?
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests