nagios core 4.4.5 error defining host
Posted: Fri Nov 29, 2019 9:08 am
hello, I have nagios core 4.4.5
i have the templates.cfg file with this definition of generic-host
define host {
name generic-host ; The name of this host template
notifications_enabled 1 ; Host notifications are enabled
event_handler_enabled 1 ; Host event handler is enabled
flap_detection_enabled 1 ; Flap detection is enabled
process_perf_data 1 ; Process performance data
retain_status_information 1 ; Retain status information across program restarts
retain_nonstatus_information 1 ; Retain non-status information across program restarts
notification_period 24x7 ; Send host notifications at any time
register 0 ; DON'T REGISTER THIS DEFINITION - ITS NOT A REAL HOST, JUST A$
}
I just made two config files.
hg-nas.cfg
define hostgroup{
hostgroup_name NAS
alias NETWORK DRIVE
}
recserver.cfg
define host {
use generic_host ;template
host_name name-of-nas ; The name we're giving to this host
alias Qnap network drive ; A longer name associated with the host
address the-ip-address ; IP address of the host
hostgroups NAS ; Host groups this host is associated with
}
If I issue: service nagios restart, i get errors.
Error: Could not register host (config file '/usr/local/nagios/etc/hosts/recserver.cfg', starting on line 1)
What's wrong in that file?
If I remove recserver.cfg and restart nagios service everything is fine.
I don't understand or perhaps I need a better knowledge of nagios.
i have the templates.cfg file with this definition of generic-host
define host {
name generic-host ; The name of this host template
notifications_enabled 1 ; Host notifications are enabled
event_handler_enabled 1 ; Host event handler is enabled
flap_detection_enabled 1 ; Flap detection is enabled
process_perf_data 1 ; Process performance data
retain_status_information 1 ; Retain status information across program restarts
retain_nonstatus_information 1 ; Retain non-status information across program restarts
notification_period 24x7 ; Send host notifications at any time
register 0 ; DON'T REGISTER THIS DEFINITION - ITS NOT A REAL HOST, JUST A$
}
I just made two config files.
hg-nas.cfg
define hostgroup{
hostgroup_name NAS
alias NETWORK DRIVE
}
recserver.cfg
define host {
use generic_host ;template
host_name name-of-nas ; The name we're giving to this host
alias Qnap network drive ; A longer name associated with the host
address the-ip-address ; IP address of the host
hostgroups NAS ; Host groups this host is associated with
}
If I issue: service nagios restart, i get errors.
Error: Could not register host (config file '/usr/local/nagios/etc/hosts/recserver.cfg', starting on line 1)
What's wrong in that file?
If I remove recserver.cfg and restart nagios service everything is fine.
I don't understand or perhaps I need a better knowledge of nagios.