Adding Monitored Hosts - wAlber47/Tech-Journal GitHub Wiki

This page describes how to add hosts to your Nagios Core server.


Prerequisite

  • Make sure you can ping the server you wish to add from your Nagios server.
  • In this example we will be adding a server called "test.nagios" with an IP of 10.0.0.1.

Steps

  1. Change directory /usr/local/nagios/etc/objects, create a new filed called test.nagios.cfg.
  2. Add the following into the file:
define host {
    host_name              test.nagios
    alias                  Test Server
    address                10.0.0.1
    max_check_attempts     3
    check_period           24x7
    check_command          check-host-alive
    contacts               nagiosadmin
    notification_interval  60
    notificaion_period     24x7
}
  1. Navigate to /usr/local/nagios/etc and edit the nagios.cfg file.
  2. Add cfg_file=/usr/local/nagios/etc/objects/test.nagios.cfg to the end of the file.
  3. Restart Nagios service and check your Host dashboard to see the newly configured host.