Error: Invalid hostgroup object directive 'contact_groups'

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
Asylum
Posts: 2
Joined: Tue Oct 13, 2015 3:02 am

Error: Invalid hostgroup object directive 'contact_groups'

Post by Asylum »

Hi,

So getting an error when restarting nagios 3 with an added oldnagios_host.cfg.
That oldnagios file is from a server running nagios 1 and trying to migrate the contact_groups and contacts, as adding them manually is tedious.

this is the error that I am getting :

-------------------------------------------------------------------------------------------------------------------

Processing object config file '/etc/nagios3/oldnagios_host.cfg'...
Error: Invalid hostgroup object directive 'contact_groups'.
Error: Could not add object property in file
'/etc/nagios3/oldnagios_host.cfg' on line 9553.
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 defintions. 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.

[FAIL] errors in config! ... failed!

-------------------------------------------------------------------------------------------------------------------

any assistance would be appreciated.

Thanks
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: Error: Invalid hostgroup object directive 'contact_group

Post by hsmith »

You can not have contact_groups defined in a hostgroup. This is what is causing it to error out.

https://assets.nagios.com/downloads/nag ... tions.html
Former Nagios Employee.
me.
Asylum
Posts: 2
Joined: Tue Oct 13, 2015 3:02 am

Re: Error: Invalid hostgroup object directive 'contact_group

Post by Asylum »

Hi,

so this is what I have currently in the .cfg file

define hostgroup {
hostgroup_name important_servers
alias Important Servers
contact_groups ff_noc, ff_people_sms
members

so where do contact_groups get defined in the new version?
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: Error: Invalid hostgroup object directive 'contact_group

Post by hsmith »

You can define them the host or service itself, not the hostgroup. The object definitions that I linked are very useful for setting these things up.
Former Nagios Employee.
me.
Locked