First time poster! I'm new to Nagios but have just migrated an instance from 4.1.1, Ubuntu 12 to 4.4.5, Ubuntu 18.
The instance uses adagios and pnp4nagios additionally.
I've ran into two issues, likely due to not understanding how Nagios reads it's config files:
Code: Select all
root@hostname:/etc/adagiosconf/objects# /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
Nagios Core 4.4.5
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 2019-08-20
License: GPL
Website: https://www.nagios.org
Reading configuration data...
Read main config file okay...
Warning: Duplicate definition found for contact 'generic-contact' (config file '/etc/adagiosconf/objects/templates.cfg', starting on line 27)
Error: Could not add object property in file '/etc/adagiosconf/objects/templates.cfg' on line 28.
Error: Could not register host (config file '/etc/adagiosconf/objects/switch.cfg', starting on line 20)
Error processing object config files!
***> One or more problems was encountered while processing the config files...
Check your configuration file(s) to ensure that they contain valid
directives and data definitions. If you are upgrading from a previous
version of Nagios, you should be aware that some variables/definitions
may have been removed or modified in this version. Make sure to read
the HTML documentation regarding the config files, as well as the
'Whats New' section to find out what has changed.
templates.cfg Lines 27 and 28
Code: Select all
define contact{
name generic-contact ; The name of this contact template
service_notification_period 24x7 ; service notifications can be sent anytime
host_notification_period 24x7 ; host notifications can be sent anytime
service_notification_options w,u,c,r,f,s ; send notifications for all service states, flapping events, and scheduled downtime events
host_notification_options d,u,r,f,s ; send notifications for all host states, flapping events, and scheduled downtime events
service_notification_commands notify-service-by-email ; send service notifications via email
host_notification_commands notify-host-by-email ; send host notifications via email
register 0 ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL CONTACT, JUST A TEMPLATE!
}
Code: Select all
define host {
use generic-switch ; Inherit default values from a template
host_name linksys-abc123d ; The name we're giving to this switch
alias linksys ABC123D Switch ; A longer name associated with the switch
address 192.168.1.X ; IP address of the switch
hostgroups switches ; Host groups this switch is associated with
}
Code: Select all
define contact {
contact_name nagiosadmin ; Short name of user
use generic-contact ; Inherit default values from generic-contact template (defined above)
alias Nagios Admin ; Full name of user
email my.email@example.com ; <<***** CHANGE THIS TO YOUR EMAIL ADDRESS ******
}
Additionally adagios is giving me this error:
Destination for new objects (/etc/adagiosconf/objects) is not defined in nagios.cfg
Even though it is listed as below:
cfg_file=/etc/adagiosconf/objects/commands.cfg
cfg_file=/etc/adagiosconf/objects/contacts.cfg
cfg_file=/etc/adagiosconf/objects/timeperiods.cfg
cfg_file=/etc/adagiosconf/objects/templates.cfg
cfg_file=/etc/adagiosconf/objects/localhost.cfg
cfg_dir=/etc/adagiosconf/objects
I also tried it as /usr/local/nagios/etc/objects