PL scripts open when run

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

Moderators: Developers, Moderators

Post Reply
Vicerfast
Posts: 5
Joined: Mon Jan 12, 2009 12:13 pm

PL scripts open when run

Post by Vicerfast »

I have seen this issue posted in the Motorol Canopy scripts b Pike however his question was never answered.
First I will state that I moved cacti to a new box running the same version 8.7b and I was having the same issue on the old box.
The getcanopysm stats perl script opens evertime it is run to the desktop and it will continue to open multiple instances of it. The perl windows will not close until the script is closed.

Win 2003 server and the compiled install of 8.7b
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

Sounds like the script was poorly written. It needs to include some logic to timeout/kill itself after X seconds so it does not hang up the pollers.
User avatar
TheWitness
Developer
Posts: 17062
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

The spine 0.8.7d handles kill perfectly.

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?
Vicerfast
Posts: 5
Joined: Mon Jan 12, 2009 12:13 pm

Post by Vicerfast »

not using spine just php poller, the script is the same canopysm script that is presented here in the script forum. The script has been working fine for almost a year, just in the last month it has been an issue.
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

Poller.php will launch cmd.php or spine.exe.

The script still can be broken/have issues. Something obviously changed in the past month to cause it to have issues... maybe the device you're getting the data from?
Vicerfast
Posts: 5
Joined: Mon Jan 12, 2009 12:13 pm

Post by Vicerfast »

It ran until just before midnight, script is monitoring a few hundred items.
When I checked it this morning there were 136 open script windows and it would seem that was enough for it because all graphs stopped.

here is the script that is running

#!/usr/bin/perl

# Stats Grabber for Motorola Canopy SM's
# - Scott Sanders
# - ssanders <at> wavelengthmail <dot> com
# - 3/28/05
#
# Description:
# Gathers data in interger format for the following variables:
# * RSSI
# * Jitter
# * Power Level
# * Temperature
# * Session Status
# * GPS Sync Status
# * Ethernet Link Status

$argv0 = $ARGV[0]; # Host
$argv1 = $ARGV[1]; # Community String
$argv2 = $ARGV[2]; # Query
$string;

if ($argv2 eq "rssi") {
$string = `snmpget -v 2c -c $argv1 $argv0 .1.3.6.1.4.1.161.19.3.2.2.2.0`;
$string =~ s/.*: //;
$string =~ s/\n$//;
print $string;
}
elsif ($argv2 eq "jitter") {
$string = `snmpget -v 2c -c $argv1 $argv0 .1.3.6.1.4.1.161.19.3.2.2.3.0`;
$string =~ s/.*: //;
$string =~ s/\n$//;
print $string;
}
elsif ($argv2 eq "power") {
$string = `snmpget -v 2c -c $argv1 $argv0 .1.3.6.1.4.1.161.19.3.2.2.8.0`;
$string =~ s/.*: "-//;
$string =~ s/ dBm\"\n$//;
print $string;
}
elsif ($argv2 eq "status") {
$string = `snmpget -v 2c -c $argv1 $argv0 .1.3.6.1.4.1.161.19.3.2.2.1.0`;
# Session Status Codes
# 1 = REGISTERED
# 2 = SCANNING
# 3 = REGISTERING
# 4 = other
$string =~ s/.*: \"//;
$string =~ s/[ \t]+\"\n$//;
if ($string eq "REGISTERED") {
print 1; }
elsif ($string eq "SCANNING") {
print 2; }
elsif ($string eq "REGISTERING") {
print 3; }
else {
print 4; }
}
elsif ($argv2 eq "tempF") {
$string = `snmpget -v 2c -c $argv1 $argv0 .1.3.6.1.4.1.161.19.3.3.1.5.0`;
$string =~ s/.*C\///;
$string =~ s/&deg\;F\"\n//;
print $string;
}
elsif ($argv2 eq "tempC") {
$string = `snmpget -v 2c -c $argv1 $argv0 .1.3.6.1.4.1.161.19.3.3.1.5.0`;
$string =~ s/.*: \"//;
$string =~ s/&deg.*\n//;
print $string;
}
elsif ($argv2 eq "ethStatus") {
# Eth Status
# 1 = 10 BaseT Half Duplex
# 2 = 10 BaseT Full Duplex
# 3 = 100 BaseTX Half Duplex
# 4 = 100 BaseTX Full Duplex
$string = `snmpget -v 2c -c $argv1 $argv0 .1.3.6.1.4.1.161.19.3.3.1.9.0`;
$string =~ s/.*: \"//;
$string =~ s/\"\n$//;
if ($string eq "10Base-T Half Duplex") {
print 1; }
elsif ($string eq "10Base-T Full Duplex") {
print 2; }
elsif ($string eq "100Base-TX Half Duplex") {
print 3; }
elsif ($string eq "100Base-TX Full Duplex") {
print 4; }
}
elsif ($argv2 eq "gpsStatus") {
$string = `snmpget -v 2c -c $argv1 $argv0 .1.3.6.1.4.1.161.19.3.1.3.1.0`;
# GPS Status Code
# 1 = GPS Sync
# 2 = GPS Lost Sync
# 3 = Generating Sync
$string =~ s/.*: //;
$string =~ s/\n$//;
print $string;
}
Vicerfast
Posts: 5
Joined: Mon Jan 12, 2009 12:13 pm

Post by Vicerfast »

change from cmd.php to spine and the script window does not open, however not enough time has passed to see if the graphs are recording data.
Log shows several errors that time out has occured could not ping host, however I can ping the host.
Devices sitting on ICMP ping, did a verbose query and had no issues reading the host.

Will do some more testing and post back.
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

You're using Perl to do simple snmpgets? *shakes head*

Should really look into creating an SNMP XML script/templates. If you don't like those, then a php script server script which has better control/logic for bad scripts. Then lastly we have a Data Templates where you can specify a single OID per template. ALL will be more efficient and reliable than a perl script.
Vicerfast
Posts: 5
Joined: Mon Jan 12, 2009 12:13 pm

Post by Vicerfast »

Ok I think I need to clear something up. I am a Network Tech not a programer. Writing a perl script or a XML script would be like asking a baker to perform open heart surgery.

I am using the scripts as provided here in the scripts forum, written by someone who knows a bucket load more than I do when it comes to writing a script.

I can write the heck out of a dos batch file if that helps but I some how do not think so.

If someone knows of a better way to graph a canopy subscriber module, a canopy access point and canopy cluster managment modules I am all ears.

yes I could do a snmp walk and grap the OID, I have the canopy MIBs but really its just all greek to me. I run flat out all day long managing way too many items for one guy to be doing so unfortunatly I have had no time and no extra brain pan space to learn all of this.

Thanks to dedicated people that have written scripts for guys like me I do not have too. As I say the script was working just fine and then it broke and that has led me here.
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

True, people are some times too busy to learn new things. Anyways if you decide you've got the time, read http://docs.cacti.net/manual:087:3a_adv ... alkthrough
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests