Perl script problem [Solved]

Templates, scripts for templates, scripts and requests for templates.

Moderators: Developers, Moderators

Post Reply
Le_Julo
Posts: 4
Joined: Tue Jul 28, 2009 3:56 am
Location: France - Lille

Perl script problem [Solved]

Post by Le_Julo »

Hi there,

i'm having some weird problem with this little (and quite simple) script :

Code: Select all

#!/bin/perl

$host=$ARGV[0];
use Net::Ping;
$p = Net::Ping->new();
$p->port_number(80);
if ($p->ping($host))
{
print 1;
}
else
{
print 0;
}
$p->close();
I guess i don't have to explain this it's just a ping on the http port that give me a "1" when port's open and a "0" when it's not.

im testing it on a server that DOES have the http port open, but Cacti refuses to graph the "1" value.
here my tests/templates/graphs
Attachments
As you see, the perl script looks good ..
As you see, the perl script looks good ..
Capture01.jpg (6.79 KiB) Viewed 1296 times
Capture05.jpg
Capture05.jpg (75.95 KiB) Viewed 1296 times
Capture04.jpg
Capture04.jpg (71.39 KiB) Viewed 1296 times
Capture03.jpg
Capture03.jpg (116.29 KiB) Viewed 1296 times
Capture02.jpg
Capture02.jpg (64.82 KiB) Viewed 1296 times
Last edited by Le_Julo on Tue Jul 28, 2009 9:36 am, edited 1 time in total.
Great !
Le_Julo
Posts: 4
Joined: Tue Jul 28, 2009 3:56 am
Location: France - Lille

Post by Le_Julo »

The strange thing is that it works well for my ssh test (same script "port 22" and same templates)


can't see where is comes from.

if anyone as an idea, i'm ready to learn !

(i'm sure you've already noticed it's my first post so please be nice with my bad english and stuff :wink: )

thank's
Great !
User avatar
streaker69
Cacti Pro User
Posts: 712
Joined: Mon Mar 27, 2006 10:35 am
Location: Psychic Amish Network Administrator

Post by streaker69 »

Give me a few minutes to replicate your configuration and I'll get back to you.
[b]Cacti Version[/b] - 0.8.7d
[b]Plugin Architecture[/b] - 2.4
[b]Poller Type[/b] - Cactid v
[b]Server Info[/b] - Linux 2.6.18-128.1.6.el5
[b]Web Server[/b] - Apache/2.2.3 (CentOS)
[b]PHP[/b] - 5.2.9
[b]MySQL[/b] - 5.0.45-log
[b]RRDTool[/b] - 1.3.0
[b]SNMP[/b] - 5.3.2.2
[b]Plugins[/b]PHP Network Managing v0.6.1, Global Plugin Settings v0.6,thold v0.4.1,XMLPort v0.3.5,CactiCam v0.1.5,NetTools v0.1.5,pollperf v0.32,RRD Cleaner v1.1,sqlqueries v0.2,superlinks v0.8,syslog v0.5.2,update v0.4,discovery v0.9,zond v0.34a,hostinfo v0.2,Bloom v0.6.5,mactrack v1.1,weathermap v0.96a,mobile v0.1
Le_Julo
Posts: 4
Joined: Tue Jul 28, 2009 3:56 am
Location: France - Lille

Post by Le_Julo »

Well, first : thank's for answering me.

I think i found the source of the probleme but can't fix that :
Attachments
... but for the FTP, he refuses to let the "host" empty, and cheking "use per data source value" doesn't solve the problem
... but for the FTP, he refuses to let the "host" empty, and cheking "use per data source value" doesn't solve the problem
ftp.jpg (22.34 KiB) Viewed 1259 times
For ssh, "host" is empty, and everything's good ...
For ssh, "host" is empty, and everything's good ...
ssh.jpg (22.13 KiB) Viewed 1259 times
Great !
Le_Julo
Posts: 4
Joined: Tue Jul 28, 2009 3:56 am
Location: France - Lille

Post by Le_Julo »

Found !

Should i now add some [Solved] tag to the title ?
Attachments
I forgot to indicate "hostname" as Special Type Code, couldn't work :s
I forgot to indicate "hostname" as Special Type Code, couldn't work :s
solved.jpg (42.95 KiB) Viewed 1255 times
Great !
Post Reply

Who is online

Users browsing this forum: No registered users and 7 guests