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?


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
        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

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.


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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.