Windows.cfg query
Posted: Wed Aug 12, 2015 3:24 am
Good morning,
In my windows,cfg, I have the following:
I also have services defined as follows, which work correctly, providing information to the web interface and generating email alerts for both servers
Note that host_name is commented out.
If however, I uncomment host_name and comment hostgroup_name thus:
when I attempt to verify, I get the following:
Reading configuration data...
Read main config file okay...
Error: Could not find any host matching 'MYSECONDHOSTNAME' (config file '/usr/local/nagios/etc/objects/windows.cfg', starting on line 32)
Error: Failed to expand host list 'MYFIRSTHOSTNAME' for service 'Application - NSClient++' (/usr/local/nagios/etc/objects/windows.cfg:32)
Error processing object config files!
As the hostnames work correctly when they're part of a hostgroup_name, why won't they work when specfied as host_name?
Thanks in advance for your assistance.
Pete
In my windows,cfg, I have the following:
Code: Select all
define host{
use windows-server
host_name MYFIRSTHOSTNAME
alias Dev-Jenkins
address 88.88.88.88
hostgroups windows-servers
}
define host{
use windows-server
host_name MYSECONDHOSTNAME
alias UAT-Jenkins
address 99.99.99.99
hostgroups windows-servers
}
define hostgroup{
hostgroup_name windows-servers
alias Jenkins Test Servers
}
Note that host_name is commented out.
Code: Select all
define service{
use generic-service
#host_name MYFIRSTHOSTNAME, MYSECONDHOSTNAME
hostgroup_name windows-servers
service_description Application - NSClient++
check_command check_nt!CLIENTVERSION
}
Code: Select all
define service{
use generic-service
host_name MYFIRSTHOSTNAME, MYSECONDHOSTNAME
#hostgroup_name windows-servers
service_description Application - NSClient++
check_command check_nt!CLIENTVERSION
}
Reading configuration data...
Read main config file okay...
Error: Could not find any host matching 'MYSECONDHOSTNAME' (config file '/usr/local/nagios/etc/objects/windows.cfg', starting on line 32)
Error: Failed to expand host list 'MYFIRSTHOSTNAME' for service 'Application - NSClient++' (/usr/local/nagios/etc/objects/windows.cfg:32)
Error processing object config files!
As the hostnames work correctly when they're part of a hostgroup_name, why won't they work when specfied as host_name?
Thanks in advance for your assistance.
Pete