We can create the new host definition for sparta.naginet as follows:
1.Change directory to /usr/local/nagios/etc/objects, and create a new file called sparta.naginet.cfg:
# cd /usr/local/nagios/etc/objects
# vi sparta.naginet.cfg
2.Write the following into the file, changing the values in bold as appropriate for your own setup:
##sbsc MKT####################################
define host{
use generic-switch
host_name SBSC-CORE-MKT
alias SBSC Mikrotik Core
address 103.139.9.162
hostgroups switches
parents RadiusKushtia
icon_image rack-server.gif
}
3.Change directory to /usr/local/nagios/etc, and edit the nagios.cfg file:
# cd ..
# vi nagios.cfg
4.At the end of the file add the following line:
cfg_file=/usr/local/nagios/etc/objects/sparta.naginet.cfg
5.Restart the Nagios Core server:
# /etc/init.d/nagios restart
