Page 1 of 1

Error with contactsgroup.cfg

Posted: Tue Aug 21, 2018 3:16 pm
by haile711
Hey guys,
I have just installed a fresh new server, and I am having issue with the "Apply Configuration".

I have tried "Config File Management" "Write" and "Verify", both look good, but when I try to "Apply Configuration" its keep saying

"Error: Could not add object property in file '/usr/local/nagios/etc/contactgroups.cfg' on line 17."

here is my contactgroups.cfg
###############################################################################
#
# Contact Group configuration file
#
# Created by: Nagios Core Config Manager 2.6.11
# Date: 2018-08-21 16:12:56
# Version: Nagios 3.x config file
#
# --- DO NOT EDIT THIS FILE BY HAND ---
# Nagios CCM will overwrite all manual settings during the next update if you
# would like to edit files manually, place them in the 'static' directory or
# import your configs into the CCM by placing them in the 'import' directory.
#
###############################################################################

define contactgroup {
contactgroup_name admins
alias Nagios Administrators
}

define contactgroup {
contactgroup_name xi_contactgroup_all
alias All Contacts
}

###############################################################################
#
# Contact Group configuration file
#
# END OF FILE
#
###############################################################################
Thanks..

Re: Error with contactsgroup.cfg

Posted: Tue Aug 21, 2018 4:59 pm
by npolovenko
Hello, @haile711. Please run the following script as root:
/usr/local/nagiosxi/scripts/reset_config_perms.sh
Then sign in as the nagios user:
su - nagios
And run the reconfigure script+show me the output:
/usr/local/nagiosxi/scripts/reconfigure_nagios.sh

Re: Error with contactsgroup.cfg

Posted: Tue Aug 21, 2018 8:15 pm
by haile711
@npolovenko

We have no permission to login as root, since we do not own the servers. We have permission to run things as root

Code: Select all

(root) NOPASSWD: /usr/local/nagiosxi/scripts/*
, so I just run as follow

Code: Select all

sudo /usr/local/nagiosxi/scripts/reset_config_perms.sh
. After i ran that and run the reconfigure i got the following
URL: http://localhost/nagiosxi/includes/components/ccm/
CMDLINE
/usr/bin/wget --save-cookies nagiosql.cookies --keep-session-cookies http://localhost/nagiosxi/includes/components/ccm/ --no-check-certificate --post-data 'submit=Login&hidelog=true&loginSubmitted=true&backend=1&username=nagiosxi&password=Spba3YpqAOab' -O nagiosql.loginnagiosql.login: Permission denied
LOGIN SUCCESSFUL!
NAGIOSQL LOGIN FAILED!

Re: Error with contactsgroup.cfg

Posted: Wed Aug 22, 2018 2:11 pm
by cdienger
It looks to be a permissions error and wget can't be run. Were any special steps outside of installing on a clean minimal OS install taken? XI should be installed with the root account, with the umask of 0022 and selinux should be disabled.

Re: Error with contactsgroup.cfg

Posted: Thu Aug 23, 2018 8:44 am
by haile711
@cdienger we installed using chef cookbook.
and before when i ran the reconfigure, I did not get this error :(
URL: http://localhost/nagiosxi/includes/components/ccm/
CMDLINE
/usr/bin/wget --save-cookies nagiosql.cookies --keep-session-cookies http://localhost/nagiosxi/includes/components/ccm/ --no-check-certificate --post-data 'submit=Login&hidelog=true&loginSubmitted=true&backend=1&username=nagiosxi&password=Spba3YpqAOab' -O nagiosql.login--2018-08-23 10:14:05-- http://localhost/nagiosxi/includes/components/ccm/
Resolving localhost (localhost)... 127.0.0.1
Connecting to localhost (localhost)|127.0.0.1|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: ‘nagiosql.login’

[ <=> ] 18,741 --.-K/s in 0.01s

2018-08-23 10:14:06 (1.68 MB/s) - ‘nagiosql.login’ saved [18741]

NAGIOSQL LOGIN FAILED!
Seem like the wget is fine but still cannot login to NAGIOSQL

Re: Error with contactsgroup.cfg

Posted: Thu Aug 23, 2018 9:26 am
by mcapra
haile711 wrote:we installed using chef cookbook.
A custom Chef cookbook? If so, it would definitely be useful to see that as we have no idea what changes it may or may not have made.

Or if you ran the supermarket nagios cookbook on-top of an existing Nagios XI installation, I would strongly suggest starting with a fresh Nagios XI installation and not running the default recipe in the nagios cookbook on a Nagios XI machine.

There was some discussion in a previous thread for leveraging the nagios cookbook for config management in Nagios XI:
https://support.nagios.com/forum/viewto ... 2&p=252287

There's right and "less right" ways to let the nagios cookbook handle your configs as far as Nagios XI is concerned.

Re: Error with contactsgroup.cfg

Posted: Thu Aug 23, 2018 9:31 am
by haile711
@mcapra, basically we have to use the cookbook to run the installation, since we do not have root access to the box. The cookbook is just steps of instructions we got from "manual" installation process. Its not a cookbook from Supermarket

Re: Error with contactsgroup.cfg

Posted: Thu Aug 23, 2018 10:03 am
by haile711
I redo the installation and everything is fixed, you can closed this thread. Used the same cookbook too :(

Re: Error with contactsgroup.cfg

Posted: Thu Aug 23, 2018 3:33 pm
by npolovenko
@haile711, Thanks for the update. I will be closing this thread as resolved.