Advanced Ping Template for Cacti 0.8.6f

Addons for Cacti and discussion about those addons

Moderators: Developers, Moderators

Post Reply
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

TheWitness wrote:What version of Cactid?
TheWitness,
my problem is gone using cmd.php. So it seems to be an issue between cactid and php script server. Here's the log snipped running cmd.php
09/14/2005 09:05:02 PM - PHPSVR: Poller[0] DEBUG: INCLUDE: '/var/www/html/cacti-0.8.6f/scripts/ss_fping.php' SCRIPT: 'ss_fping' CMD: 'gandalf 20 TCP 80'
09/14/2005 09:05:02 PM - PHPSVR: Poller[0] SERVER: /var/www/html/cacti-0.8.6f/scripts/ss_fping.php ss_fping gandalf 20 TCP 80 output min:0.2700 avg:0.3065 max:0.4600 dev:0.0501 loss:0.0000

09/14/2005 09:05:02 PM - CMDPHP: Poller[0] Host[2] DS[48] SERVER: /var/www/html/cacti-0.8.6f/scripts/ss_fping.php ss_fping gandalf 20 TCP 80, output: min:0.2700 avg:0.3065 max:0.4600 dev:0.0501 loss:0.0000
But this is not really an option. cactid is way faster.
Reinhard
apeterson
Posts: 14
Joined: Tue Aug 23, 2005 3:02 pm

Advanced Ping rrd returns a "0"

Post by apeterson »

Any devices/graphs I create using Advanced Ping will create RRDs and appear to be working great but the graphs will not show up properly in Cacti (just a red X).

When I run http://host/graph_image.php?local_graph_id=368 instead of a graph I get a single 0 on the screen. I can run that same command with any other graph id and it shows the graph properly.
roger69
Posts: 19
Joined: Mon Apr 04, 2005 2:05 pm

Available for 0.86g?

Post by roger69 »

Will you make this available for those of us running 0.86g? Or are there changes we could make to get it to run without having a machine already with 086f?

Roger
ioiioi
Cacti User
Posts: 52
Joined: Mon Mar 28, 2005 8:57 am

I can't see the AdPing graph in "Graphs Tab".

Post by ioiioi »

run on win2k
cacti0.8.6f with pre-patch applied.

I can see the Adping graph in the graph management,
but I can see it on the "graph tab"

any suggestion?
Attachments
AdPing.on.graph.mgmt.jpg
AdPing.on.graph.mgmt.jpg (135.91 KiB) Viewed 11175 times
AdPing.on.graph.tab.jpg
AdPing.on.graph.tab.jpg (8.33 KiB) Viewed 11175 times
vector
Posts: 5
Joined: Tue Jan 04, 2005 9:03 am

hping

Post by vector »

Can I use this to check for an HTTPS or HTTP site using hping? How can I set parameters?
User avatar
TheWitness
Developer
Posts: 17047
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Yes, but I need to alter the template a bit.

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
glowworm
Posts: 10
Joined: Sun Sep 25, 2005 7:22 am
Location: Melbourne, Australia
Contact:

Linux Permissions

Post by glowworm »

Cool script!

So far I have progressed quite far, but I seem to have run into the permissions fault a few other people are reporting.

OS: Gentoo 2.6.12-r10
Cacti: 0.8.6f-r1
0.8.6f-pre-patch: Applied

If the script is tried in the CLI as root

Code: Select all

gentoo scripts # su - root
gentoo scripts # php ss_fping.php www.google.com 20
min:187.8600 avg:188.8445 max:190.8500 dev:1.4950 loss:0.0000
If the script is tried in the CLI as the user cacti runs under

Code: Select all

gentoo scripts # su - apache
gentoo scripts # php ss_fping.php www.google.com 20
Warning: socket_create() Unable to create socket [1]: Operation not permitted in /var/www/localhost/htdocs/cacti/lib/ping.php on line 98
A debug of the log shows:

Code: Select all

 09/26/2005 12:10:09 PM - CMDPHP: Poller[0] Host[3] DS[20] SERVER: /var/www/localhost/htdocs/cacti/scripts/ss_fping.php ss_fping www.google.com 20, output: loss:100.00
09/26/2005 12:10:09 PM - PHPSVR: Poller[0] SERVER: /var/www/localhost/htdocs/cacti/scripts/ss_fping.php ss_fping www.google.com 20 output loss:100.00
09/26/2005 12:10:09 PM - PHPSVR: Poller[0] DEBUG: INCLUDE: '/var/www/localhost/htdocs/cacti/scripts/ss_fping.php' SCRIPT: 'ss_fping' CMD: 'www.google.com 20'
09/26/2005 12:10:09 PM - CMDPHP: Poller[0] Host[3] PING: Host is Alive
I don't really want to run the poller as root if at all possible, Is there a way to use UDP instead? I think UDP pings don't require root permissions.
User avatar
TheWitness
Developer
Posts: 17047
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

ss_fping.php hostname ping_count [ICMP] || [[TCP] || [UDP] && PORT_NUM]. The additional features were placed in 0.8.6g

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
glowworm
Posts: 10
Joined: Sun Sep 25, 2005 7:22 am
Location: Melbourne, Australia
Contact:

Post by glowworm »

TheWitness wrote:The additional features were placed in 0.8.6g
I have now upgraded to version 0.8.6g and applied all the patches in the downloads area. I can see a change in the ss_fping command.
0.8.6f-r1

Code: Select all

function ss_fping($hostname, $ping_sweeps=6)
0.8.6g

Code: Select all

function ss_fping($hostname, $ping_sweeps=6, $ping_type="UDP", $port=80)
But the data template still only shows two fields. (see attachment).

Image Image
[color=#000099]Cacti [/color][color=#CC33CC]0.8.6g ~x86[/color] [color=#000099]CactiD [/color][color=#CC33CC]0.8.6e[/color] [color=#000099]Advanced Ping [/color][color=#CC33CC]1.2[/color] [color=#000099] - For personal use while I learn it, then to be deployed at a large international site[/color]
[color=#000099]Gentoo[/color] [color=#CC33CC]2.6.12-r10[/color] [color=#000099]Apache[/color] [color=#CC33CC]2.0.54-r31[/color] [color=#000099]Perl[/color] [color=#CC33CC]5.8.6-r6[/color] [color=#000099]PHP[/color] [color=#CC33CC]4.4.0-r3[/color] [color=#000099]MySQL[/color] [color=#CC33CC]4.0.25-r2[/color]
[color=#000099]Pentium IV 2200MHz, 256MB RAM[/color]
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Instead of entering "20" for the Number of Times ... you may enter "20 TCP 80" if you want to ping 20 times using TCP on port 80. Or "20 UDP 80" for UDP. Of course you may enter another port. This even works for me (using cacti 0.8.6g). Cacti will simply pass all 3 parms to the script...
Reinhard
User avatar
glowworm
Posts: 10
Joined: Sun Sep 25, 2005 7:22 am
Location: Melbourne, Australia
Contact:

Post by glowworm »

lvm wrote:you may enter "20 TCP 80"
I should have thought of that! Anyway I tried "20 UDP 80" and it timed out, so I thought I would try it on the CLI as root.

Code: Select all

# php ss_fping.php  www.google.com 6 UDP 80
hung while

Code: Select all

php ss_fping.php 192.168.1.1 6 UDP 80"
worked. In other words I can UDP ping all the machines on my network, but nothing on the internet.

I 'spose it could be a router/firewall issue with my WRT54G, so I put my cacti server in a DMZ but unfortunately no go. TCP and ICMP both work as root but UDP always times out.

Does anyone have an idea where I could start looking? Thanks.
[color=#000099]Cacti [/color][color=#CC33CC]0.8.6g ~x86[/color] [color=#000099]CactiD [/color][color=#CC33CC]0.8.6e[/color] [color=#000099]Advanced Ping [/color][color=#CC33CC]1.2[/color] [color=#000099] - For personal use while I learn it, then to be deployed at a large international site[/color]
[color=#000099]Gentoo[/color] [color=#CC33CC]2.6.12-r10[/color] [color=#000099]Apache[/color] [color=#CC33CC]2.0.54-r31[/color] [color=#000099]Perl[/color] [color=#CC33CC]5.8.6-r6[/color] [color=#000099]PHP[/color] [color=#CC33CC]4.4.0-r3[/color] [color=#000099]MySQL[/color] [color=#CC33CC]4.0.25-r2[/color]
[color=#000099]Pentium IV 2200MHz, 256MB RAM[/color]
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

glowworm wrote:I 'spose it could be a router/firewall issue with my WRT54G, ...
No, not necessarily on your side. Can you imagine what the google admins may have done to prevent their servers from such "distributed denial of service" attacks? Well, I don't know exactly...
I'd prefer to use such ports that are open to public. In this case I'd have taken "20 TCP 80" or so. Why do you want to use UDP?
Reinhard
fanu
Posts: 18
Joined: Thu Oct 07, 2004 2:53 pm
Location: Paris, France

Problem with ss_fping

Post by fanu »

Hello,

I run cacti 0.8.6g under Freebsd 5.4/Apache 2/ MySQL 4.1/ PHP 5.0.5.
I have a problem with ss_fping I think : When there is a packet loss, the script does not end and I have the following error in cacti logs :
10/06/2005 11:31:07 AM - CACTID: Poller[0] Host[4] DS[26] WARNING: Result from SERVER not valid. Partial Result: ...
10/06/2005 11:31:06 AM - CACTID: Poller[0] WARNING: The PHP Script Server did not respond in time and will therefore be restarted

When there is no packet loss, there is not problem and the advanced ping graph is correct.

Thanks for your help.

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

Post by TheWitness »

fanu,

I have noted this and did correct the issue in my production environment. I will post a new ss_fping today, if I get a chance.

Larry
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?
fanu
Posts: 18
Joined: Thu Oct 07, 2004 2:53 pm
Location: Paris, France

Post by fanu »

Thanks a lot!
I will wait for the new ss_fping.
Thanks for your help and your disponibility. Your work is great.

Fanu.
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests