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
guillo
Posts: 9
Joined: Wed Oct 09, 2013 10:36 am

Re: EDIT: Advanced Ping Template Version 1.3 for Cacti 0.8.6

Post by guillo »

guillo wrote:There is a graph that I can't seem to understand what is happening please see attached as it appears near the 0, or even nothing is drawn, my guess is that when I get values larger than 400 ms, it gives this result. This is what I get if I run the ss_fping.php

sudo /usr/bin/php /var/www/cacti/scripts/ss_fping.php 141.146.128.1 20 ICMP
min:482.7040 avg:525.1641 max:593.3310 dev:27.1681 loss:0.0000

I am using template Advanced ping v2.2
image1.jpg
Thanks for your comments.

cacti version 0.8.8.a
I erased graphs and created them again and the issue was gone. The problem was due to pings higher than 600 ms. You need to change and stated in this post: Maximum value > 600 and when you create the device you have to choose None in the Downed Device Detection option. Hope it helps:)
surajitpal2007
Posts: 35
Joined: Tue Feb 15, 2011 4:51 am

Re: EDIT: Advanced Ping Template Version 1.3 for Cacti 0.8.6

Post by surajitpal2007 »

surajitpal2007 wrote:what is the mathematical calculation methodology for advance ping average packet loss, maximum packet loss, minimum latency, average latency and maximum latency..

Thanks - Jit
Hi "TheWitness",

Any suggestion on above would highly appreciated. Please advise.

Thanks - Jit
itochu
Posts: 3
Joined: Thu Feb 13, 2014 3:11 am

Re: EDIT: Advanced Ping Template Version 1.3 for Cacti 0.8.6

Post by itochu »

hugleo explaned how to show red loss with host down detection is on. But I dont have CDEF loss unknown. Can anybody show the sample ?
SaranBajiyen
Posts: 1
Joined: Thu Jun 05, 2014 9:18 pm

Re: EDIT: Advanced Ping Template Version 1.3 for Cacti 0.8.6

Post by SaranBajiyen »

Hi I am getting below error. Can Anyone Help ? My cacti Version 0.8.8b
Appreciate all your inputs here. Thank You!

RRDTool Command:
/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title='JB-DYNM-WHS-2950 - Advanced Ping' \
--rigid \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit='0' \
--vertical-label='seconds' \
--slope-mode \
--font TITLE:10: \
--font AXIS:7: \
--font LEGEND:8: \
--font UNIT:7: \
DEF:a='/var/www/cacti/rra/jb-dynm-whs-2950_loss_149.rrd':'min':AVERAGE \
DEF:b='/var/www/cacti/rra/jb-dynm-whs-2950_loss_149.rrd':'avg':AVERAGE \
DEF:c='/var/www/cacti/rra/jb-dynm-whs-2950_loss_149.rrd':'max':AVERAGE \
DEF:d='/var/www/cacti/rra/jb-dynm-whs-2950_loss_149.rrd':'loss':AVERAGE \
DEF:e='/var/www/cacti/rra/jb-dynm-whs-2950_loss_149.rrd':'dev':AVERAGE \
CDEF:cdefa='a,1000,/' \
CDEF:cdefb='b,1000,/' \
CDEF:cdefc='c,1000,/' \
CDEF:cdefe='e,1000,/' \
CDEF:cdefg='b,a,-,e,-,e,-,1000,/' \
CDEF:cdefh='e,1000,/' \
CDEF:cdefbb='c,b,-,e,-,e,-,1000,/' \
CDEF:cdefbd='e,1000,/' \
CDEF:cdefbh='d,0,GT,d,2,GT,UNKN,b,IF,UNKN,IF,1000,/' \
CDEF:cdefbi='d,3,GT,d,5,GT,UNKN,b,IF,UNKN,IF,1000,/' \
CDEF:cdefbj='d,5,GT,d,10,GT,UNKN,b,IF,UNKN,IF,1000,/' \
CDEF:cdefca='d,10,GT,d,15,GT,UNKN,b,IF,UNKN,IF,1000,/' \
CDEF:cdefcb='d,15,GT,d,50,GT,UNKN,b,IF,UNKN,IF,1000,/' \
CDEF:cdefcc='d,50,GT,d,95,GT,UNKN,b,IF,UNKN,IF,1000,/' \
CDEF:cdefcd='d,95,GT,d,99,GT,UNKN,b,IF,UNKN,IF,1000,/' \
CDEF:cdefce='d,99,GT,d,100,GT,UNKN,INF,IF,UNKN,IF' \
COMMENT:'' \
COMMENT:'' \
COMMENT:'' \
COMMENT:'' \
COMMENT:'' \
AREA:cdefa#FFFFFFFF:'' \
AREA:cdefg#CCCCCCFF:'':STACK \
AREA:cdefh#AAAAAAFF:'':STACK \
AREA:cdefh#888888FF:'':STACK \
AREA:cdefh#888888FF:'':STACK \
AREA:cdefh#AAAAAAFF:'':STACK \
AREA:cdefbb#CCCCCCFF:'':STACK \
AREA:cdefh#FFFFFFFF:'':STACK \
AREA:cdefbd#FFFFFFFF:'':STACK \
AREA:cdefa#FFFFFFFF:'' \
COMMENT:'Pkt Loss (color)\:' \
LINE1:cdefb#00BD27FF:'0%' \
LINE1:cdefbh#AFECEDFF:'01-02%' \
LINE1:cdefbi#55D6D3FF:'03-05%' \
LINE1:cdefbj#7CB3F1FF:'06-10%' \
LINE1:cdefca#4668E4FF:'11-15%' \
LINE1:cdefcb#A150AAFF:'16-50%' \
LINE1:cdefcc#FF00FFFF:'51-95%' \
LINE1:cdefcd#F51D30FF:'96-100%\n' \
AREA:cdefce#F51D30FF:'' \
COMMENT:'Pkt Loss\:' \
GPRINT:d:LAST:' Last\:%6.2lf%%' \
GPRINT:d:MIN:'Min\:%6.2lf%%' \
GPRINT:d:AVERAGE:'Avg\:%6.2lf%%' \
GPRINT:d:MAX:'Max\:%6.2lf%%\n' \
COMMENT:'RTT (color)\:' \
HRULE:0#888888FF:'(rttavg +- 1*sdev)' \
HRULE:0#AAAAAAFF:'(rttavg +- 2*sdev)' \
HRULE:0#CCCCCCFF:'(rttavg +- 3*sdev)\n' \
HRULE:0#FFFFFFFF:'' \
COMMENT:'RTT Min\:' \
GPRINT:cdefa:LAST:'Last\:%8.2lf %s' \
GPRINT:cdefa:MIN:'Min\:%8.2lf %s' \
GPRINT:cdefa:AVERAGE:'Avg\:%8.2lf %s' \
GPRINT:cdefa:MAX:'Max\:%8.2lf %s\n' \
COMMENT:'RTT Avg\:' \
GPRINT:cdefb:LAST:'Last\:%8.2lf %s' \
GPRINT:cdefb:MIN:'Min\:%8.2lf %s' \
GPRINT:cdefb:AVERAGE:'Avg\:%8.2lf %s' \
GPRINT:cdefb:MAX:'Max\:%8.2lf %s\n' \
COMMENT:'RTT Max\:' \
GPRINT:cdefc:LAST:'Last\:%8.2lf %s' \
GPRINT:cdefc:MIN:'Min\:%8.2lf %s' \
GPRINT:cdefc:AVERAGE:'Avg\:%8.2lf %s' \
GPRINT:cdefc:MAX:'Max\:%8.2lf %s\n' \
COMMENT:'Std Dev\:' \
GPRINT:cdefe:LAST:'Last\:%8.2lf %s' \
GPRINT:cdefe:MIN:'Min\:%8.2lf %s' \
GPRINT:cdefe:AVERAGE:'Avg\:%8.2lf %s' \
GPRINT:cdefe:MAX:'Max\:%8.2lf %s\n'


RRDTool Says:
ERROR: Expected some arguments after 'COMMENT:'
raiten
Posts: 43
Joined: Fri May 12, 2006 12:17 pm

Re: EDIT: Advanced Ping Template Version 1.3 for Cacti 0.8.6

Post by raiten »

I have advanced ping 2.2 with cacti 0.8.8b on ubuntu 14.04.

It's mostly working as expected except for one host on WAN.
Working: LAN and google.com
Not working: a remote ip or dyndns-like (not helping by IP)

In command line, it works well
$ php -q /usr/share/cacti/site/scripts/ss_fping.php x.x.x.x 20 ICMP
min:167.6260 avg:173.6056 max:191.5140 dev:7.5174 loss:0.0000
$ ping x.x.x.x
[OK]
$ ssh -p y x.x.x.x
[OK]

but in web ui, there is nothing
I tried to both icmp and a ssh/tcp port but both are empty

Nothing in cacti.log, poller-error.log or Console -> Utilities -> View Poller Cache.
The last show command as "/usr/share/cacti/site/scripts/ss_fping.php ss_fping IP 20 ICMP" but I suppose that's wui way to show it as it failed with all my hosts in cli (but as said, most are ok in wui)

Any hints?

Thanks
madman22
Posts: 2
Joined: Thu Mar 04, 2010 1:06 pm

Re: EDIT: Advanced Ping Template Version 1.3 for Cacti 0.8.6

Post by madman22 »

I just got this working on 0.8.8a by changing ss_fping.php

The problem seems to be from the function read_config_option()

Once i removed all reference to that function the script and graphs started working.
MacPad
Posts: 1
Joined: Sat Nov 01, 2014 7:34 am

Re: EDIT: Advanced Ping Template Version 1.3 for Cacti 0.8.6

Post by MacPad »

itochu wrote:hugleo explaned how to show red loss with host down detection is on. But I dont have CDEF loss unknown. Can anybody show the sample ?
Either add the following to your xml file or try the attached... I inserted these lines under </hash_0500193c976751394a4dc370c974870f56805e>

<hash_0500249ed271a39d20cbae2a614ef5d9667f91>
<name>Advanced Ping - Loss Unknown</name>
<items>
<hash_1400247600c11fd0dcb5257b54360e30b8577e>
<sequence>1</sequence>
<type>6</type>
<value>d,UN,1,EQ,TIME,300,+,NOW,GT,UNKN,INF,IF,d,95,GT,INF,UNKN,IF,IF</value>
</hash_1400247600c11fd0dcb5257b54360e30b8577e>
</items>
</hash_0500249ed271a39d20cbae2a614ef5d9667f91>

I am not one hundred percent sure that this will work, but it seems to have worked for me .....
Attachments
cacti_graph_template_ping_advanced_ping_v2_2a.zip
(6.16 KiB) Downloaded 1139 times
neox01
Posts: 34
Joined: Thu Nov 24, 2011 2:50 am
Location: Germany

Re: EDIT: Advanced Ping Template Version 1.3 for Cacti 0.8.6

Post by neox01 »

Hello forum,
I've just installed the Advanced Ping 2.2 Template.
One value is not clear for me.
What exactly is "deviation" showing me?
Latency and Avg Latency have the exact same values. Can that be right?
Thanks, neox
gaelc
Posts: 1
Joined: Thu Jan 22, 2015 10:51 am

Re: EDIT: Advanced Ping Template Version 1.3 for Cacti 0.8.6

Post by gaelc »

Hello,

I wanted to use this template to monitor some IP outside my network but it doesn't work.

If I try to monitor a host in the same subnet as cacti, everything is ok.

But if I try to monitor something on the internet or on an other site connected through a openvpn routed vpn connection, I get nothing on the graphs (-nan for every value).
I tried to launch the php script on command line (the cacti host is a linux) and I always get a ping response. I tried to launch the script as root and as dedicated cacti user.

I am using cacti 0.8.8b and the template versions 2.2.

Does someone has an idea about this strange problem ?
druss102
Posts: 2
Joined: Tue Mar 10, 2015 1:36 pm

Re: EDIT: Advanced Ping Template Version 1.3 for Cacti 0.8.6

Post by druss102 »

I am running advanced ping 2.2 with cacti 0.8.8b on CentOS 6.6 and getting the same error one of the earlier users got. Appreciate any help

RRDTool Says:

ERROR: invalid rpn expression in: d,0,GT,d,2,GT,UNKN,INF,IF,UNKN,IF

Nevermind, I figured it out. Had to go to New Graph and create from there with the options
MicheleF
Posts: 1
Joined: Fri May 08, 2015 4:05 am

Re: EDIT: Advanced Ping Template Version 1.3 for Cacti 0.8.6

Post by MicheleF »

Hello everybody,

I'm currently using Advanced Ping template version 2.2 with Cacti 0.8.7.i to monitor an external IP (remote.host)

ss_fping.php script seems to work fine: if I run script_server.php to create the php shell and then ss_fping with the command

Code: Select all

/usr/share/cacti/site/scripts/ss_fping.php ss_fping remote.host 20 ICMP
, the output is "min:4.7640 avg:4.9922 max:5.8690 dev:0.2270 loss:0.0000"

But unfortunately, my graph has an empty grid. Graph debug logs end with "OK" and cacti logs don't return any kind of error (but I can copy them if needed)

Can you please help me with this problem?

Thanks a lot!
dennisblah
Posts: 3
Joined: Thu Jun 11, 2015 2:24 am

Re: EDIT: Advanced Ping Template Version 1.3 for Cacti 0.8.6

Post by dennisblah »

MicheleF wrote:Hello everybody,

I'm currently using Advanced Ping template version 2.2 with Cacti 0.8.7.i to monitor an external IP (remote.host)

ss_fping.php script seems to work fine: if I run script_server.php to create the php shell and then ss_fping with the command

Code: Select all

/usr/share/cacti/site/scripts/ss_fping.php ss_fping remote.host 20 ICMP
, the output is "min:4.7640 avg:4.9922 max:5.8690 dev:0.2270 loss:0.0000"

But unfortunately, my graph has an empty grid. Graph debug logs end with "OK" and cacti logs don't return any kind of error (but I can copy them if needed)

Can you please help me with this problem?

Thanks a lot!

I did not got any rdd files at all!
However the realtime graph is working perfect, but is useless when not looking into it ;-) I need to log it
Anyone any solution? I get "RRD file does not exist"

After adjusting the downtime monitor it started working
User avatar
DreamHunter
Posts: 21
Joined: Tue Oct 08, 2013 4:04 am

Re: EDIT: Advanced Ping Template Version 1.3 for Cacti 0.8.6

Post by DreamHunter »

...you know guys. Recently i updated my FreeBSD ports. And advanced ping become to this:

Image

After spending a lot of time i found the problem.
First of all i've been confused by realtime plugin - it worked perfectly. Also using "/usr/local/bin/php ss_fping.php 10.10.10.10 50" via command line, the answered been correct. BUT when it goes in spine - everything changes.

Basically i found exactly my problem in file %cacti%/lib/ping.php:

Code: Select all

/* host timeout given in ms, recalculate to sec, but make it an integer
 * we might consider to use escapeshellarh on hostname,
 * but this field has already been verified.
 * The other fields are numerical fields only and thus
 * not vulnerable for command injection */
if (substr_count(strtolower(PHP_OS), "sun")) {
            $result = shell_exec("ping " . $this->host["hostname"]);
}else if (substr_count(strtolower(PHP_OS), "hpux")) {
            $result = shell_exec("ping -m " . ceil($this->timeout/1000) . " -n " . $this->retries . " " . $this->host["hostname"]);
}else if (substr_count(strtolower(PHP_OS), "mac")) {
            $result = shell_exec("ping -t " . ceil($this->timeout/1000) . " -c " . $this->retries . " " . $this->host["hostname"]);
}else if (substr_count(strtolower(PHP_OS), "freebsd")) {
            $result = shell_exec("ping -t " . ceil($this->timeout/1000) . " -c " . $this->retries . " " . $this->host["hostname"]);
}else if (substr_count(strtolower(PHP_OS), "darwin")) {
            $result = shell_exec("ping -t " . ceil($this->timeout/1000) . " -c " . $this->retries . " " . $this->host["hostname"]);
}else if (substr_count(strtolower(PHP_OS), "bsd")) {
            $result = shell_exec("ping -w " . ceil($this->timeout/1000) . " -c " . $this->retries . " " . $this->host["hostname"]);
}else if (substr_count(strtolower(PHP_OS), "aix")) {
            $result = shell_exec("ping -i " . ceil($this->timeout/1000) . " -c " . $this->retries . " " . $this->host["hostname"]);
}else if (substr_count(strtolower(PHP_OS), "winnt")) {
            $result = shell_exec("ping -w " . $this->timeout . " -n " . $this->retries . " " . $this->host["hostname"]);
}else{
            $result = shell_exec("ping -W " . ceil($this->timeout/1000) . " -c " . $this->retries . " -p " . $pattern . " " . $this->host["hostname"]);
}
This is a pool of commands that calls system ping. I suspect the problem in spine. Because of after writing a full patch to ping command - it works again.
KEYLINE:$result = shell_exec("/sbin/ping -t " . ceil($this->timeout/1000) . " -c " . $this->retries . " " . $this->host["hostname"]);
Here:
Image
vodka
Posts: 17
Joined: Mon Sep 28, 2015 1:07 pm

Re: EDIT: Advanced Ping Template Version 1.3 for Cacti 0.8.6

Post by vodka »

I'm not even sure if I'm on the right path there. I wanted to add a graph of ISP latency by using the google domain. So I went through and created the host, using PING, ICM Ping and Advanced Ping 1.3 (using graph templates) as well as imported the newer 2.2 template version.

However, I am getting "graph not being created"... not sure why.

CactiEZ 0.7 / Cacti Version: 0.8.8a, Plugin Architecture Version: 3.1

I can't find a step by step for this, I thought I read a post that for 2.2 you don't need to add anything on v 0.8.8 and above... doesn't seem to be working for me, not sure why; I find getting this running much more complicated than it needs to be.

Does anyone have a simple walkthru for this, with details (like you should have version x.x for this to work, etc).

Thanks in advance!
CactiEZ v0.7 running Cacti 0.8.8a
User avatar
DreamHunter
Posts: 21
Joined: Tue Oct 08, 2013 4:04 am

Re: EDIT: Advanced Ping Template Version 1.3 for Cacti 0.8.6

Post by DreamHunter »

vodka wrote:I'm not even sure if I'm on the right path there. I wanted to add a graph of ISP latency by using the google domain. So I went through and created the host, using PING, ICM Ping and Advanced Ping 1.3 (using graph templates) as well as imported the newer 2.2 template version.

However, I am getting "graph not being created"... not sure why.

CactiEZ 0.7 / Cacti Version: 0.8.8a, Plugin Architecture Version: 3.1

I can't find a step by step for this, I thought I read a post that for 2.2 you don't need to add anything on v 0.8.8 and above... doesn't seem to be working for me, not sure why; I find getting this running much more complicated than it needs to be.

Does anyone have a simple walkthru for this, with details (like you should have version x.x for this to work, etc).

Thanks in advance!
1) Add and make sure that advanced ping works correctly.

2) You have to add "Device" for google (Console->Devices->Add) similar to this:

Image

3) Add new "Advanced ping" graph for this "Device"

Image

Image

enjoy!
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests