[SOLVED] Perl Scripts Issue

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

Moderators: Developers, Moderators

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

Post by TheWitness »

Once you verify that the script is in your poller cache, note the host_id for the host and then run turn logging to MEDIUM and run the following from a command prompt as an Administrator account.

Code: Select all

php -q <path_to_cacti>/cmd.php <host_id> <host_id>
What response do you obtain?

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 »

As I suspected, it appears you have not set the correct permissions on cmd.exe. The log reveals the the NETWORK SERVICE account is denied launching it. Nor do I see anywhere in that log of perl attempting to execute "myscript.pl".
terziyski
Cacti User
Posts: 93
Joined: Thu Nov 02, 2006 6:02 am
Location: Bulgaria
Contact:

Post by terziyski »

I managed to receive results in Cacti after all !

After I gave permissions on NETWORK SERVICE Account to cmd.exe file there was not any improvement. Also I noticed that my dummy host is DOWN. My colleague was changed 10 days ago the DOWNED HOST DETECTION METHOD to "PING and SNMP" as most recommended. I changed it to SNMP Reliable. When device went UP the RRD files of my data source appeared in RRA directory. After creating the Graphs I saw that everything works fine.

I want to thank for their spent time of BSOD2600 and TheWitness.
Cacti user
terziyski
Cacti User
Posts: 93
Joined: Thu Nov 02, 2006 6:02 am
Location: Bulgaria
Contact:

Post by terziyski »

I have one more question.
If I change the poller method back to CACTID, do I have to give the NETWORK SERVICE account permissions for cactid.exe ?

Thanks
Last edited by terziyski on Wed Nov 21, 2007 2:53 am, edited 1 time in total.
Cacti user
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

Yup.
terziyski
Cacti User
Posts: 93
Joined: Thu Nov 02, 2006 6:02 am
Location: Bulgaria
Contact:

Post by terziyski »

Hi again,

I decided to switch back the poller method to CACTID.
After one poll interval there was a gap on my graphs and in cacti log i saw the 'Empty result....' error.
I gave the Network Service Account permissions for read&execute of CACTID.EXE, but nothing is cahanged.
Also I used full path to perl.exe i.e 'c:/perl/bin/perl.exe...' in my Data Input Methods and I have rebuilt the Poller Cache, but again nothing is changed.
Any ideas ?
Cacti user
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

Re-follow the same troubleshooting steps we went through for cmd.php to figure out why it's not working...again.
terziyski
Cacti User
Posts: 93
Joined: Thu Nov 02, 2006 6:02 am
Location: Bulgaria
Contact:

Post by terziyski »

Hi,

I followed step-by-step troubleshooting but nothings changed at all. I still have 'Empty result...' error. I gave the network srvice account permissions for cactid.exe, cactid.conf (they are in c:\cygwin\bin folder).
Also gave permissions for the whole c:\perl folder.
Is there any other account that I should give permissions of these files ?
Cacti user
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

Probably not, but can't say for sure until you've ran Filemon.

Once you verify that the script is in your poller cache, note the host_id for the host and then run turn logging to MEDIUM and run the following from a command prompt as an Administrator account.

Code: Select all

cactid <host_id> <host_id>
What response do you obtain?
terziyski
Cacti User
Posts: 93
Joined: Thu Nov 02, 2006 6:02 am
Location: Bulgaria
Contact:

Post by terziyski »

After some researches in source code of cactid I realized, that when the poller is cactid and the host is not snmp enabled (snmp not in use) cactid does not poll the host. There is much sense in that, because when the the host is down according to the snmp there is no need to poll it. I had to change the host ip to a fake ip with snmp enabled to let the cactid poll the host and start the perl script.
Consider this topic as SOLVED.
Cacti user
User avatar
TheWitness
Developer
Posts: 17059
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Best to upgrade to 0.8.7b so you can be more specific about availability polling.

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