telephone: (920) 215-1842
facsimile: (866) 456-2115

Nagios – Check Host without Ping

Nagios Ping Warning

There are many good reasons to disable ping on a server. Typically I disable ping (ICMP) on my servers and add a iptables entry to allow the nagios monitoring service complete access to monitor the system.

It is a good idea to disable ping since generally someone could use it to sniff out your open ports and find possible vulnerabilities.

Overview

As of this post I am running Nagios 3.2.0. Occasionally you might be checking a host that has ping (ICMP) disabled or just doesn’t respond to ping requests. As you can see from the image below because the ping response is blocked and Nagios reports an issue even though all services on the client are running prefectly. It just can’t ping it!
Nagios Ping Warning

Solution

Submitting a passive check result can be done via the Web Interface (among other ways) so you just need to login to Nagios, select the host in question and use the “Submit passive check result for this host” command option from the list of Host Commands.

Nagios Passive Check

  check_tcp -p 80
  

 

Nagios Ping Warning
Now you have the ability to check a host that has PING response disabled while displaying the correct state status. All services check will continue as normal but now you can display the up or down status

 

5 Responses

  1. That only updates the status once. This template lets you define a host that only uses the web check to determine if the host is alive.
    # Generic host definition template – This is NOT a real host, just a template!

    define host{
    name generic-noping-webhost ; The name of this host template
    notifications_enabled 1 ; Host notifications are enabled
    event_handler_enabled 1 ; Host event handler is enabled
    flap_detection_enabled 1 ; Flap detection is enabled
    failure_prediction_enabled 1 ; Failure prediction is enabled
    process_perf_data 1 ; Process performance data
    retain_status_information 1 ; Retain status information across program restarts
    retain_nonstatus_information 1 ; Retain non-status information across program restarts
    check_command ‘check_tcp -p 80’
    max_check_attempts 10
    notification_interval 0
    notification_period 24×7
    notification_options d,u,r
    contact_groups admins
    register 0 ; DONT REGISTER THIS DEFINITION – ITS NOT A REAL HOST, JUST A TEMPLATE!
    }

  2. loyd on Aug. 17th, 2010 at 7:48 am
    Reply
  3. Thanks for this – very useful.

    NB. In Icinga, the check_command line needs to be changed :-

    check_command check_tcp!80

  4. SirCompo on Jan. 30th, 2012 at 9:59 am
    Reply
  5. Desabilite o check de ping do nagios definindo simples comandos:

    Just define a command and a host command

    On the command file (no arquido de command.cfg)
    Define a dummy service for SUCCESS

    # Dummy SUCCESS command, used for host we no means of checking
    define command{
    command_name SUCCESS
    command_line $USER1$/check_dummy 0
    }

    Then in your host definition, use

    check_command SUCCESS

    The host will then be presumed to be up, so the service will be checked.

    O host irá presumir que está UP e para de alertar em vermelho pra vc! abcs

  6. Rodrigo Oleriano on Jul. 18th, 2012 at 6:42 am
    Reply
  7. Disabling ping to prevent port-probing is just nonsense. man nmap.

  8. Anyone on Aug. 24th, 2012 at 8:46 am
    Reply
  9. You could also check other potentially open ports like SMTP, FTP, HTTPS, etc.

  10. Matt Watson (Stackify DevOps) on Oct. 10th, 2012 at 1:56 pm
    Reply

Post a Comment

Do you have a question or comment about this post. Please share! Your email address will not be published. Required fields are marked *

*