Issue: upon running -
$ sudo /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
I'm receiving:
Error: Could not find any hostgroup matching 'network-printers' (config file '/usr/local/nagios/etc/printers/NC_FrontOffice.cfg', starting on line 10)
Error: Failed to process hostgroup names for host 'NC_FrontOffice' (config file '/usr/local/nagios/etc/printers/NC_FrontOffice.cfg', starting at line 10)
Error processing object config files!
nagios.cfg:
# OBJECT CONFIGURATION FILE(S)
# These are the object configuration files in which you define hosts,
# host groups, contacts, contact groups, services, etc.
# You can split your object definitions across several config files
# if you wish (as shown below), or keep them all in a single config file.
# You can specify individual object config files as shown below:
cfg_file=/usr/local/nagios/etc/objects/commands.cfg
cfg_file=/usr/local/nagios/etc/objects/contacts.cfg
cfg_file=/usr/local/nagios/etc/objects/timeperiods.cfg
cfg_file=/usr/local/nagios/etc/objects/templates.cfg
# Definitions for monitoring the local (Linux) host
#cfg_file=/usr/local/nagios/etc/objects/localhost.cfg
# Definitions for monitoring a Windows machine
cfg_file=/usr/local/nagios/etc/objects/windows.cfg
# Definitions for monitoring a router/switch
cfg_file=/usr/local/nagios/etc/objects/switch.cfg
# Definitions for monitoring a network printer
# cfg_file=/usr/local/nagios/etc/objects/printer.cfg
# You can also tell Nagios to process all config files (with a .cfg
# extension) in a particular directory by using the cfg_dir
# directive as shown below:
cfg_dir=/usr/local/nagios/etc/servers
cfg_dir=/usr/local/nagios/etc/printers
cfg_dir=/usr/local/nagios/etc/switches
# cfg_dir=/usr/local/nagios/etc/routers
Printer Config file in question:
define host{
use generic-printer ; Inherit default values from a template
host_name NC_FrontOffice ; The name we're giving to this printer
alias NC_FrontOffice ; A longer name associated with the printer
address 10.4.0.30 ; IP address of the printer
hostgroups network-printers ; Host groups this printer is associated with
}
The interesting thing for me is, you'd wonder, "does he have an entry in 'hostgroups.cfg'?
I'm not even using that file, as you can see from nagios.cfg
What changed: I moved all my printer definitions from printer.cfg, to individual .cfg files.
The printer.cfg file only contained printer definitions...no hostgroup definitions, etc
Thoughts?
Thanks ,
Rich