9

I'm new to nagios and my server is on a network which does not allow the server to be pinged. Is it possible for me to check if the server is up another way? e.g via SSH or HTTP? How would I do this so on my nagios report it doesn't show the server as offline when it is online?

Ulkmun
  • 265
  • 1
  • 3
  • 9

4 Answers4

12

On your host definition you can specify what command you want to use.

define host{
        use                                     generic-host
        host_name                               SVR_1
        alias                                   SVR_1
        address                                 10.0.0.6
        check_command                   check-host-alive
        max_check_attempts              2
        notification_interval   120
        notification_period             24x7
        notification_options    d,u,r
        }

so, typically in checkcommands.cfg you would make a new command with what you wanted, or you could just use check_http.

define command{
        command_name    check-host-alive
        command_line    $USER1$/check_ping -H $HOSTADDRESS$ -w 3000.0,80% -c 5000.0,100% -p 1
        }
pablo
  • 3,040
  • 1
  • 19
  • 23
1

You probably configured your server as a host in hosts.cfg with a line that looks like

check_command           check-host-alive

check-host-alive is defined in commands.cfg to use check_ping.

I would suggest you to change the check_command to something like my-check-host-alive and to define my-check-host-alive in commands.cfg to use something like check_tcp.

Start check_tcp with -h to see the help for it.

rems
  • 2,260
  • 13
  • 11
0

I appreciate Your feedback. Using check_http helped me to remove a remote website i am monitoring from showing down under host since i cant ping it.

Good discussion. This works on icinga too. Actually am using icinga and most generic host file is as below for the website am monitoring to be clear.

#################### define host{ name remote-site-host ; 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_http max_check_attempts 3 notification_interval 0 notification_period 24x7 notification_options d,u,r register 0 ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL HOST, JUST A TEMPLATE! } #########

0

Use a different device status check, by default it uses the host alive check, use the check_nrpe one or however your testing it.

Checkout Centreon, should simplify your nagios configuration.