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
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 »

Thank you. I went through the process and created the graph. In the different % that it shows, if the host can always be pinged then there is nothing that will ever show on the graph, correct? (no lines/data).

Time to 8.8.8.8 is 9ms for me.

This is what I see since yesterday, not sure if this is normal or not.
Attachments
graph_image.png
graph_image.png (19.82 KiB) Viewed 13625 times
CactiEZ v0.7 running Cacti 0.8.8a
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 am still getting nothing on the graph.

I added another host to monitor, which right now is timing out when I ping. Shouldn't the graph be all red when there 100% packet loss (i.e. Request Timed Out from the command line)?

Still can't get the ping to work in Cacti... ugh.. Not really sure how to trouble shoot this, help please!?
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 »

Nope, this is not a normal graph. Who knows maybe you have the same problem that i posted recently. http://forums.cacti.net/viewtopic.php?p=258530#p258530

Here is the normal graph:
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 »

madman22 wrote: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.
Can you please post before and after, or at least what's changed?
CactiEZ v0.7 running Cacti 0.8.8a
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 »

DreamHunter wrote:Nope, this is not a normal graph. Who knows maybe you have the same problem that i posted recently. http://forums.cacti.net/viewtopic.php?p=258530#p258530

Here is the normal graph:
Image

I can't get this to work no matter what I do.

-I unzipped v 2.2 of ping and replaced the ss_fping.php with the v2.2 in the ZIP file
-I imported the Advanced ping 2.2 template
-I added the host and details properly, added the graph, and I'm getting nothing

I'm asking that whomever owns this solution/thread to present the solution clearly with a step by step including versions where to expect this to work.
Those of us who don't have php coding experience and don't dare dive into PHP files for edits would appreciate the solution presented that way.

I have tried to follow the steps and it's not working for me. :(

Thank you
CactiEZ v0.7 running Cacti 0.8.8a
Chilloutfaktor
Posts: 16
Joined: Mon Nov 01, 2010 5:58 am

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

Post by Chilloutfaktor »

I'm using cacti 8.8.8f and have also an crazy issue.

I get "The RRD File does not exist", i can confirm this "/usr/bin/rrdtool info /var/www/cacti/rra/google_com_loss_2989.rrd" does not exist.
The question is, why it is not created ? I dont see anything in the logs (debug/devel) why this is not created.

cmd output works.

When I run the graph in realtime plugin, the graph and its data is generated and shown correctly:

Code: Select all


01/14/2016 10:49:28 AM - POLLER: Poller[0] CACTI2RRD: /usr/bin/rrdtool update /var/www/tmp//realtime_2989_5.rrd --template min:avg:max:dev:loss 1452764963:20.1000:20.3000:20.4000:0.1500:0.0000
01/14/2016 10:49:28 AM - CMDPHP: Poller[0] DEVEL: SQL Row: "select name,data_source_path from data_template_data where local_data_id=2989"
01/14/2016 10:49:28 AM - WEBLOG: Poller[0] CACTI2RRD: /usr/bin/rrdtool info /var/www/cacti/rra/google_com_loss_2989.rrd
01/14/2016 10:49:28 AM - WEBLOG: Poller[0] CACTI2RRD: /usr/bin/rrdtool graph -  --imgformat=PNG  --start=-60  --end=-15  --title="google.com - Advanced Ping"  --base=1000  --height=240  --width=750  --x-grid SECOND:10:MINUTE:1:SECOND:10:0:%M:%S  --upper-limit=10  --lower-limit=0  --units-exponent=1  --vertical-label="milliseconds"  --slope-mode  --font TITLE:12:  --font AXIS:8:  --font LEGEND:10:  --font UNIT:8:  DEF:a="/var/www/tmp//realtime_2989_5.rrd":min:AVERAGE  DEF:b="/var/www/tmp//realtime_2989_5.rrd":avg:AVERAGE  DEF:c="/var/www/tmp//realtime_2989_5.rrd":max:AVERAGE  DEF:d="/var/www/tmp//realtime_2989_5.rrd":loss:AVERAGE  DEF:e="/var/www/tmp//realtime_2989_5.rrd":dev:AVERAGE  CDEF:cdefg=d,0,GT,d,2,GT,UNKN,INF,IF,UNKN,IF  CDEF:cdefh=d,3,GT,d,5,GT,UNKN,INF,IF,UNKN,IF  CDEF:cdefi=d,5,GT,d,10,GT,UNKN,INF,IF,UNKN,IF  CDEF:cdefj=d,10,GT,d,15,GT,UNKN,INF,IF,UNKN,IF  CDEF:cdefba=d,15,GT,d,50,GT,UNKN,INF,IF,UNKN,IF  CDEF:cdefbb=d,50,GT,d,95,GT,UNKN,INF,IF,UNKN,IF  CDEF:cdefbc=d,95,GT,d,100,GT,UNKN,INF,IF,UNKN,IF  CDEF:cdefbe=e,2,/  CDEF:cdefbg=c,b,-,e,-,3,/  CDEF:cdefca=b,a,-,0.2,*  CDEF:cdefch=d,0,GT,d,2,GT,UNKN,a,IF,UNKN,IF  CDEF:cdefci=d,3,GT,d,5,GT,UNKN,a,IF,UNKN,IF  CDEF:cdefcj=d,5,GT,d,10,GT,UNKN,a,IF,UNKN,IF  CDEF:cdefda=d,10,GT,d,15,GT,UNKN,a,IF,UNKN,IF  CDEF:cdefdb=d,15,GT,d,50,GT,a,INF,IF,UNKN,IF  CDEF:cdefdc=d,50,GT,d,95,GT,UNKN,a,IF,UNKN,IF  CDEF:cdefdd=d,95,GT,d,100,GT,UNKN,a,IF,UNKN,IF  LINE1:a:""   LINE1:b:""   LINE1:c:""   LINE1:d:""   LINE1:e:""   COMMENT:"   Pkt Loss\:"   AREA:cdefg#AFECEDFF:"1-2%"   AREA:cdefh#55D6D3FF:"3-5%"   AREA:cdefi#7CB3F1FF:"6-10%"   AREA:cdefj#4668E4FF:"11-15%"   AREA:cdefba#A150AAFF:"16-50%"   AREA:cdefbb#FF00FFFF:"51-95%"   AREA:cdefbc#F51D30FF:"96-100%\n"   AREA:b#FFFFFFFF:""   AREA:cdefbe#333333FF:"":STACK  AREA:cdefbe#555555FF:"":STACK  AREA:cdefbg#888888FF:"":STACK  AREA:cdefbg#AAAAAAFF:"":STACK  AREA:cdefbg#CCCCCCFF:"":STACK  AREA:a#FFFFFFFF:""   AREA:cdefca#CCCCCCFF:"":STACK  AREA:cdefca#AAAAAAFF:"":STACK  AREA:cdefca#888888FF:"":STACK  AREA:cdefca#555555FF:"":STACK  AREA:cdefca#333333FF:"":STACK  GPRINT:d:AVERAGE:"   Avg Loss\:%6.2lf%%"   GPRINT:d:MAX:"Max Loss\:%6.2lf%%\n"   AREA:cdefch#AFECEDFF:""   AREA:cdefci#55D6D3FF:""   AREA:cdefcj#7CB3F1FF:""   AREA:cdefda#4668E4FF:""   AREA:cdefdb#A150AAFF:""   AREA:cdefdc#FF00FFFF:""   AREA:cdefdd#F51D30FF:""   COMMENT:"    Latency\:"   GPRINT:a:AVERAGE:"Min\:%8.2lf ms"   GPRINT:b:AVERAGE:"Avg\:%8.2lf ms"   GPRINT:c:MAX:"Max\:%8.2lf ms"   GPRINT:e:AVERAGE:"Dev\:%8.2lf ms\n"   COMMENT:"Avg Latency\:"   GPRINT:a:AVERAGE:"Min\:%8.2lf ms"   GPRINT:b:AVERAGE:"Avg\:%8.2lf ms"   GPRINT:c:MAX:"Max\:%8.2lf ms"   GPRINT:e:AVERAGE:"Dev\:%8.2lf ms\n"   LINE1:b#00BD27FF:""

edit: I should mention that all my other templates and graphs getting generated correctly. this is only about advanced ping.

anyone got an idea?
cohprog
Posts: 1
Joined: Sat Apr 23, 2016 7:17 am

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

Post by cohprog »

A few ping, every couple of minutes, isn't enough (at least for me) to get an idea of what is really happening. So I wrote a small "ping server" in Perl that use fping to continuously ping, in parallel, one or several hosts and return the summary when queried.

Installation:

1. pingsrv.pl
This is the stand-alone ping server. Normaly it runs as a daemon on the server(s) that will do the ping.
It can be run in the foreground (useful for debugging/testing) if started with the "-f" argument.

Edit the script:
- Set the FPING variable to the location of the "fping" binary.
- Change the SECRET value to whatever you want. It acts as a password so limit access to the data.
- Set the INTERVAL value. For best result it must be set to the same value as the Cacti poller interval (default 5min).
- Change the FREQ value. It's the interval between 2 pings (default 200ms).
- Change the BINDTO variable to the IP address on which the server will listen (ie 127.0.0.1 if accept only local connections. Or 0.0.0.0 to accept connections incoming from any network interface)
- By default, the server will listen on port 9928. Change the PORT variable if you want to use another port.

Optionaly, you can use the HostList array to define an initial list of hosts to ping. The script will learn which hosts it need to ping based on the query it receives so that list can be left empty.

Note: fping need to run as root. So you can start pingsrv.pl as root or setuid it or the fping binary.

2. ss_fping.pl
This script is a replacement for ss_fping.php. You probably want to put it into the "scripts" directory of your Cacti installation.

Edit the script:
- Set SERVER to the IP address of the ping server (default 127.0.0.1)
- Set PORT to the port on which the server listen (default 9928)
- Set SECRET to the same value as the one you used in pingsrv.pl

The pingsrv.pl script doesn't have to run on the same server as Cacti. In fact, you can ping different hosts from different servers. You can define the address of the ping server to use for a given host by editing the "PingServer" hash or you can configure it directly in Cacti.

In Cacti, change the "Data Input Methods" of "PING - Advanced Ping" and set the following:
Input Type: Script/command
Input string: perl <path_cacti>/scripts/ss_fping.pl <hostname> <server>

Remove the unused input fields and add a new one with those values:
Field: server
Friendly name: IP address or hostname of the ping server
Allow empty Input: checked

In the "Data Templates" "PING - Advanced Ping", make sure that you checked "Use Per-Data Source Value" for the "IP address or hostname of the ping server" custom data if you want to be able to set the address of the ping server inside Cacti (Else, you can set it into the ss_fping.pl script for each hosts or just use the default value).

3. queryping.sh
The ping server can also be used without Cacti. For that, you need to telnet to it and first type the SECRET and then the hostname/IP address of the host you want to ping or query results. For example:

Code: Select all

telnet 127.0.0.1 9928
12345
192.168.0.1
If the hostname/IP address isn't pinged yet, it will be added to the list of hosts to ping. If the hostname/IP is already being pinged, the data from the last interval are returned.

Instead of typing an hostname/IP address, it's possible to type "summary" to get a list of all those hosts currently being pinged with their data. Ie:

Code: Select all

telnet 127.0.0.1 9928
12345
summary
Because of timeout, you have to type fast. So, as an example, I provided the queryping.sh shell script.
Edit it to set the PORT number of the ping server. Optionaly, set the SECRET and SERVER values so that you won't have to specify them when using the script.

Use -h parameter to get the full syntax:

Code: Select all

queryping.sh -h
Usage: /usr/local/bin/queryping.sh -k [secret_key] -s [ping_server] -p [port] -q [host]
       [secret_key]  = Secret key to access the ping server
       [ping_server] = IP/Hostname of ping server
       [port]        = TCP port used by the ping server
       [host]        = Return information for this host
       if -q is omitted, return information for all hosts

Code: Select all

Here is an example of summary:

Host                          Sent  Lost     %     Min     Max     Avg     Dev
------------------------------------------------------------------------------
172.16.101.195                1475     0   0.0   0.440   3.120   1.443   0.577
172.16.100.112                1475     0   0.0   0.490   2.710   1.431   0.572
172.16.100.195                1475     0   0.0   1.350   7.030   2.259   0.643
172.16.133.191                1475     0   0.0   1.050  23.880   1.530   0.751
172.16.201.132                1475     0   0.0   0.500   6.020   1.445   0.582
172.16.100.228                1475     0   0.0   2.220  11.090   3.524   0.735
192.168.252.3                 1475     0   0.0   2.220   9.810   3.922   0.905
172.16.100.67                 1475     0   0.0   2.330  23.290   3.467   0.808
192.168.254.6                 1475     0   0.0   3.200  28.110   6.293   3.075



Enjoy!
Attachments
pingserver.tgz
(3.87 KiB) Downloaded 650 times
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 »

My variant of ss_fping.pl:

Code: Select all

#!/usr/local/bin/perl

# take care for tcp:hostname or TCP:ip@
$host     = $ARGV[0];
$count    = $ARGV[1];
$protocol = $ARGV[2];
$port     = $ARGV[3];

$host =~ s/tcp:/$1/gis;
$host =~ s/:[0-9]{1,5}/$1/gis;

# old linux version use "icmp_seq"
# newer use "icmp_req" instead
my @data, @timings, @loss;

$pid = open(PROCESS, "/sbin/ping -c$count -i0 -t2 -q $host |");
while (<PROCESS>) {
    push (@data, <PROCESS>);
};
close(PROCESS);

@loss = split("received, ", @data[2]);
@loss = split("%", @loss[1]);

if (@loss[0] eq "100.0") {
    print "min:U avg:U max:U dev:U loss:100.00";
} else {
    @timings = split(" = ", @data[3]);
    @timings = split(" ms", @timings[1]);
    @timings = split("/", @timings[0]);

    print "min:@timings[0] avg:@timings[1] max:@timings[2] dev:@timings[3] loss:@loss[0]";
}
It been developed because of old ss_fping.php that works too long in overloaded systems with many devices. So i will be glad to share my pretty fast script.
wellyh
Posts: 1
Joined: Thu Mar 02, 2017 6:19 am

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

Post by wellyh »

Hi,

Great template, but I've found it a bit weird when I tried to ping a host on TCP port 5900 ( VNC ) for testing purpose, to check VNC service, it's been running fine.
ping_vnc_5900.png
ping_vnc_5900.png (13.06 KiB) Viewed 9312 times
FTP service is also 'seen' but for other TCP ports such as 80 ( HTTP ), 5800 ( yep, another VNC port ), 3306 ( MySQL ), 8030 ( a specific application listening on that port ) it fails.
While I'm able to test using telnet to the target host on those ports without any problem from the host where cacti is running.
I haven't tried other different ports though, but judging on the situation the result may vary.
ftp_ok_8030_no.png
ftp_ok_8030_no.png (42.98 KiB) Viewed 9312 times
I also tried running ss_fping.php from the command line with below results :
ping_fail_tcp.png
ping_fail_tcp.png (21.69 KiB) Viewed 9312 times
I remember when I used Smokeping in the past I had to use TCPPing binary in order to ping tcp port, but since this template mentions it can monitor TCP and UDP beside the common ICMP then I guess I don't to use another additional ping tool?
Any thoughts?
TIA
zuku
Posts: 8
Joined: Thu Jun 09, 2016 2:11 am

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

Post by zuku »

I have problem from cacti linux console I can ping remote IP, but this IP assigned to device in Advanced Ping shows status as down and have no graph for it
1602886
Posts: 4
Joined: Tue May 23, 2017 8:24 pm

Re:

Post by 1602886 »

jug wrote:Hello,

this are the new templates for cacti version 0.8.7 as there some basic things changed and old scripts and templates won't work anymore :-?

As andreagabellini told us in his post (thanks for your explanation) on new installation MIN and LAST CF's are not created by default. As the Graph-Template used this CF's you got error on creating the Graph.

I include in this post the new version of ss_fping.php (including now the requested global.php instead of the config.php) and the modified Graphtemplate which now does *not* use LAST and MIN but only AVERAGE and MAX.

Hope this works again for all of you.

Have fun,

Jug

OS:CentOS7.3
Cacti:1.1.7
mysql:5.6
php:5.4
spine:1.1.7

Hi, use 2.2 template data graphic works, but has the following error in the Log, very regular, no 4-5 minutes at a time, oh, by the way, I am now cacti global use of spine polling (1 minute).

Code: Select all

2017-05-27 14:19:03 - CMDPHP PHP ERROR Backtrace: (/script_server.php: 223 call_user_func_array)(ss_fping)(/scripts/ss_fping.php: 113 split)(CactiErrorHandler)(/lib/functions.php: 4347 cacti_debug_backtrace)
2017-05-27 14:19:03 - ERROR PHP DEPRECATED: Function split() is deprecated in file: /usr/share/nginx/html/scripts/ss_fping.php on line: 113
2017-05-27 14:19:03 - CMDPHP PHP ERROR Backtrace: (/script_server.php: 223 call_user_func_array)(ss_fping)(/scripts/ss_fping.php: 113 split)(CactiErrorHandler)(/lib/functions.php: 4347 cacti_debug_backtrace)
2017-05-27 14:19:03 - ERROR PHP DEPRECATED: Function split() is deprecated in file: /usr/share/nginx/html/scripts/ss_fping.php on line: 113
2017-05-27 14:19:03 - CMDPHP PHP ERROR Backtrace: (/script_server.php: 223 call_user_func_array)(ss_fping)(/scripts/ss_fping.php: 113 split)(CactiErrorHandler)(/lib/functions.php: 4347 cacti_debug_backtrace)
2017-05-27 14:19:03 - ERROR PHP DEPRECATED: Function split() is deprecated in file: /usr/share/nginx/html/scripts/ss_fping.php on line: 113
2017-05-27 14:19:03 - CMDPHP PHP ERROR Backtrace: (/script_server.php: 223 call_user_func_array)(ss_fping)(/scripts/ss_fping.php: 113 split)(CactiErrorHandler)(/lib/functions.php: 4347 cacti_debug_backtrace)
2017-05-27 14:19:03 - ERROR PHP DEPRECATED: Function split() is deprecated in file: /usr/share/nginx/html/scripts/ss_fping.php on line: 113
2017-05-27 14:19:03 - CMDPHP PHP ERROR Backtrace: (/script_server.php: 223 call_user_func_array)(ss_fping)(/scripts/ss_fping.php: 113 split)(CactiErrorHandler)(/lib/functions.php: 4347 cacti_debug_backtrace)
2017-05-27 14:19:03 - ERROR PHP DEPRECATED: Function split() is deprecated in file: /usr/share/nginx/html/scripts/ss_fping.php on line: 113
2017-05-27 14:19:03 - CMDPHP PHP ERROR Backtrace: (/script_server.php: 223 call_user_func_array)(ss_fping)(/scripts/ss_fping.php: 113 split)(CactiErrorHandler)(/lib/functions.php: 4347 cacti_debug_backtrace)
2017-05-27 14:19:03 - ERROR PHP DEPRECATED: Function split() is deprecated in file: /usr/share/nginx/html/scripts/ss_fping.php on line: 113
2017-05-27 14:19:03 - CMDPHP PHP ERROR Backtrace: (/script_server.php: 223 call_user_func_array)(ss_fping)(/scripts/ss_fping.php: 113 split)(CactiErrorHandler)(/lib/functions.php: 4347 cacti_debug_backtrace)
2017-05-27 14:19:03 - ERROR PHP DEPRECATED: Function split() is deprecated in file: /usr/share/nginx/html/scripts/ss_fping.php on line: 113
2017-05-27 14:19:03 - CMDPHP PHP ERROR Backtrace: (/script_server.php: 223 call_user_func_array)(ss_fping)(/scripts/ss_fping.php: 113 split)(CactiErrorHandler)(/lib/functions.php: 4347 cacti_debug_backtrace)
2017-05-27 14:19:03 - ERROR PHP DEPRECATED: Function split() is deprecated in file: /usr/share/nginx/html/scripts/ss_fping.php on line: 113
2017-05-27 14:19:03 - CMDPHP PHP ERROR Backtrace: (/script_server.php: 223 call_user_func_array)(ss_fping)(/scripts/ss_fping.php: 113 split)(CactiErrorHandler)(/lib/functions.php: 4347 cacti_debug_backtrace)
2017-05-27 14:19:03 - ERROR PHP DEPRECATED: Function split() is deprecated in file: /usr/share/nginx/html/scripts/ss_fping.php on line: 113
2017-05-27 14:19:03 - CMDPHP PHP ERROR Backtrace: (/script_server.php: 223 call_user_func_array)(ss_fping)(/scripts/ss_fping.php: 113 split)(CactiErrorHandler)(/lib/functions.php: 4347 cacti_debug_backtrace)
2017-05-27 14:19:03 - ERROR PHP DEPRECATED: Function split() is deprecated in file: /usr/share/nginx/html/scripts/ss_fping.php on line: 113
2017-05-27 14:19:03 - CMDPHP PHP ERROR Backtrace: (/script_server.php: 223 call_user_func_array)(ss_fping)(/scripts/ss_fping.php: 113 split)(CactiErrorHandler)(/lib/functions.php: 4347 cacti_debug_backtrace)
2017-05-27 14:19:03 - ERROR PHP DEPRECATED: Function split() is deprecated in file: /usr/share/nginx/html/scripts/ss_fping.php on line: 113
2017-05-27 14:19:03 - CMDPHP PHP ERROR Backtrace: (/script_server.php: 223 call_user_func_array)(ss_fping)(/scripts/ss_fping.php: 113 split)(CactiErrorHandler)(/lib/functions.php: 4347 cacti_debug_backtrace)
2017-05-27 14:19:03 - ERROR PHP DEPRECATED: Function split() is deprecated in file: /usr/share/nginx/html/scripts/ss_fping.php on line: 113
2017-05-27 14:19:03 - CMDPHP PHP ERROR Backtrace: (/script_server.php: 223 call_user_func_array)(ss_fping)(/scripts/ss_fping.php: 113 split)(CactiErrorHandler)(/lib/functions.php: 4347 cacti_debug_backtrace)
2017-05-27 14:19:03 - ERROR PHP DEPRECATED: Function split() is deprecated in file: /usr/share/nginx/html/scripts/ss_fping.php on line: 113
2017-05-27 14:19:03 - CMDPHP PHP ERROR Backtrace: (/script_server.php: 223 call_user_func_array)(ss_fping)(/scripts/ss_fping.php: 113 split)(CactiErrorHandler)(/lib/functions.php: 4347 cacti_debug_backtrace)
2017-05-27 14:19:03 - ERROR PHP DEPRECATED: Function split() is deprecated in file: /usr/share/nginx/html/scripts/ss_fping.php on line: 113
2017-05-27 14:19:03 - CMDPHP PHP ERROR Backtrace: (/script_server.php: 223 call_user_func_array)(ss_fping)(/scripts/ss_fping.php: 113 split)(CactiErrorHandler)(/lib/functions.php: 4347 cacti_debug_backtrace)
2017-05-27 14:19:03 - ERROR PHP DEPRECATED: Function split() is deprecated in file: /usr/share/nginx/html/scripts/ss_fping.php on line: 113
Attachments
cmdphp.png
cmdphp.png (122.21 KiB) Viewed 8866 times
teddyv
Posts: 1
Joined: Mon Oct 30, 2017 9:28 am

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

Post by teddyv »

i am running cacti v. 0.8.8f and using the advanced ping v2.2 template which works great with ICMP and TCP ping but not that good with UDP. I am using it for UDP port 53 response time and all is it good, but when i try the same with port 123 nothing shows up. I run it in debug mode and it seems like it get's the data but not displaying it:

RRDTool Command:

/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start='-86400' \
--end='-300' \
--title='ntp3 service test - 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/lib/cacti/rra/ntp3_service_test_loss_1914.rrd':'min':AVERAGE \
DEF:b='/var/lib/cacti/rra/ntp3_service_test_loss_1914.rrd':'avg':AVERAGE \
DEF:c='/var/lib/cacti/rra/ntp3_service_test_loss_1914.rrd':'max':AVERAGE \
DEF:d='/var/lib/cacti/rra/ntp3_service_test_loss_1914.rrd':'loss':AVERAGE \
DEF:e='/var/lib/cacti/rra/ntp3_service_test_loss_1914.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: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:cdefh#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:

OK


ITATG
Posts: 3
Joined: Sat Dec 16, 2017 6:01 am

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

Post by ITATG »

Hello
I have a problem with Advanced Ping. It is working all great except for one thing. When I go into Graphs section and I click on the cog for debug, zooming and details, the graph is no more viewed because there are too many columns as you can see in the picture attached. I must zoom the browser but then the picture is too small. There is no horizontal scroll.

Can you please help me?

Thank you
Attachments
Cattura.PNG
Cattura.PNG (77.32 KiB) Viewed 7650 times
netniV
Cacti Guru User
Posts: 3441
Joined: Sun Aug 27, 2017 12:05 am

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

Post by netniV »

As this appears to be layout issue with cacti itself, I've logged this as an issue on the Cacti GitHub Issues
https://github.com/Cacti/cacti/issues/1185
Cacti Developer & Release Manager
The Cacti Group

Director
BV IT Solutions Ltd

+--------------------------------------------------------------------------+

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation
ghost
Posts: 4
Joined: Mon Apr 22, 2019 2:37 am

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

Post by ghost »

If this template can use in Cacti 1.2.3?
https://docs.cacti.net/usertemplate:gra ... d_ping_alt

I import it to 1.2.3 on a Ubuntu 18 host with PHP 7.2 and set TCP ping a host port 80,
but got a error message in log

ERROR PHP ERROR: Uncaught Error: Call to undefined function split() in /cacti/scripts/ss_fping.php:26 Stack trace: #0 /home/cacti/scripts/ss_fping.php(20): ss_fping('192.168.1.20', '10', 'TCP', '80') #1 {main} thrown in file: /cacti/scripts/ss_fping.php on line: 26

line 26 is

Code: Select all

list($micro,$seconds) = split(" ", microtime());
How should I fix it?
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests