Find the answer to your Linux question:
Results 1 to 8 of 8
Hi, Does anyone know how to keep linux from printing "ICMP Host Unreachable from x.x.x.x for ICMP Echo ...." whenever I try to ping/fping a host that isn't reachable for ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    btr
    btr is offline
    Just Joined!
    Join Date
    Oct 2005
    Location
    N.H., USA
    Posts
    6

    suppressing "ICMP Host Unreachable" messages when using ping/fping


    Hi,

    Does anyone know how to keep linux from printing "ICMP Host Unreachable from x.x.x.x for ICMP Echo ...." whenever I try to ping/fping a host that isn't reachable for some reason? I say "linux" because I don't think it's the actual ping or fping application that's printing the messages. If anyone knows for sure what component of the operating system is printing them (or if it really is the ping application), please tell me.

    Note that my question is not "why are these messages printed" or "what do they mean". I just don't want to see them. They're a pain because they're printed to stderr and there's no convenient way to suppress them or redirect them (I don't want to have to redirect them each and every time, and in a script that writes to a file they end up popping up on the tty (unless I redirect them)... grrrr.)


    Thank you!

  2. #2
    btr
    btr is offline
    Just Joined!
    Join Date
    Oct 2005
    Location
    N.H., USA
    Posts
    6
    No takers? Wow, I'm surprised this hasn't bother anyone else just as much. Must be me.

  3. #3
    Just Joined!
    Join Date
    Aug 2006
    Posts
    1
    The "ICMP Host Unreachable from x.x.x.x for ICMP Echo ...." messages are error messages, so you could redirect stderr to /dev/null like this:
    fping < pinghosts.txt 2>/dev/null

  4. #4
    btr
    btr is offline
    Just Joined!
    Join Date
    Oct 2005
    Location
    N.H., USA
    Posts
    6
    Thanks for the reply. Yes, that's what I do when I really need to, but it's not all that convenient, especially for something that I use so frequently.

  5. #5
    Linux Guru anomie's Avatar
    Join Date
    Mar 2005
    Location
    Texas
    Posts
    1,692
    So create an alias.

    Why do you want to suppress icmp host unreachable messages? I would think that'd be important info.

  6. #6
    Linux Engineer rcgreen's Avatar
    Join Date
    May 2006
    Location
    the hills
    Posts
    1,134
    I'm sure the messages are generated by the application
    and not the OS, so your ultimate strategy would be to get
    the source code, modify it and compile your own custom
    version.

  7. #7
    btr
    btr is offline
    Just Joined!
    Join Date
    Oct 2005
    Location
    N.H., USA
    Posts
    6
    @rcgreen - what makes you sure of this?

  8. #8
    oz
    oz is offline
    forum.guy
    Join Date
    May 2004
    Location
    arch linux
    Posts
    18,733
    Guys, this thread is approaching 7 years old so I'm going to close it, but please feel free to start fresh threads if you are having any issues with Linux.

    Thank you.
    oz

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •