Please pardon this newbie question as I am kind of weeding my way through a preconfigured Nagios setup configured by an admin that left the company. I 'think' I get the basics but not entirely sure.
From what I gather, nagios can be configured to look 'anywhere' for a host configuration file which is configured in nagios.cfg. In my previous post -- https://support.nagios.com/forum/viewto ... =7&t=56828 -- I initially lost my hosts and restored them by enabling a backup copy of nagios.cfg and disabling the initial primary copy which lead me to believe there was a mistake in nagios.cfg - and after searching for hours I figured out one of the
Code: Select all
cfg_file=Code: Select all
cfg_dir=/usr/local/nagios/etc/serversIn the hostgroups folder, I found multiple .cfg's
Code: Select all
/usr/local/nagios/etc$ ls hostgroups
apps.cfg peds.cfg logs.cfg board.cfg
closet.cfg hex.cfg table.cfg principal.cfg
colfax.cfg principal.cfg vm.cfg
So what I am thinking is, the hosts (machines, servers, vm's, ect) are all defined in the servers folder under .cfg's that contain entries like this:
Code: Select all
define host {
use linux-server
host_name sw02
alias sw02
address x.x.x.x
}
Code: Select all
define hostgroup {
hostgroup_name colfax
alias Colfax
}
define service{
use local-service
hostgroup_name colfax
service_description Current temperature
check_command check_nrpe!check_temp
notifications_enabled 1
}
...What I couldnt understand however is how Nagios know which host belongs to which hostgroup....
input?