EDIT: Advanced Ping Template Version 1.3 for Cacti 0.8.6g

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

Moderators: Developers, Moderators

Post Reply
tsnww
Posts: 17
Joined: Wed Mar 15, 2006 8:59 am

Post by tsnww »

[root@yourmachine scripts]# php ss_fping.php www.google.com 20 ICMP

min:14.9500 avg:15.0125 max:15.3500 dev:0.1000 loss:0.0000

Can you get this to work?

make sure you are root, and try it.
abadaba
Cacti User
Posts: 52
Joined: Wed Nov 23, 2005 10:43 pm

Post by abadaba »

It works all day as root...But if i try running it as any other in the CLI...i get permission errors...
| Cacti 0.8.6h | MySQL 5.0.22 | PHP 5.1.2
|Apache2.20 | RRDtool 1.2.13 | CentOS 4.3 | P4 3200Mhz | 2.5GB |
User avatar
TheWitness
Developer
Posts: 17004
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

In Unix/Linux, you must be root to generate ICMP packets. It's a long story, but I did place an experimental change in lib/ping.php to allow ping to run if you set php to have as root privileges and have to POSIX PHP module loaded in that version of PHP. You should give it a test, but I would make sure that copy of PHP is not used for your web server, only the poller.

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?
pikes
Posts: 12
Joined: Fri Jun 30, 2006 2:14 pm

Re: no reply

Post by pikes »

CoolTom wrote:everything is ok, but when is the destination down (no ping reply) i didnt get RED color like 100% packet loss but this "WHITE HOLE". Where is problem? Or its correct? May be its when ping get answer:

Reply from xx.xx.xx.85: Destination host unreachable.

thnx for help or answ :-) Tom

--
end where is green staff at AVG LATENCY 0:-)
TheWitness: could you fix this bug? I have a threshold set up to send notification if packet loss goes over a certain amount but it's not going to throw a notification if there's 100% packet loss becuase it simply won't show any loss :/
User avatar
TheWitness
Developer
Posts: 17004
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

The intent was to fix this in 0.9. But being that it's delayed, I will see what I can do.

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?
stlaw
Posts: 4
Joined: Fri Jul 28, 2006 7:00 am

Post by stlaw »

I cant get info detecting UDP port.

[root@localhost cacti]# php ./scripts/ss_fping.php 127.0.0.1 20 UDP 161
loss:100.00

but TCP is right.
[root@localhost cacti]# php ./scripts/ss_fping.php 127.0.0.1 20 TCP 199
min:0.0800 avg:0.5645 max:3.1300 dev:0.6705 loss:0.0000

anyone knows why?

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

Post by TheWitness »

Well, first of all SNMP is connectionless. So there is no guarentee that a UDP ping will generate a reponse. This is especially true with SNMP because it is designed not to respond unless thier is a request with a valid community string.

You are better off performing a UDP ping with an unknown port. That will generate a ICMP response of "port not found". This is only true if your routers are configured to allow this return ICMP traffic to travel the WAN of course.

TheWitness
Last edited by TheWitness on Mon Jul 31, 2006 5:30 am, edited 1 time in total.
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?
stlaw
Posts: 4
Joined: Fri Jul 28, 2006 7:00 am

Post by stlaw »

i see, thanks, Witness, I'd confused UDP with TCP.
pikes
Posts: 12
Joined: Fri Jun 30, 2006 2:14 pm

Post by pikes »

TheWitness wrote:The intent was to fix this in 0.9. But being that it's delayed, I will see what I can do.

TheWitness
Thanks! In the meantime, is there any way to set up a threshold that will trigger when there's 100% packet loss? I don't know how I could say "when average ping goes below %nan" or if there's an alternative.
enliang
Posts: 4
Joined: Wed Aug 02, 2006 5:46 am

Post by enliang »

can i user this template to monitor a host without setting up snmp function?
User avatar
TheWitness
Developer
Posts: 17004
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Simply leave the community string blank.
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?
enliang
Posts: 4
Joined: Wed Aug 02, 2006 5:46 am

Post by enliang »

TheWitness wrote:Simply leave the community string blank.
yes, i have tried, but no picture appeared.
User avatar
TheWitness
Developer
Posts: 17004
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

What is in the Cacti log? Can you post the graphic?

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?
jolramospr
Posts: 32
Joined: Mon Aug 07, 2006 2:32 pm
Location: PR
Contact:

NEW Advanced Ping Template Version 1.3 for Cacti 0.8.6g

Post by jolramospr »

I have installed the Advanced Ping Template on Cacti EZ, I test the script and it is working but the graphs shows 100% packet loss.

Any Idea???

[root@localhost AdvancedPing]# php /var/www/html/scripts/ss_fping.php 192.168.28.253 20 ICMP
Content-type: text/html
X-Powered-By: PHP/4.3.9

min:11.1000 avg:13.6755 max:32.6200 dev:5.9406 loss:0.0000
Allen K
Posts: 25
Joined: Sat Oct 15, 2005 9:34 pm

question

Post by Allen K »

everything is ok, but when is the destination down (no ping reply) i didnt get RED color like 100% packet loss but this "WHITE HOLE". Where is problem? Or its correct? May be its when ping get answer:
I'm curious if there is a patch that I can apply to any of the scripts? I'm currently in the same situation where a failed link will not show 100% loss.

Thanks!!
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests