[solved] ICMP Ping Error over Windows OS

Post support questions that relate to the Windows 2003/2000/XP operating systems.

Moderators: Developers, Moderators

Post Reply
juliop
Cacti User
Posts: 55
Joined: Fri Dec 11, 2009 7:40 am
Location: Argentina

[solved] ICMP Ping Error over Windows OS

Post by juliop »

Hi all.

I have installed cacti with BSOD Windows installation:

Cacti Version 0.8.8a
Cacti OS win32
SNMP Version NET-SNMP version: 5.5
RRDTool Version RRDTool 1.4.x

Poller Information
Interval 60
Type SPINE 0.8.8a Copyright 2002-2012 by The Cacti Group

PHP Information
PHP Version 5.3.17
PHP OS WINNT
PHP uname Windows NT MGMT-EDE-01 6.1 build 7601 (Windows 7 Business Edition Service Pack 1) i586
PHP SNMP Installed


My problem is when i try to ping a host with ICMP using Cacti Host Downed Device Detection or using Advanced Ping to get a graph, in both cases i only get data if i use UDP PORT 23 PING.

From what i saw in forum and support cacti pages this can be a problem of permission on spine poller, but i have windows admin rights so i dont know where to look.

This is what cacti.log show for a host configured with icmp:

SPINE: Poller[0] Host[74] TH[1] DS[1878] SS[0] SERVER: C:/Apache2/htdocs/cacti/scripts/ss_fping.php ss_fping XXXX.XXXX.XXXX.XXXX 5 ICMP , output: min:U avg:U max:U dev:U loss:100.00

And this with udp:

SPINE: Poller[0] Host[73] TH[1] DS[1867] SS[0] SERVER: C:/Apache2/htdocs/cacti/scripts/ss_fping.php ss_fping XXXX.XXXX.XXXX.XXXX 5 UDP 23, output: min:5.9200 avg:5.9200 max:5.9200



Hope someone can help!

Thanks in advance,

Julio
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Re: ICMP Ping Error over Windows OS

Post by BSOD2600 »

did you manually validate the script works?
cmd
php script_server.php
C:/Apache2/htdocs/cacti/scripts/ss_fping.php ss_fping XXXX.XXXX.XXXX.XXXX 5 ICMP

does this output data? If not, try running cmd with an administrator account and then try again.
juliop
Cacti User
Posts: 55
Joined: Fri Dec 11, 2009 7:40 am
Location: Argentina

Re: ICMP Ping Error over Windows OS

Post by juliop »

BSOD,

First, thanks in advance for the quick reply.

I did what you told me to do and here are the outputs for ICMP and UDP:

(CMD in admin or normal mode had the same result)


C:\Apache2\htdocs\cacti>php script_server.php
PHP Script Server has Started - Parent is cmd
C:/Apache2/htdocs/cacti/scripts/ss_fping.php ss_fping xxxxxxx 5 ICMP
min:U avg:U max:U dev:U loss:100.00


C:\Apache2\htdocs\cacti>php script_server.php
PHP Script Server has Started - Parent is cmd
C:/Apache2/htdocs/cacti/scripts/ss_fping.php ss_fping xxxxxxxx 5 UDP 23
min:1.6500 avg:14.2860 max:64.2100 dev:24.9622 loss:0.0000
Last edited by juliop on Thu Apr 04, 2013 12:51 pm, edited 1 time in total.
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Re: ICMP Ping Error over Windows OS

Post by BSOD2600 »

Are you certain the device responds to ICMP pings and/or a firewall isnt blocking ICMP?
juliop
Cacti User
Posts: 55
Joined: Fri Dec 11, 2009 7:40 am
Location: Argentina

Re: ICMP Ping Error over Windows OS

Post by juliop »

BSOD,

Yes im sure, this is the output for a ping request from cmd:


C:\>ping xxxx.xxxx.xxxx.xxxx

Haciendo ping a xxxx.xxxx.xxxx.xxxx con 32 bytes de datos:
Respuesta desde xxxx.xxxx.xxxx.xxxx: bytes=32 tiempo<1m TTL=63
Respuesta desde xxxx.xxxx.xxxx.xxxx: bytes=32 tiempo<1m TTL=63
Respuesta desde xxxx.xxxx.xxxx.xxxx: bytes=32 tiempo<1m TTL=63
Respuesta desde xxxx.xxxx.xxxx.xxxx: bytes=32 tiempo<1m TTL=63

Estadísticas de ping para xxxx.xxxx.xxxx.xxxx:
Paquetes: enviados = 4, recibidos = 4, perdidos = 0
(0% perdidos),
Tiempos aproximados de ida y vuelta en milisegundos:
Mínimo = 0ms, Máximo = 0ms, Media = 0ms

From Cacti device menu, if i add a device with icmp detection i have this

SNMP Information
System:Juniper Networks, Inc. j4350 internet router, kernel JUNOS 9.3S5.1 #0:
lume/build/junos/9.3/service/9.3S5.1/obj-i386/sys/compile/JSERIES
Build date: 2009-09-23 22:40:36 UTC Copyright (c) 1996-200
Uptime: 1719997476 (199 days, 1 hours, 46 minutes)
Hostname: amoron-j
Location:
Contact:

Ping Results
ICMP ping Timed out





I cant imagine what is going wrong. Any idea where to look at ?

Thanks !!!!
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Re: ICMP Ping Error over Windows OS

Post by BSOD2600 »

ah-ha. non-English locale is the problem.

\cacti\lib\ping.php function ping_icmp() expects to find the word "Minimum" in the ping output, which of course it will not with your locale.

Bug logged - http://bugs.cacti.net/view.php?id=2351
juliop
Cacti User
Posts: 55
Joined: Fri Dec 11, 2009 7:40 am
Location: Argentina

Re: ICMP Ping Error over Windows OS

Post by juliop »

what the f.... :lol: !!!

Well at least its a well known issue. So i tried to change my system language from Spanish to English, but its W7Professional and you only can do that if you have Ultimate. :evil:

I downloaded and installed Fping for Windows on c:\fping folder, it comes with .reg file that modified register and its become executable from everywhere like the normal ping.

So i tested it and this is the output :

C:\Apache2\htdocs\cacti>fping xxxx.xxxx.xxxx.xxxx

Fast pinger version 3.00
(c) Wouter Dhondt (http://www.kwakkelflap.com)

Pinging xxxx.xxxx.xxxx.xxxx with 32 bytes of data every 1000 ms:

Reply[1] from xxxx.xxxx.xxxx.xxxx: bytes=32 time=0.4 ms TTL=63
Reply[2] from xxxx.xxxx.xxxx.xxxx: bytes=32 time=0.8 ms TTL=63
Reply[3] from xxxx.xxxx.xxxx.xxxx: bytes=32 time=0.8 ms TTL=63
Reply[4] from xxxx.xxxx.xxxx.xxxx: bytes=32 time=0.4 ms TTL=63

Ping statistics for xxxx.xxxx.xxxx.xxxx:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss)
Approximate round trip times in milli-seconds:
Minimum = 0.4 ms, Maximum = 0.8 ms, Average = 0.6 ms

Everything goes ok at this point. Next step was to edit ping.php:

}else if (substr_count(strtolower(PHP_OS), "winnt")) {
$result = shell_exec("fping " . $this->host["hostname"] . " -w " . $this->timeout . " -n " . $this->retries);

I saved it and then restarted the server. Then i tried:

C:\Apache2\htdocs\cacti>php script_server.php
PHP Script Server has Started - Parent is cmd
C:/apache2/htdocs/cacti/scripts/ss_fping.php ss_fping 192.168.181.142 5 ICMP
"fping" no se reconoce como un comando interno o externo,
programa o archivo por lotes ejecutable.
"fping" no se reconoce como un comando interno o externo,
programa o archivo por lotes ejecutable.
"fping" no se reconoce como un comando interno o externo,
programa o archivo por lotes ejecutable.
"fping" no se reconoce como un comando interno o externo,
programa o archivo por lotes ejecutable.
"fping" no se reconoce como un comando interno o externo,
programa o archivo por lotes ejecutable.
min:U avg:U max:U dev:U loss:100.00


Translation: "fping" not recognized as a command, program or executable file.



So now i think that maybe i have to put fping.exe in some specific cacti folder ? because maybe ping_icmp() its looking for the program in a specific folder. Just a thought...

We are getting closer !! :D

Thanks for all your help.
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Re: ICMP Ping Error over Windows OS

Post by BSOD2600 »

juliop wrote:Translation: "fping" not recognized as a command, program or executable file.
Where did you install fping to? I'd recommend c:\windows, which is already in the system path.
juliop
Cacti User
Posts: 55
Joined: Fri Dec 11, 2009 7:40 am
Location: Argentina

Re: ICMP Ping Error over Windows OS

Post by juliop »

Where did you install fping to? I'd recommend c:\windows, which is already in the system path.
Ok, so now i move it to c:\windows and its working!!!!!! 8)



C:\Apache2\htdocs\cacti>php script_server.php
PHP Script Server has Started - Parent is cmd
C:/apache2/htdocs/cacti/scripts/ss_fping.php ss_fping xxxx.xxxx.xxxx.xxxx 5 ICMP
min:0.3000 avg:0.6200 max:0.8000 dev:0.2227 loss:0.0000



Thanks for the patience !!!!!

Regards,


Julio
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests