Activities

March 2010
M T W T F S S
« Feb   Apr »
1234567
891011121314
15161718192021
22232425262728
293031  

Nagios- Getting Host down alerts

I have said to setup nagios for few servers located on the same Vlan. But there servers are highly protected by the network which is all the ICMP request packets are dropped.
This cause me to get a nagios alert that ” Host is down” once Nagios monitoring host is configured.

The best way to override is the replace of “check-host-alive” command on the Host configuration template file.
Before doing that,
we need to define the new command for the host availability check on “command.cfg” file inside the nagios installation directory.

[root@mail ~]# vi /usr/local/nagios/etc/objects/commands.cfg

and add the following lines

define command {
    command_name check-host-alive-by-web
    command_line $USER1$/check_http -H $HOSTADDRESS
}

Then,

Replace the host config. file for both Linux and Windows you wish to modify

<strong>[root@mail ~]# vi /usr/local/nagios/etc/objects/templates.cfg</strong>
define host{
        name                    ggs-servers
        use                     generic-host
        check_period            24x7
        check_interval          5
        retry_interval          1
        max_check_attempts  10
        check_command        check-host-alive-by-web
        notification_period     24x7
        notification_interval   5
        notification_options    d,r
        contact_groups          ggsgroup
        hostgroups              windows-servers
        register                0
}

Verify the syntax,

#/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
Restart the service,

# service nagios restart

-njoy

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>