ICMP Ping error: gethostbyname failed

Post support questions that directly relate to Linux/Unix operating systems.

Moderators: Developers, Moderators

Post Reply
Moriarty
Posts: 23
Joined: Thu Apr 12, 2007 10:18 am

ICMP Ping error: gethostbyname failed

Post by Moriarty »

Hi folks,

Since I've upgraded to 0.8.7b about half of my Advanced Ping graphs are showing 100% packet loss. cacti.log is showing the following for each of the hosts this is happening with:

Code: Select all

03/07/2008 11:30:01 PM - CMDPHP: Poller[0] WARNING: ICMP Ping Error: gethostbyname failed for 10.255.193.22
03/07/2008 11:30:01 PM - CMDPHP: Poller[0] WARNING: ICMP Ping Error: gethostbyname failed for 10.255.193.22
03/07/2008 11:30:01 PM - CMDPHP: Poller[0] WARNING: ICMP Ping Error: gethostbyname failed for 10.255.193.22
03/07/2008 11:30:01 PM - CMDPHP: Poller[0] WARNING: ICMP Ping Error: gethostbyname failed for 10.255.193.22
03/07/2008 11:30:01 PM - CMDPHP: Poller[0] WARNING: ICMP Ping Error: gethostbyname failed for 10.255.193.22
03/07/2008 11:30:01 PM - CMDPHP: Poller[0] WARNING: ICMP Ping Error: gethostbyname failed for 10.255.193.22
03/07/2008 11:30:01 PM - CMDPHP: Poller[0] WARNING: ICMP Ping Error: gethostbyname failed for 10.255.193.22
03/07/2008 11:30:01 PM - CMDPHP: Poller[0] WARNING: ICMP Ping Error: gethostbyname failed for 10.255.193.22
03/07/2008 11:30:01 PM - CMDPHP: Poller[0] WARNING: ICMP Ping Error: gethostbyname failed for 10.255.193.22
03/07/2008 11:30:01 PM - CMDPHP: Poller[0] WARNING: ICMP Ping Error: gethostbyname failed for 10.255.193.22
03/07/2008 11:30:01 PM - CMDPHP: Poller[0] WARNING: ICMP Ping Error: gethostbyname failed for 10.255.193.22
03/07/2008 11:30:01 PM - CMDPHP: Poller[0] WARNING: ICMP Ping Error: gethostbyname failed for 10.255.193.22
03/07/2008 11:30:01 PM - CMDPHP: Poller[0] WARNING: ICMP Ping Error: gethostbyname failed for 10.255.193.22
03/07/2008 11:30:01 PM - CMDPHP: Poller[0] WARNING: ICMP Ping Error: gethostbyname failed for 10.255.193.22
03/07/2008 11:30:01 PM - CMDPHP: Poller[0] WARNING: ICMP Ping Error: gethostbyname failed for 10.255.193.22
03/07/2008 11:30:01 PM - CMDPHP: Poller[0] WARNING: ICMP Ping Error: gethostbyname failed for 10.255.193.22
03/07/2008 11:30:01 PM - CMDPHP: Poller[0] WARNING: ICMP Ping Error: gethostbyname failed for 10.255.193.22
03/07/2008 11:30:01 PM - CMDPHP: Poller[0] WARNING: ICMP Ping Error: gethostbyname failed for 10.255.193.22
03/07/2008 11:30:01 PM - CMDPHP: Poller[0] WARNING: ICMP Ping Error: gethostbyname failed for 10.255.193.22
03/07/2008 11:30:01 PM - CMDPHP: Poller[0] WARNING: ICMP Ping Error: gethostbyname failed for 10.255.193.22
All hosts have an IP addresses defined for their hostnames, no name resolution required.

These were all graphing fine for months pre-upgrade. I was on 0.8.6j using cactid before the upgrade to 0.8.7b and spined.

Anyone have any ideas on how to resolve this? :) It'd be much appreciated.

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

Post by TheWitness »

Oh, that sucks. Let me take a second look at the code.

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
TheWitness
Developer
Posts: 17047
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Change line 127 in lib/ping.php to the following and let's see what happens.

Code: Select all

$host_ip = trim(gethostbyname($this->host["hostname"]));
As far as I can tell, this function is so strait forward, that it has to be something related to PHP. Let's see though.

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?
Moriarty
Posts: 23
Joined: Thu Apr 12, 2007 10:18 am

Post by Moriarty »

Hi TheWitness, thanks for the assistance :)

Changing that line had no appreciable difference, graphs are still at 100% loss with the same errors being logged to cacti.log.

I can't figure out what the difference is between the graphs which are still working normally and those that are showing 100% loss either :\
Moriarty
Posts: 23
Joined: Thu Apr 12, 2007 10:18 am

Post by Moriarty »

.. heh, anyone alive? :)

This still has me totally stumped.
cgotstein
Posts: 6
Joined: Tue Jul 26, 2005 3:43 am

Post by cgotstein »

I see a common thread here. We are both getting the same errors on hosts that are in the 10.255 subnet. Could this be the issue?
Moriarty
Posts: 23
Joined: Thu Apr 12, 2007 10:18 am

Post by Moriarty »

cgotstein: now that you mention it, all my failed graphs are in the 10.255.0.0/16 subnet alright. All graphs not in that subnet are graphing fine.

Completely missed that, good catch :) Looks like there's a bug somewhere along the line in resolving this subnet.
cgotstein
Posts: 6
Joined: Tue Jul 26, 2005 3:43 am

Post by cgotstein »

As soon as i used an alternate ip address for those same devices, the errors went away. So i think we found the problem. My guess is that some routine isn't liking the fact that we are using a 255 in the ip address. Hopefully one of the developers can fix this.
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

The error is known as http://bugs.cacti.net/view.php?id=1204
I've assigned it to me. The link already shows the code update, so if you're in a hurry, simple have a look
Reinhard
cgotstein
Posts: 6
Joined: Tue Jul 26, 2005 3:43 am

Post by cgotstein »

This is what i did:

file: lib/ping.php

Find:
error in function is_ipaddress
foreach($octets as $octet) {
if(($octet < 0) || ($octet >= 255))

replace: if(($octet < 0) || ($octet >= 255))

with: if(($octet < 0) || ($octet > 255))

Seems to be working now. Hopefully that is the correct change.
Moriarty
Posts: 23
Joined: Thu Apr 12, 2007 10:18 am

Post by Moriarty »

That's the one. Makes sense :)

Thanks gents, much appreciated.
User avatar
chrisgapske
Cacti User
Posts: 278
Joined: Tue May 22, 2007 7:56 am
Location: Pensacola, Fl - Padacuh, Ky-Alpena, MI-Gulf Shores,AL

It seems to be back

Post by chrisgapske »

06/08/2009 08:20:11 AM - CMDPHP: Poller[0] WARNING: ICMP Ping Error: gethostbyname failed for

Well this bug seems to be alive and well.

I am having the same problem as listed.

http://bugs.cacti.net/view.php?id=1204

I will request it to be reopened.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest