100% loss with Advanced Ping 1.3

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

Moderators: Developers, Moderators

User avatar
Selenius
Posts: 27
Joined: Mon Jun 29, 2009 5:21 am

100% loss with Advanced Ping 1.3

Post by Selenius »

Hello!

OS:

Code: Select all

[www@minbar /usr/home/selen]$ uname -a
FreeBSD minbar 7.2-RELEASE-p3 FreeBSD 7.2-RELEASE-p3 #0: Mon Sep 21 18:01:15 NOVST 2009     root@minbar:/usr/obj/usr/src/sys/GENERIC  amd64
Cacti: 0.8.7g.

I had got 100% packet loss on a graph.

When I had tried to test it from command line from www-user, I saw next:

Code: Select all

[www@minbar /usr/home/selen]$ php /usr/local/share/cacti/scripts/ss_fping.php ss_fping a9424-srv-1 20 ICMP
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20090626/pcre.so' - Cannot open "/usr/local/lib/php/20090626/pcre.so" in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20090626/spl.so' - Cannot open "/usr/local/lib/php/20090626/spl.so" in Unknown on line 0
PHP Warning:  Module 'mysql' already loaded in Unknown on line 0
PHP Warning:  Module 'snmp' already loaded in Unknown on line 0
PHP Warning:  Module 'xml' already loaded in Unknown on line 0
loss:100.00

[www@minbar /usr/home/selen]$ nslookup a9424-srv-1
Server:         10.10.247.30
Address:        10.10.247.30#53

Name:   a9424-srv-1
Address: 10.100.3.1

[www@minbar /usr/home/selen]$ php /usr/local/share/cacti/scripts/ss_fping.php ss_fping 10.100.3.1 20 ICMP
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20090626/pcre.so' - Cannot open "/usr/local/lib/php/20090626/pcre.so" in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20090626/spl.so' - Cannot open "/usr/local/lib/php/20090626/spl.so" in Unknown on line 0
PHP Warning:  Module 'mysql' already loaded in Unknown on line 0
PHP Warning:  Module 'snmp' already loaded in Unknown on line 0
PHP Warning:  Module 'xml' already loaded in Unknown on line 0
PHP Notice:  Undefined variable: method in /usr/local/share/cacti/scripts/ss_fping.php on line 56
PHP Notice:  Undefined variable: method in /usr/local/share/cacti/scripts/ss_fping.php on line 56
PHP Notice:  Undefined variable: method in /usr/local/share/cacti/scripts/ss_fping.php on line 56
PHP Notice:  Undefined variable: method in /usr/local/share/cacti/scripts/ss_fping.php on line 56
PHP Notice:  Undefined variable: method in /usr/local/share/cacti/scripts/ss_fping.php on line 56
PHP Notice:  Undefined variable: method in /usr/local/share/cacti/scripts/ss_fping.php on line 56
PHP Notice:  Undefined variable: method in /usr/local/share/cacti/scripts/ss_fping.php on line 56
PHP Notice:  Undefined variable: method in /usr/local/share/cacti/scripts/ss_fping.php on line 56
PHP Notice:  Undefined variable: method in /usr/local/share/cacti/scripts/ss_fping.php on line 56
PHP Notice:  Undefined variable: method in /usr/local/share/cacti/scripts/ss_fping.php on line 56
PHP Notice:  Undefined variable: method in /usr/local/share/cacti/scripts/ss_fping.php on line 56
PHP Warning:  Division by zero in /usr/local/share/cacti/scripts/ss_fping.php on line 93
min:9999.9900 avg:0.0000 max:0.0000 dev:0.0000 loss:108.9109


[www@minbar /usr/home/selen]$ ping a9424-srv-1
PING a9424-srv-1.skolkovo.rutube.ru (10.100.3.1): 56 data bytes
64 bytes from 10.100.3.1: icmp_seq=0 ttl=124 time=3.315 ms
64 bytes from 10.100.3.1: icmp_seq=1 ttl=124 time=3.364 ms
64 bytes from 10.100.3.1: icmp_seq=2 ttl=124 time=141.880 ms
64 bytes from 10.100.3.1: icmp_seq=3 ttl=124 time=3.326 ms
^C
--- a9424-srv-1 ping statistics ---
4 packets transmitted, 4 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 3.315/37.971/141.880/59.992 ms
Thanks in advance!
Last edited by Selenius on Tue Sep 14, 2010 4:55 am, edited 1 time in total.
User avatar
Selenius
Posts: 27
Joined: Mon Jun 29, 2009 5:21 am

Post by Selenius »

Doesn't anybody have an idea? :(
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Fix these issues first:
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20090626/pcre.so' - Cannot open "/usr/local/lib/php/20090626/pcre.so" in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20090626/spl.so' - Cannot open "/usr/local/lib/php/20090626/spl.so" in Unknown on line 0
PHP Warning: Module 'mysql' already loaded in Unknown on line 0
PHP Warning: Module 'snmp' already loaded in Unknown on line 0
PHP Warning: Module 'xml' already loaded in Unknown on line 0
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
Selenius
Posts: 27
Joined: Mon Jun 29, 2009 5:21 am

Post by Selenius »

TheWitness wrote:Fix these issues first:
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20090626/pcre.so' - Cannot open "/usr/local/lib/php/20090626/pcre.so" in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20090626/spl.so' - Cannot open "/usr/local/lib/php/20090626/spl.so" in Unknown on line 0
PHP Warning: Module 'mysql' already loaded in Unknown on line 0
PHP Warning: Module 'snmp' already loaded in Unknown on line 0
PHP Warning: Module 'xml' already loaded in Unknown on line 0
Fixed. :D

Code: Select all

[www@minbar /usr/home/selen]$ php /usr/local/share/cacti/scripts/ss_fping.php ss_fping 10.100.3.1 20 ICMP
PHP Notice:  Undefined variable: method in /usr/local/share/cacti/scripts/ss_fping.php on line 56
PHP Notice:  Undefined variable: method in /usr/local/share/cacti/scripts/ss_fping.php on line 56
PHP Notice:  Undefined variable: method in /usr/local/share/cacti/scripts/ss_fping.php on line 56
PHP Notice:  Undefined variable: method in /usr/local/share/cacti/scripts/ss_fping.php on line 56
PHP Notice:  Undefined variable: method in /usr/local/share/cacti/scripts/ss_fping.php on line 56
PHP Notice:  Undefined variable: method in /usr/local/share/cacti/scripts/ss_fping.php on line 56
PHP Notice:  Undefined variable: method in /usr/local/share/cacti/scripts/ss_fping.php on line 56
PHP Notice:  Undefined variable: method in /usr/local/share/cacti/scripts/ss_fping.php on line 56
PHP Notice:  Undefined variable: method in /usr/local/share/cacti/scripts/ss_fping.php on line 56
PHP Notice:  Undefined variable: method in /usr/local/share/cacti/scripts/ss_fping.php on line 56
PHP Notice:  Undefined variable: method in /usr/local/share/cacti/scripts/ss_fping.php on line 56
PHP Warning:  Division by zero in /usr/local/share/cacti/scripts/ss_fping.php on line 93
min:9999.9900 avg:0.0000 max:0.0000 dev:0.0000 loss:108.9109

[www@minbar /usr/home/selen]$ php /usr/local/share/cacti/scripts/ss_fping.php ss_fping a9424-srv-1 20 ICMP
loss:100.00
jbarbieri
Cacti User
Posts: 101
Joined: Tue May 24, 2005 8:46 am
Location: Rochester, New Hampshire
Contact:

Post by jbarbieri »

Are you still getting 100% packet loss?

I noticed your CLI command is different then what works for me:

Code: Select all

php ss_fping.php 172.17.1.2 20 ICMP
min:2.8730 avg:4.0995 max:12.8630 dev:2.0321 loss:0.0000
User avatar
Selenius
Posts: 27
Joined: Mon Jun 29, 2009 5:21 am

Post by Selenius »

jbarbieri wrote:Are you still getting 100% packet loss?

I noticed your CLI command is different then what works for me:

Code: Select all

php ss_fping.php 172.17.1.2 20 ICMP
min:2.8730 avg:4.0995 max:12.8630 dev:2.0321 loss:0.0000
Yes.

Code: Select all

 [www@minbar /usr/local/share/cacti/scripts]$ php ss_fping.php ss_fping 10.100.3.1 20 ICMP
PHP Notice:  Undefined variable: method in /usr/local/share/cacti/scripts/ss_fping.php on line 56
PHP Notice:  Undefined variable: method in /usr/local/share/cacti/scripts/ss_fping.php on line 56
PHP Notice:  Undefined variable: method in /usr/local/share/cacti/scripts/ss_fping.php on line 56
PHP Notice:  Undefined variable: method in /usr/local/share/cacti/scripts/ss_fping.php on line 56
PHP Notice:  Undefined variable: method in /usr/local/share/cacti/scripts/ss_fping.php on line 56
PHP Notice:  Undefined variable: method in /usr/local/share/cacti/scripts/ss_fping.php on line 56
PHP Notice:  Undefined variable: method in /usr/local/share/cacti/scripts/ss_fping.php on line 56
PHP Notice:  Undefined variable: method in /usr/local/share/cacti/scripts/ss_fping.php on line 56
PHP Notice:  Undefined variable: method in /usr/local/share/cacti/scripts/ss_fping.php on line 56
PHP Notice:  Undefined variable: method in /usr/local/share/cacti/scripts/ss_fping.php on line 56
PHP Notice:  Undefined variable: method in /usr/local/share/cacti/scripts/ss_fping.php on line 56
PHP Warning:  Division by zero in /usr/local/share/cacti/scripts/ss_fping.php on line 93
min:9999.9900 avg:0.0000 max:0.0000 dev:0.0000 loss:108.9109
I get CLI command from Cacti Interface.
jbarbieri
Cacti User
Posts: 101
Joined: Tue May 24, 2005 8:46 am
Location: Rochester, New Hampshire
Contact:

Post by jbarbieri »

I get that error when I have ss_fping AFTER ss_fping.php


try taking the second ss_fping out.
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

The second ss_fping is required for use with SCRIPT SERVER only!
R.
User avatar
Selenius
Posts: 27
Joined: Mon Jun 29, 2009 5:21 am

Post by Selenius »

gandalf wrote:The second ss_fping is required for use with SCRIPT SERVER only!
R.
Hello!

You are right, I get this command from poller logs (input type of APing is Script Server):

Code: Select all

A9424-SRV-1 - Advanced Ping   	 Script Server: /usr/local/share/cacti/scripts/ss_fping.php ss_fping a9424-srv-1 20 ICMP
	RRD: /usr/local/share/cacti/rra/4/50.rrd 
And if I delete second ss_fping from command line, it works fine. But on my graphs APing draws 100% loss. :(
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Run the script server in debug mode and see what's going on with the host. Also, it could be that since you are using ICMP that the new detection logic for the ping command is broken in lib/ping.php. Based upon your OS, it will attempt to properly detect your OS' ping syntax. It may be getting it wrong.

However, first test using the Script Server debug method outlined in the documentation and post your results.

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
Selenius
Posts: 27
Joined: Mon Jun 29, 2009 5:21 am

Post by Selenius »

TheWitness wrote:Run the script server in debug mode and see what's going on with the host. Also, it could be that since you are using ICMP that the new detection logic for the ping command is broken in lib/ping.php. Based upon your OS, it will attempt to properly detect your OS' ping syntax. It may be getting it wrong.

However, first test using the Script Server debug method outlined in the documentation and post your results.

TheWitness
Thank you for help!

I used this article:
http://docs.cacti.net/manual:087:3a_adv ... ipt_server

It works:

Code: Select all

[www@minbar /usr/local/share/cacti]$ php /usr/local/share/cacti/script_server.php
PHP Script Server has Started - Parent is cmd
/usr/local/share/cacti/scripts/ss_fping.php ss_fping 10.100.3.1 20 ICMP
min:2.7300 avg:5.9000 max:57.0900 dev:11.7460 loss:0.0000
/usr/local/share/cacti/scripts/ss_fping.php ss_fping a9424-srv-1 20 ICMP
min:2.5780 avg:3.2000 max:3.3350 dev:0.2191 loss:0.0000
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Post the ss_fping.php that you are having issue with.

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
Selenius
Posts: 27
Joined: Mon Jun 29, 2009 5:21 am

Post by Selenius »

Here it is.
Attachments
ss_fping.zip
(1.13 KiB) Downloaded 204 times
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Somehow you are not calling this correctly in your script here is what is being done:

Code: Select all

/usr/local/share/cacti/scripts]$ php ss_fping.php ss_fping 10.100.3.1 20 ICMP 
That is not correct. When not calling from the script server, you have to remove the function name. Here is the correct 'I'm calling it from the CLI syntax for that same call.

Code: Select all

/usr/local/share/cacti/scripts]$ php ss_fping.php 10.100.3.1 20 ICMP 
Notice the subtle difference.

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
Selenius
Posts: 27
Joined: Mon Jun 29, 2009 5:21 am

Post by Selenius »

TheWitness wrote:Somehow you are not calling this correctly in your script here is what is being done:

Code: Select all

/usr/local/share/cacti/scripts]$ php ss_fping.php ss_fping 10.100.3.1 20 ICMP 
That is not correct. When not calling from the script server, you have to remove the function name. Here is the correct 'I'm calling it from the CLI syntax for that same call.

Code: Select all

/usr/local/share/cacti/scripts]$ php ss_fping.php 10.100.3.1 20 ICMP 
Notice the subtle difference.

TheWitness
Ok, I understood it. But Cacti is calling ss_fping from the script server, isn't it?
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests