Error with contactsgroup.cfg

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
haile711
Posts: 197
Joined: Thu May 28, 2015 7:36 am

Error with contactsgroup.cfg

Post 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..
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: Error with contactsgroup.cfg

Post 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
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
haile711
Posts: 197
Joined: Thu May 28, 2015 7:36 am

Re: Error with contactsgroup.cfg

Post 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!
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Error with contactsgroup.cfg

Post 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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
haile711
Posts: 197
Joined: Thu May 28, 2015 7:36 am

Re: Error with contactsgroup.cfg

Post 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
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: Error with contactsgroup.cfg

Post 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.
Former Nagios employee
https://www.mcapra.com/
haile711
Posts: 197
Joined: Thu May 28, 2015 7:36 am

Re: Error with contactsgroup.cfg

Post 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
haile711
Posts: 197
Joined: Thu May 28, 2015 7:36 am

Re: Error with contactsgroup.cfg

Post by haile711 »

I redo the installation and everything is fixed, you can closed this thread. Used the same cookbook too :(
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: Error with contactsgroup.cfg

Post by npolovenko »

@haile711, Thanks for the update. I will be closing this thread as resolved.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked