EDIT: Advanced Ping Template Version 1.3 for Cacti 0.8.6g

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

Moderators: Moderators, Developers

Post Reply
Author
Message
hardydrew
Posts: 2
Joined: Fri Feb 23, 2007 5:44 am

advanced ping for slow hosts

#256 Post by hardydrew » Fri Feb 23, 2007 5:46 am

Anything I can do for slow hosts on the other side of the planet? The graph comes back all red as the latency is over 100ms?

min:304.6700 avg:305.7500 max:308.8100 dev:1.4193 loss:0.0000

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

#257 Post by TheWitness » Fri Feb 23, 2007 6:54 am

Increase your ping timeout under Setting->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 MacTrack, Boost, CLog, SpikeKill, Platform RTM, DSStats, maintainer of Spine, lot's of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Central Plugin Repository
Central Templates Repository


I'm still out there people. Getting excited for Cacti 1.2. I think it will be a great release.

hardydrew
Posts: 2
Joined: Fri Feb 23, 2007 5:44 am

#258 Post by hardydrew » Fri Feb 23, 2007 7:11 am

ok I didnt realise adv ping reads that value. Do I also need to change ping type from snmp then?

airwalk
Cacti User
Posts: 103
Joined: Fri Aug 18, 2006 11:22 am
Location: MSK, RU

#259 Post by airwalk » Mon Feb 26, 2007 8:23 am

Has anyone out there an idea of what's wrong in here. I've got a number of devices which are monitored using the script. Some of them have good graphs and some of the are not. Like on the screenshot. All devices have equal settings - ICMP, 20 times. If I try to recreate graphs for both hosts the problem persist.
I just have no idea on where to dig. Here's a debug log from failing graph - looks good.

02/26/2007 01:11:05 PM - POLLER: Poller[0] CACTI2RRD: c:/rrdtool/rrdtool.exe update C:\Inetpub\wwwroot\cacti\rra\wan_bishkek_loss_70.rrd --template min:avg:max:dev:loss 1172484651:510.0500:561.3825:617.8700:22.9727:0.0000
02/26/2007 01:11:05 PM - CMDPHP: Poller[0] DEBUG: SQL Exec: "delete from poller_output where local_data_id='70' and rrd_name='' and time='2007-02-26 13:10:51'"
02/26/2007 01:11:05 PM - POLLER: Poller[0] Parsed MULTI output field 'loss:0.0000' [map loss->loss]
02/26/2007 01:11:05 PM - POLLER: Poller[0] Parsed MULTI output field 'dev:22.9727' [map dev->dev]
02/26/2007 01:11:05 PM - POLLER: Poller[0] Parsed MULTI output field 'max:617.8700' [map max->max]
02/26/2007 01:11:05 PM - POLLER: Poller[0] Parsed MULTI output field 'avg:561.3825' [map avg->avg]
02/26/2007 01:11:05 PM - POLLER: Poller[0] Parsed MULTI output field 'min:510.0500' [map min->min]
02/26/2007 01:11:05 PM - CMDPHP: Poller[0] DEBUG: SQL Assoc: "select data_template_rrd.data_source_name, data_input_fields.data_name from (data_template_rrd,data_input_fields) where data_template_rrd.data_input_field_id=data_input_fields.id and data_template_rrd.local_data_id=70"
02/26/2007 01:11:05 PM - CMDPHP: Poller[0] DEBUG: SQL Assoc: "select poller_output.output, poller_output.time, poller_output.local_data_id, poller_item.rrd_path, poller_item.rrd_name, poller_item.rrd_num from (poller_output,poller_item) where (poller_output.local_data_id=poller_item.local_data_id and poller_output.rrd_name=poller_item.rrd_name) LIMIT 10000"
02/26/2007 01:11:05 PM - CMDPHP: Poller[0] DEBUG: SQL Exec: "insert into poller_output (local_data_id, rrd_name, time, output) values (70, '', '2007-02-26 13:10:51', 'min:510.0500 avg:561.3825 max:617.8700 dev:22.9727 loss:0.0000')"
02/26/2007 01:11:05 PM - CMDPHP: Poller[0] DEBUG: SQL Assoc: "select poller_id,end_time from poller_time where poller_id = 0"
02/26/2007 01:11:05 PM - CMDPHP: Poller[0] Host[9] DS[70] SERVER: C:/Inetpub/wwwroot/cacti/scripts/ss_fping.php ss_fping 10.163.156.254 20 ICMP , output: min:510.0500 avg:561.3825 max:617.8700 dev:22.9727 loss:0.0000
Attachments
graph_image.php.png
graph_image.php.png (26.15 KiB) Viewed 10874 times

KARLOS
Posts: 19
Joined: Thu Jan 20, 2005 7:31 am

Any doubts

#260 Post by KARLOS » Wed Mar 28, 2007 9:43 am

Hi,

I have installed the plugin in 0.8.6j version. It run well.
When the device is down or disconnected, in the graph appear like 'Unknown'.
This is correct? or it must appear 'PKt Loss 96-100%'.
What is the meaning of 'Unknown'?

Thks to all

schef4711
Posts: 19
Joined: Tue Jul 12, 2005 1:49 pm
Location: Argentina
Contact:

Re: Any doubts

#261 Post by schef4711 » Tue Apr 03, 2007 3:20 pm

KARLOS wrote:Hi,

I have installed the plugin in 0.8.6j version. It run well.
When the device is down or disconnected, in the graph appear like 'Unknown'.
This is correct? or it must appear 'PKt Loss 96-100%'.
What is the meaning of 'Unknown'?

Thks to all
I get the same problem that I don't see nothing when the device is down instead of a red line.

thx alex

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

#262 Post by TheWitness » Thu Apr 05, 2007 3:41 am

I hope to correct this in the next point release. It's basically due to the fact that Cacti is "pinging" before the actual attempts to run any polling and if the device is down, I don't poll it.

Therefore, I am adding the requisite information into the hosts table in the next release and when I do my precheck, I will add all the information that Advance Ping needs to graph.

Once that is done, I will update this template to provide a new function to grab the required information. You will get RED then.

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of MacTrack, Boost, CLog, SpikeKill, Platform RTM, DSStats, maintainer of Spine, lot's of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Central Plugin Repository
Central Templates Repository


I'm still out there people. Getting excited for Cacti 1.2. I think it will be a great release.

User avatar
slen6969
Posts: 3
Joined: Wed Apr 11, 2007 2:56 pm

Using Advanced Ping Against Non SNMP Device

#263 Post by slen6969 » Thu Apr 26, 2007 2:03 pm

I have setup and I am using Advanced Ping on a whole series of SNMP enabled devices and it works like a charm, but I am wondering if it is possible to use this tool against non-SNMP enabled devices? I created the device where I get a "SNMP Information; SNMP error", obviously because this is not a SNMP enabled device, but when I try and create the graph I am getting no love.

Does Advanced Ping require that SNMP be enabled on all remote devices?

Am I simply being daft, or am I missing something?

Also a huge kudos for the work and development on this tool.

Cheers

donc
Posts: 13
Joined: Wed Oct 25, 2006 2:45 pm

#264 Post by donc » Thu May 10, 2007 9:46 am

Is it possible to ping multiple interfaces on a device? For instance, I have a couple of multi-homed Asterisk PBXs over in Germany and I'd like to be able to ping their outside interfaces (which connect into the local POTS) as well as the internal interfaces which we use to talk to them over SIP and gather SNMP stats.

schef4711
Posts: 19
Joined: Tue Jul 12, 2005 1:49 pm
Location: Argentina
Contact:

#265 Post by schef4711 » Tue May 15, 2007 4:56 pm

TheWitness wrote:I hope to correct this in the next point release.
TheWitness
Is there a new point release in sight for the RED problem ??

thx alex

wtb1
Posts: 47
Joined: Thu May 03, 2007 8:11 am

Problem with Advanced Ping

#266 Post by wtb1 » Thu May 24, 2007 1:33 pm

I have the current version installed. I am not getting any data back. From a debug log file I see:

05/24/2007 01:27:41 PM - PHPSVR: Poller[0] DEBUG: INC: 'c:/xampp/htdocs/cacti/scripts/ss_fping.php' FUNC: '' PARMS: ''
05/24/2007 01:27:41 PM - PHPSVR: Poller[0] WARNING: Function does not exist
05/24/2007 01:27:41 PM - CMDPHP: Poller[0] Host[3] DS[1384] WARNING: Result from SERVER not valid. Partial Result: WARNING: Function do
05/24/2007 01:27:41 PM - CMDPHP: Poller[0] Host[3] DS[1384] SERVER: c:/xampp/htdocs/cacti/scripts/ss_fping.php, output: U

But if I run php c:/xampp/htdocs/cacti/scripts/ss_fping.php <host> 5 icmp I get valid numbers back..

Mika2006
Cacti User
Posts: 165
Joined: Thu May 03, 2007 2:25 am

#267 Post by Mika2006 » Wed May 30, 2007 2:59 am

i try to debug :
Please debug the script server from the command line:

a) Start the Script Server

cd <cacti_root>
php script_server

b) Obtain the script line from the poller cache

System Utilities->View Poller Cache
Search for "Action: 2" that contains the ss_fping.php line
[email protected] cacti]# php /var/www/html/cacti/scripts/ss_fping.php ss_fping 192.168.0.5 20 ICMP
PHP Notice: Undefined variable: method in /var/www/html/cacti/scripts/ss_fping.php on line 61
PHP Warning: socket_connect() expects parameter 3 to be long, string given in /var/www/html/cacti/lib/ping.php on line 356
PHP Warning: socket_write() unable to write to socket [89]: Destination address required in /var/www/html/cacti/lib/ping.php on line 379
PHP Notice: Undefined variable: method in /var/www/html/cacti/scripts/ss_fping.php on line 61
PHP Warning: socket_connect() expects parameter 3 to be long, string given in /var/www/html/cacti/lib/ping.php on line 356
PHP Warning: socket_write() unable to write to socket [89]: Destination address required in /var/www/html/cacti/lib/ping.php on line 379
c) Run from the script server

Paste the entire line ending in "TCP 80" into the script server window and hit <CR>
[[email protected] cacti]# php /var/www/html/cacti/scripts/ss_fping.php ss_fping 192.168.0.5 TCP 80
Content-type: text/html
X-Powered-By: PHP/4.3.9

loss:100.00[[email protected] cacti]# php /var/www/html/cacti/scripts/ss_fping.php ss_fping 192.168.0.5 80 TCP
PHP Notice: Undefined variable: method in /var/www/html/cacti/scripts/ss_fping.php on line 61
PHP Warning: socket_connect() expects parameter 3 to be long, string given in /var/www/html/cacti/lib/ping.php on line 356
PHP Warning: socket_write() unable to write to socket [89]: Destination address required in /var/www/html/cacti/lib/ping.php on line 379
PHP Notice: Undefined variable: method in /var/www/html/cacti/scripts/ss_fping.php on line 61
PHP Warning: socket_connect() expects parameter 3 to be long, string given in /var/www/html/cacti/lib/ping.php on line 356
PHP Warning: socket_write() unable to write to socket [89]: Destination address required in /var/www/html/cacti/lib/ping.php on line 379
d) Quit the script server

quit <CR>

someon can explain me what is wrong please?
thanks to
|Cacti Version - 0.8.6j||Plugin Architecture - 1.1||Poller Type - CMD.php|
|os - Red hat 4es | |Web Server - Apache/2.0.52 (Red Hat)|
|PHP - 4.3.9| |MySQL - 4.1.20| |RRDTool - 1.2.13||SNMP - 5.1.2|
|Plugins| Host Info (hostinfo - v0.1)

[email protected]
Posts: 1
Joined: Wed May 30, 2007 12:17 pm

OSX/Unix Advanced Ping issues. ss_fping

#268 Post by [email protected] » Wed May 30, 2007 12:36 pm

In scriptserver either run via sudo or not:

a) TCP 80 ping works fine
b) ICMP and UDP 53 doesn't work and generates 100% packet loss

cactiuser has been added to sudoers but not really helpful without dropping sudo in somewhere -> though cactiuser not asked for password in sudoers file etc. I think it's the parent scripts privileges that are inherited?

Is this a socket issue again and what would be the fastest way to remedy?

Also: ping.pl is working now and again.. mostly not for standard unix host ping. This is intermittent and may be more a blocking and FOPEN issue?

Poller is running in root's crontab.

Mac OS X 10.4.9 (8P2137)
Server version: Apache/1.3.33 (Darwin)
PHP 5.2.2 (cli) (built: May 30 2007 03:14:09)
Cacti 0.8.6j ( from darwinports )

I also tweaked ping.pl a bit....

Code: Select all

#!/usr/bin/perl 

open(PROCESS, "ping -D -c 1 -n -Q -z 184 $ARGV[0] | grep icmp_seq |");
$ping = <PROCESS>; 

$ping =~ m/(.*time=)(.*) (ms|usec)/;
close(PROCESS);
print $2;
exit;
Am using cmd.php and not cactid.. maybe I shoould try cactid poller again?

Any thoughts guys?

Code: Select all

php /opt/local/share/cacti/scripts/ss_fping.php www.cymru.com 2 ICMP
PHP Warning:  socket_create(): Unable to create socket [1]: Operation not permitted in /opt/local/share/cacti/lib/ping.php on line 150
PHP Warning:  socket_set_block() expects parameter 1 to be resource, boolean given in /opt/local/share/cacti/lib/ping.php on line 152
PHP Warning:  socket_create(): Unable to create socket [1]: Operation not permitted in /opt/local/share/cacti/lib/ping.php on line 150
PHP Warning:  socket_set_block() expects parameter 1 to be resource, boolean given in /opt/local/share/cacti/lib/ping.php on line 152

sudo php /opt/local/share/cacti/scripts/ss_fping.php www.cymru.com 2 ICMP
min:210.0300 avg:210.0300 max:210.0300 dev:0.0000 loss:50.0000

php /opt/local/share/cacti/scripts/ss_fping.php www.cymru.com 2 TCP 80
min:210.7500 avg:235.2050 max:259.6600 dev:24.4550 loss:0.0000

id uid=503(cacti) gid=503(cacti) groups=503(cacti), 81(appserveradm), 79(appserverusr), 80(admin)
Is is possible for ping.php to su itself?


AM A MUPPETITTO. ALSO IF SOMEONE COULD EDIT MY USERNAME AS I USED A FULL EMAIL ADDRESS ACCIDENTALLY IN A RUSH. ITS A THROW AWAY ACCOUNT BUT MAYBE YOU GUYS COULD EDIT DOWN TO THE USERID ONLY? TKS.

Mika2006
Cacti User
Posts: 165
Joined: Thu May 03, 2007 2:25 am

#269 Post by Mika2006 » Mon Jun 04, 2007 2:48 pm

and i have no graph created with this plug can hel please?
when i lunch ss_fping i have this
can help me please:
[[email protected] scripts]# php ss_fping.php
Content-type: text/html
X-Powered-By: PHP/4.3.9

<br />
<b>Fatal error</b>: Cannot instantiate non-existent class: net_ping in <b>/mnt/150/sda/0/6/ychouchane/cacti/Template/fping/ss_fping.php</b> on line <b>25</b><br />
Attachments
pingooooo.JPG
No grpah why???
pingooooo.JPG (38.32 KiB) Viewed 9039 times
|Cacti Version - 0.8.6j||Plugin Architecture - 1.1||Poller Type - CMD.php|
|os - Red hat 4es | |Web Server - Apache/2.0.52 (Red Hat)|
|PHP - 4.3.9| |MySQL - 4.1.20| |RRDTool - 1.2.13||SNMP - 5.1.2|
|Plugins| Host Info (hostinfo - v0.1)

Ecard
Posts: 1
Joined: Thu Jun 07, 2007 2:44 am

#270 Post by Ecard » Thu Jun 07, 2007 2:59 am

a) TCP 80 ping works fine
b) ICMP and UDP 53 doesn't work and generates 100% packet loss
I have the same problem.
As root

Code: Select all

php /var/www/cacti/script_server.php
PHP Script Server has Started - Parent is cmd
/var/www/cacti/scripts/ss_fping.php ss_fping www.google.com
min:51.4300 avg:53.9317 max:55.0000 dev:1.2807 loss:0.0000
Under Cacti

Code: Select all

06/07/2007 11:55:10 AM - CMDPHP: Poller[0] Host[4] DS[64] SERVER: /var/www/cacti/scripts/ss_fping.php ss_fping www.google.com 20 ICMP , output: loss:100.00
But

Code: Select all

06/07/2007 11:55:09 AM - CMDPHP: Poller[0] Host[2] DS[63] SERVER: /var/www/cacti/scripts/ss_fping.php ss_fping www.google.com 20 TCP 80, output: min:6.8000 avg:14.9305 max:16.9500 dev:2.0806 loss:0.0000

Post Reply