Updating Hosts Information in Nagios



Putty  http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html if you are using Windows, or the built in Terminal on Linux and Mac OS.


Server Login info


Hostname: monitor.accion.org

Port: 22 ( SSH )

Username: in the email

Password: in the email  


Nagios directory


The Nagios data and configuration files are located at this path /usr/local/nagios on the server. The data files (web and images) are located in the Share directory and the configuration files are located in the etc directory within the Nagios directory.


Updating the configuration files


For example, if you want to update a Windows host information ( IP address or add a component to monitor, like a hard drive for example, etc ) do the following.


Once you login to the server using the server login info above, type the following command in Putty or Terminal:


cd /usr/local/nagios/etc/


That will switch your input to the etc directory in Nagios: If you type the tree command, you will see the following tree directory:



The host configurations files are located in the “Objects” directory. This directory contains all the configuration files for each specific device types that we are monitoring. For example, the windows.cfg file contains all the windows hosts we are monitoring on the network, and the switch.cfg contain all the switches and routers, etc)


So to modify a Windows Host on the windows.cfg file, run the following command:


sudo nano objects/windows.cfg


And the file will open. Each Windows host in the list is labeled respectively. For example, if you need to change the IP address of bosmail2 look for that name in the list, and change the IP accordingly in the define host section:



Once you are finished modifying the configuration file, hit Ctrl + X on your keyboard and choose “yes” to save it.


Then run this command to update the new change in Nagios:


sudo /etc/init.d/nagios reload


Now your change you be reflected on the Nagios monitoring web page.


The end.