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
zpa0
Posts: 3
Joined: Thu Feb 16, 2012 11:02 am

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

Post by zpa0 »

Hello,

I have problem with advanced ping template.
Cacti didn't create graphs.

Cacti log contains following warning message:

"POLLER: Poller[0] WARNING: Poller Output Table not Empty. Issues Found: 1, Data Sources: (DS[89])"

When i manually empty the poller output table, graph is created. With every graph update, warning message is generated and graph was not populated.

In attachment is my platform information.
Attachments
Console - Utilities - Technical Support.zip
(9.55 KiB) Downloaded 740 times
zpa0
Posts: 3
Joined: Thu Feb 16, 2012 11:02 am

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

Post by zpa0 »

Downgraded to 0.8.6g and it works.
wangzb
Posts: 1
Joined: Tue Mar 20, 2012 1:41 am
Location: Beijing,China
Contact:

Re:

Post by wangzb »

gandalf wrote:TheWitness,
thank you for this next version of Advanced Ping.
I'd like to add a few words about installing this for those, who do not remember the original post.
- download and unpack ping.zip to <path_cacti>/lib/ping.php
- download and unpack ss_fping.php to <path_cacti/scripts/ss_fping.php
- download and unpack cacti_graph_template_ping_advanced_ping_v1_3.zip to a place of your own choice. Use the cacti web interface to import this template.
- generate graphs for your host using this Graph Template. You will be prompted to enter the protocol, the port (not for ICMP usage) and the number of pings to use.

For those who upgraded from V1.2:
- If you used only the "number of pings" as input to the scripts, there's no need to change the Data Source inputs.
- If you are using the extended input to V1.2, specifying e.g. "20 TCP 80" for checking port 80 with protocol TCP, there's again no need to modify the input parms. But it may be better to do so for clarity. Select Data Sources and filter for Advanced Ping. Select eachh of the displayed data sources and modify the Custom Data input fields accordingly. Please Clear Poller cache when done

Reinhard
help!,where is "ping.php",I can't find it?
tosage
Cacti User
Posts: 164
Joined: Wed Jul 28, 2010 5:05 am
Location: France

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

Post by tosage »

@wangzb : You need ss_fping.php, you find it here : http://forums.cacti.net/viewtopic.php?p=173542#p173542
Cacti Version - 0.8.8a
Plugin Architecture - 3.1
Poller Type - spine
Server Info - Linux
Web Server - Apache/2.2.22 (Ubuntu)
PHP - 5.3.10-1ubuntu3.6 with Suhosin-Patch (cli)
MySQL - 5.5.29-0ubuntu0.12.04.2
RRDTool - 1.4.7
Voiper99
Cacti User
Posts: 276
Joined: Thu Mar 01, 2007 5:43 pm
Location: Melbourne, Australia

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

Post by Voiper99 »

Is it possible to get it working in Cacti 8.8?

I can get it working through the CLI, but have no idea how to get it working through Cacti :(

Code: Select all

[root@vps2 tmp]# php /var/www/html/cacti/script_server.php
PHP Script Server has Started - Parent is cmd

/var/www/html/cacti/scripts/ss_fping.php ss_fping 8.8.8.8 20 ICMP
min:12.0840 avg:13.3343 max:21.0720 dev:1.9482 loss:0.0000

/var/www/html/cacti/scripts/ss_fping.php ss_fping google.com 20 ICMP
min:12.1260 avg:21.7061 max:48.8400 dev:8.8968 loss:5.0000

[[/var/www/html/cacti/scripts/ss_fping.php ss_fping google.com 20 ICMP
min:11.9010 avg:13.1152 max:16.6640 dev:1.0337 loss:0.0000

exit
Voiper99
Cacti User
Posts: 276
Joined: Thu Mar 01, 2007 5:43 pm
Location: Melbourne, Australia

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

Post by Voiper99 »

Just an FYI for anyone else who is interested, to get Advanced Ping working in 8.8 all you need to do is update your global_arrays.php file using a copy from the SVN as explained here.

Then you need to download the cacti_graph_template_ping_advanced_ping_v2_2.xml file from here and import it, and your done.

Note: You do not need to download the ss_fping.zip file as all required files are already in Cacti 8.8

Having said the above though, I am getting very different results from it than I do my own "advanced ping" implementation and the default ping template provided by Cacti. See below.

Any ideas why I'm seeing such a big difference?
Attachments
Advanced Ping 2.0 template.
Advanced Ping 2.0 template.
advanced.png (27.42 KiB) Viewed 16149 times
Default ping template provided by Cacti.
Default ping template provided by Cacti.
default.png (19.41 KiB) Viewed 16149 times
My own &quot;Advanced Ping&quot; template, created using <br /><br />&lt;path_cacti&gt;/scripts/ss_fping.php ss_fping &lt;ip&gt; 20 ICMP
My own "Advanced Ping" template, created using

<path_cacti>/scripts/ss_fping.php ss_fping <ip> 20 ICMP
mine.png (37.51 KiB) Viewed 16149 times
DwayneDibbley
Posts: 22
Joined: Tue Aug 30, 2011 12:43 pm

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

Post by DwayneDibbley »

Voiper99 wrote:Just an FYI for anyone else who is interested, to get Advanced Ping working in 8.8 all you need to do is update your global_arrays.php file using a copy from the SVN as explained here.

Then you need to download the cacti_graph_template_ping_advanced_ping_v2_2.xml file from here and import it, and your done.

Note: You do not need to download the ss_fping.zip file as all required files are already in Cacti 8.8

Having said the above though, I am getting very different results from it than I do my own "advanced ping" implementation and the default ping template provided by Cacti. See below.

Any ideas why I'm seeing such a big difference?
i was getting the same packet loss as the top graph when i moved from 8.7d to 8.7i, to reduce the ping loss i replaced the ping.php from the 8.7d and now loss are OK again.

So something must be dirrerent with the later ping.php

Thanks
Voiper99
Cacti User
Posts: 276
Joined: Thu Mar 01, 2007 5:43 pm
Location: Melbourne, Australia

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

Post by Voiper99 »

Thank you for the reply, I really appreciate it.

However, I believe there may not be anything wrong with the script. By the looks of things, it must be my (cheap) VPS server dropping packets. The reason why I say this is because I installed Cacti 8.8 on another server with a better internet connection and its Advanced Ping graph looks perfect.
DwayneDibbley
Posts: 22
Joined: Tue Aug 30, 2011 12:43 pm

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

Post by DwayneDibbley »

showing the packet loss with 20 ICMP when running ping.php from 8.7i on the left of the graph and ping.php 8.7d with almost zero loss on the right. Also CPU load halfed on the server when replacing the ping.php
packet loss
packet loss
ping.JPG (40 KiB) Viewed 16057 times
scsa
Posts: 1
Joined: Thu Jul 05, 2012 6:00 am

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

Post by scsa »

I tore my hair out over this template today, so I thought I might post my problem & solution in case anyone else has the same.

I set up this template to monitor TCP port 80 on a server, and everything worked great. I set up a threshold alert for packet loss, and then stopped the HTTP service to make sure it worked.

The graph kept ticking over like the service was running fine, no threshold alert triggered, like the port was still up and responding.

After a lot of WTF, I traced this back to Cacti's <cacti_folder>/lib/ping.php script, which this template uses. It turns out ping.php considered getting a "Connection Refused" response from the target device a "successful" TCP Ping. Only a timeout is considered a failure.

I suppose I can understand that in some way, it means something responded to the TCP connection, but it could be a firewall or router between Cacti and the target server configured to respond with refusals instead of timeouts. The TCP port definitely isn't connectable, if that's what you're trying to monitor.

Anyway, I changed ping.php to return false for that case. From line 471:

Code: Select all

switch(socket_select($r = array($this->socket), $w = array($this->socket), $f = array($this->socket), $to_sec, $to_usec)){
	case 2:
		/* connection refused */
		$this->time = $this->get_time($this->precision);

		if (($this->time*1000) <= $this->timeout) {
		$this->ping_response = "TCP Ping connection refused (" . $this->time*1000 . " ms)";
		$this->ping_status   = $this->time*1000;
		}

		$this->close_socket();

		// return true; /* "connection refused" says: host is alive (else ping would time out) */
		return false; /* Actually, no, it doesn't */
	case 1:
Maybe this should be a configurable option under Poller-> Host Availability Settings? Either way, I now see lovely red bars on the graph for my test server. :)
rlilic
Posts: 16
Joined: Mon Jan 30, 2012 3:59 pm

Re: Re:

Post by rlilic »

BSOD2600 wrote:
yreddy wrote:Hi,

I've made an alternate version of the Advanced Ping template with the following changes:
- y axis displays seconds instead of milliseconds
- Packet loss displayed as a normal line and not a full vertical bar (except for 100% packet loss)
You sure the packet loss works properly with your version? For example in this attached file, it was down in the gap yet nothing to visually indicate the loss.
cacti_advancedping_alt.png
HI,

Can someone tell me how to figure out jitter loss from this graph. Thank you.
hmorandell
Cacti User
Posts: 73
Joined: Mon May 03, 2010 11:48 am

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

Post by hmorandell »

Hi,

I had about 200 host where i Used a perl based smokeping template. Unfortunatelly I installed ADVANCED PING and messed everything up.
I try to stick with ADVANCED PING TEMPLATE but I only added 3 smokeping graphs and the runtime of my spine increased drammatically.

I did some tests and found out thsat the PHP SCRIPT needs lot MORE time then the per script. Do you think this is normal?!?!? Anyone has a clue?
php script:

Code: Select all

hdtest:/srv/www/htdocs/cacti/scripts # time php ss_fping.php 8.8.8.8
min:15.4550 avg:15.8160 max:16.1300 dev:0.2385 loss:0.0000
real    0m2.076s
user    0m0.472s
sys     0m0.172s
and the perl script:

Code: Select all

hdtest:/srv/www/htdocs/cacti/scripts # time perl ping-latency.pl 8.8.8.8
min:15.467 avg:15.791 max:16.185 dev:0.243 loss:0

real    0m1.765s
user    0m0.008s
sys     0m0.008s
I like the created graph from this template more so I would like to get this sorted out...
_________________
Cacti - 1.2.14
Poller Type - SPINE 1.2.14
Devices 3,892
Graphs 21,483
mf1
Posts: 1
Joined: Fri Sep 21, 2012 6:30 am

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

Post by mf1 »

Hi
Can anyone help me with one thing, i need to monitor remote host with 1500b packet size.
Adv. ping have only:
host
attempts
proto
port
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 »

Hello,

I'm trying to use cacti (0.8.8a) on a synology Webstation (DS410j). After few adjustement, mostly working.
One problem with advanced ping is default ping on ipkg/synology is busybox ping which seems to miss all needed options by advanced ping.
Possible alternative seems to be hping (available in ipkg)

[code]
> ping
BusyBox v1.16.1 (2012-08-30 00:05:10 CST) multi-call binary.

Usage: ping [OPTIONS] HOST

Send ICMP ECHO_REQUEST packets to network hosts

Options:
-4, -6 Force IP or IPv6 name resolution
-c CNT Send only CNT pings
-s SIZE Send SIZE data bytes in packets (default:56)
-I IFACE/IP Use interface or IP address as source
-W SEC Seconds to wait for the first response (default:10)
(after all -c CNT packets are sent)
-w SEC Seconds until ping exits (default:infinite)
(can exit earlier with -c CNT)
-q Quiet, only displays output at start
and when finished
[/code]

Any plan to offer hping as an alternative ?

in lib/ping.php, it seems mostly used options are -m, -t, -w, -W, -c, -n
hping3 does not seem to have an equivalent for mark/-m,
unchanged: -t/TTL, -c/count, -n/numeric
-w/-W would be -i/wait interval, no deadline

Thanks.

[EDIT] solved here http://forums.cacti.net/viewtopic.php?f ... 21#p238521; use command "/opt/sbin/hping3 -1 -q -c " . $this->retries . " " . $this->host["hostname"]." 2>&1" with hping3 from ipkg.
Last edited by raiten on Sun Jan 27, 2013 11:47 am, edited 1 time in total.
ukzerosniper
Cacti User
Posts: 118
Joined: Wed Oct 03, 2012 5:51 pm

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

Post by ukzerosniper »

Hi Guys,

I have a Cacti setup as follows.

Cacti Version 0.8.8a
Cacti OS Cent OS 64bit
SNMP Version[/b NET-SNMP version: 5.5
RRDTool Version RRDTool 1.3.x
Hosts 86
Graphs 581
Data Sources Script/Command: 13
SNMP: 55
SNMP Query: 724
Script Query: 7
Script - Script Server (PHP): 9
Script Query - Script Server: 11
Total: 819

Poller Information
Interval 60
Type SPINE 0.8.8 Copyright 2002-2012 by The Cacti Group
Items Action[0]: 1167
Action[2]: 38
Total: 1205
Concurrent Processes 1
Max Threads 1
PHP Servers 1
Script Timeout 25
Max OID 10
Last Run Statistics Time:19.5633 Method:spine Processes:1 Threads:1 Hosts:79 HostsPerProcess:79 DataSources:1201 RRDsProcessed: 613

PHP Information
PHP Version 5.3.3
PHP OS Linux
PHP uname Linux localhost.localdomain 2.6.32-279.19.1.el6.x86_64 #1 SMP Wed Dec 19 07:05:20 UTC 2012 x86_64
PHP SNMP Installed
max_execution_time 30
memory_limit 768M

I have installed Version 2_2 of the template and overwritten the default ss_fping with the one available but still cannot get the graphs to create correctly.

They appear just without any information on them.

Additionally. When I tried this, an error appeared in the log.

"01/12/2013 11:11:23 AM - SPINE: Poller[0] ERROR: SS[0] PHP Script Server communications lost. Restarting PHP Script Server"

I dont know if this is related, or if it is simple coincidence that this occurred at the same time.

If anyone could provide any assistance I would be really grateful.

Thanks.
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests