Problem with contactgroup

Support requests, bug reports, questions etc.
kaplan71
NConf supporter
NConf supporter
Posts: 37
Joined: Tue Nov 01, 2011 00:34

Problem with contactgroup

Post by kaplan71 » Fri Jul 06, 2012 20:18

Hello --

We are running Icinga 1.6.1 on our server. The configuration files are those from a Nagios 3.3.1 server, and they have been successfully incorporated into the new system. Among the configuration files is the contactgroups.cfg file. An excerpt of the file is shown below:
# 'nt-admins' contact group definition
define contactgroup{
contactgroup_name nt-admins
alias NT Administrators
members icingaadmin,bil
}


# 'linux-admins' contact group definition
define contactgroup{
contactgroup_name linux-admins
alias Linux Administrators
members icingaadmin,bil
}


# 'admins' contact group definition
# define contactgroup{
# contactgroup_name admins
# alias Nagios Administrators
# members icingaadmin,bil
# }
The nt-admins and linux-admins groups are activated, while the admins group has been deactivated in favor of the other two. Prior to adding hosts, the linux-admin and nt-admin groups were added to the nconf database.

I am going through the motions of adding hosts to the nconf database from the hosts.cfg file. Two example hosts are the following:
# 'knowledgebase' host definition
define host{
use generic-host ; Name of host template to use

host_name knowledgebase
alias knowledgebase
address <ip address>
parents <building floor>
check_command check-host-alive
max_check_attempts 10
contact_groups linux-admins
notification_interval 480
notification_period 24x7
notification_options d,u,r
}


# 'multivue1' host definition
define host{
use generic-host ; Name of host template to use

host_name multivue1
alias multivue1
address <ip address>
parents <building floor>
check_command check-host-alive
max_check_attempts 10
contact_groups nt-admins
check_period 24x7
notification_interval 120
notification_period 24x7
notification_options d,u,r
}
I ran the Generate Nagios Config applet within NConf, and was unable to generate the output file. The following error messages appeared on-screen:
Error: Contact group 'nt-' specified in host 'romultivue2' is not defined anywhere!
Error: Contact group 'linux-' specified in host 'rorecovery' is not defined anywhere!
When I replace the linux-admins and nt-admins with the admins group, the output files are generated without issue. As part of the troubleshooting process, I added the two groups in question to the admins group, was again able generate the output files. I did a check of hosts.cfg that was generated by the NagiosConfig.tgz file, and the contact_groups value that was present throughout the file is shown below:
contact_groups +admins
I had several questions concerning this situation:

1. Will Icinga recognize the contact_groups value, and be able to operate successfully with it?
2. Why is NConf having problems recognizing the linux-admins and nt-admins contact groups, and how can that be corrected?
3. Is the best course of action to go back to the contactgroups.cfg file, and modify it to include the linux-admins and nt-admins groups?

Thanks.

User avatar
fgander
NConf developer
NConf developer
Posts: 308
Joined: Mon Mar 16, 2009 14:23
Location: Bern, Switzerland
Contact:

Re: Problem with contactgroup

Post by fgander » Sat Jul 07, 2012 18:21

Hey

I was not active quite a long time, the problem could be the "-" in the name. Can you try to replace your names without this character ?

Please report if that is the problem. Thx

Fabian
F.G. - NConf developer
http://www.nconf.org
Image
Follow NConf on Twitter!

kaplan71
NConf supporter
NConf supporter
Posts: 37
Joined: Tue Nov 01, 2011 00:34

Re: Problem with contactgroup

Post by kaplan71 » Sat Jul 07, 2012 22:07

Hello --

I removed the '-' from the ntadmins and linuxadmins groups. Once they were removed, I made the appropriate changes to the hosts configurations, and I was able to generate the output file. I unzipped the contents of the file
and inspected the hosts.cfg file. The newly named contact groups were present for all the hosts, but the +admins group was also present on all hosts.

Is this by design, or should the +admins reference be removed from the file? Also, if the +admins reference is not supposed to be there, will commenting out the admins group in the appropriate file resolve this issue?

Thanks.

User avatar
fgander
NConf developer
NConf developer
Posts: 308
Joined: Mon Mar 16, 2009 14:23
Location: Bern, Switzerland
Contact:

Re: Problem with contactgroup

Post by fgander » Sat Jul 07, 2012 23:51

This is the default configuration in the nconf.php file.

Please have a look for the $SUPERADMIN_GROUPS array, if you don't want to add the admin group then just remove it from the array, make it an empty one.

That's all.

Fabian
F.G. - NConf developer
http://www.nconf.org
Image
Follow NConf on Twitter!

Locked