Page 2 of 4

Re: NagiosXI service-hosts setting left empty in file

Posted: Wed Mar 22, 2017 3:25 pm
by ssax
Is your DB running locally or on another server?

Please run this command and post the entire output:

Code: Select all

echo "SELECT @@GLOBAL.sql_mode; SELECT @@SESSION.sql_mode;" | mysql -uroot -pnagiosxi

Re: NagiosXI service-hosts setting left empty in file

Posted: Wed Mar 22, 2017 3:28 pm
by pf_nagios
local


[root@nagios ~]# echo "SELECT @@GLOBAL.sql_mode; SELECT @@SESSION.sql_mode;" | mysql -uroot -pnagiosxi
@@GLOBAL.sql_mode

@@SESSION.sql_mode

Re: NagiosXI service-hosts setting left empty in file

Posted: Wed Mar 22, 2017 4:10 pm
by ssax
Ok, I thought you may have been hitting a bug, that's proper.

Please PM one of us a copy of your profile, you can download it by going to Admin > System Config > System Profile and click the Download Profile button in the top right corner.

We need to get the files in a bad state, please perform these steps without any additional steps (like applying config, etc) in between.

Please go to Configure > Core Config Manager > Tools > Config File Management/Write Config Files
- Click Delete (don't worry, it's safe, they get re-written)
- Click Write
- Now run this command and PM one of us the resulting /tmp/badconfigs.zip file:

Code: Select all

zip -r /tmp/badconfigs.zip /usr/local/nagios/etc
Thank you

Re: NagiosXI service-hosts setting left empty in file

Posted: Mon Mar 27, 2017 9:41 am
by pf_nagios
I already sent the profile but I will do that again. I have also already performed those steps to delete and re-write the configs and as I stated last time, that didn't work. I had to roll back. I will also send in the bad configs folder.

Re: NagiosXI service-hosts setting left empty in file

Posted: Mon Mar 27, 2017 11:16 am
by ssax
Please run this tail command (and let it run):

Code: Select all

tail -f /usr/local/nagiosxi/var/cmdsubsys.log
Then try to apply configuration again and send me the entire output of the tail command.

Please PM an updated copy of your profile as well, I know you sent it earlier, I just want an updated one in the event something has changed.

Or if you'd like we can move this into a ticket, please email [email protected] with a descriptive subject and detailed body and please include a link back to this thread and we can get it resolved in a remote.

Thank you

Re: NagiosXI service-hosts setting left empty in file

Posted: Mon Mar 27, 2017 11:33 am
by pf_nagios
I pm'ed you the data you requested earlier (today). Do you see it?

Here's the fail output after running the delete, write, then apply configuration commands in the web-gui:



[root@nagios ~]# [root@nagios ~]# tail -f /usr/local/nagiosxi/var/cmdsubsys.log
-bash: [root@nagios: command not found
[root@nagios ~]# tar: usr/local/nagios/etc/cfgprep/orig: Cannot utime: Operation not permitted
-bash: tar:: command not found
[root@nagios ~]# tar: usr/local/nagios/etc/cfgprep: Cannot utime: Operation not permitted
-bash: tar:: command not found
[root@nagios ~]# tar: usr/local/nagios/etc: Cannot utime: Operation not permitted
-bash: tar:: command not found
[root@nagios ~]# tar: Exiting with failure status due to previous errors
-bash: tar:: command not found
[root@nagios ~]# /usr/local/nagiosxi/scripts
-bash: /usr/local/nagiosxi/scripts: Is a directory
[root@nagios ~]# RESETTING PERMS
-bash: RESETTING: command not found
[root@nagios ~]# OUTPUT=RESETTING PERMS
-bash: PERMS: command not found
[root@nagios ~]# RETURNCODE=1
[root@nagios ~]# .......
-bash: .......: command not found
[root@nagios ~]# PROCESSED 1 COMMANDS
-bash: PROCESSED: command not found
[root@nagios ~]# clear
[root@nagios ~]# tail -f /usr/local/nagiosxi/var/cmdsubsys.log
...........................................................
PROCESSED 0 COMMANDS
tail: /usr/local/nagiosxi/var/cmdsubsys.log: file truncated
............................................................tail: /usr/local/nagiosxi/var/cmdsubsys.log: file truncated
.
PROCESSED 0 COMMANDS
ING NAGIOSCORE CONFIG...
CMDLINE=cd /usr/local/nagiosxi/scripts && ./reconfigure_nagios.sh
URL: http://localhost/nagiosxi/includes/components/ccm/
CMDLINE
--2017-03-27 09:24:20-- 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’

0K .......... .......... .......... ........ 2.79M=0.01s

2017-03-27 09:24:20 (2.79 MB/s) - ‘nagiosql.login’ saved [38953]

/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=n@gweb' -O nagiosql.loginLOGIN SUCCESSFUL!
IMPORTING CONFIG FILES...URL: http://localhost/nagiosxi/includes/components/ccm/
Array
(
)
RESETTING PERMS
URL: http://localhost/nagiosxi/includes/components/ccm/
CMDLINE
--2017-03-27 09:24:20-- 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’

0K .......... .......... .......... ........ 2.62M=0.01s

2017-03-27 09:24:21 (2.62 MB/s) - ‘nagiosql.login’ saved [38953]

/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=n@gweb' -O nagiosql.loginLOGIN SUCCESSFUL!
URL: http://localhost/nagiosxi/includes/components/ccm/
CMDLINE:
/usr/bin/wget --load-cookies=nagiosql.cookies http://localhost/nagiosxi/includes/components/ccm/ --no-check-certificate --post-data 'backend=1&cmd=apply&type=writeConfig' -O nagiosql.export.monitoring
--2017-03-27 09:24:21-- 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.export.monitoring’

0K .......... .......... . 1.28M=0.02s

2017-03-27 09:24:23 (1.28 MB/s) - ‘nagiosql.export.monitoring’ saved [21683]

WRITE CONFIGS SUCCESSFUL!
OUTPUT:
Nagios Core 4.2.4
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 12-07-2016
License: GPL

Website: https://www.nagios.org
Reading configuration data...
Read main config file okay...
Error: Service has no hosts and/or service_description (config file '/usr/local/nagios/etc/services/zultyscdrdb.cfg', starting on line 42)
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.
RET: 1
/usr/local/nagiosxi/nom/checkpoints/nagioscore/errors /usr/local/nagiosxi/scripts
tar: Removing leading `/' from member names
/usr/local/nagiosxi/scripts
LATEST NOM SNAPSHOT: /usr/local/nagiosxi/nom/checkpoints/nagioscore/1490631707.tar.gz
/ /usr/local/nagiosxi/scripts
RESTORING NOM SNAPSHOT : /usr/local/nagiosxi/nom/checkpoints/nagioscore/1490631707.tar.gz
tar: usr/local/nagios/etc/hosts: Cannot utime: Operation not permitted
tar: usr/local/nagios/etc/import: Cannot utime: Operation not permitted
tar: usr/local/nagios/etc/pnp/check_commands: Cannot utime: Operation not permitted
tar: usr/local/nagios/etc/pnp/pages: Cannot utime: Operation not permitted
tar: usr/local/nagios/etc/pnp: Cannot utime: Operation not permitted
tar: usr/local/nagios/etc/services: Cannot utime: Operation not permitted
tar: usr/local/nagios/etc/static/PassiveObjects/sjccfbnagios.cfsb.lan: Cannot utime: Operation not permitted
tar: usr/local/nagios/etc/static/PassiveObjects: Cannot utime: Operation not permitted
tar: usr/local/nagios/etc/static: Cannot utime: Operation not permitted
tar: usr/local/nagios/etc/tmp: Cannot utime: Operation not permitted
tar: usr/local/nagios/etc/cfgprep/orig: Cannot utime: Operation not permitted
tar: usr/local/nagios/etc/cfgprep: Cannot utime: Operation not permitted
tar: usr/local/nagios/etc: Cannot utime: Operation not permitted
tar: Exiting with failure status due to previous errors
/usr/local/nagiosxi/scripts
RESETTING PERMS
OUTPUT=RESETTING PERMS
RETURNCODE=1
.....................................
PROCESSED 1 COMMANDS
tail: /usr/local/nagiosxi/var/cmdsubsys.log: file truncated
...........

Re: NagiosXI service-hosts setting left empty in file

Posted: Mon Mar 27, 2017 12:48 pm
by avandemore
Please run the following:

Code: Select all

# script -a /tmp/reconfigure.txt
# chage -l nagios
# su - nagios
$ cd /usr/local/nagiosxi/liscripts/
$ ./rescconfigure_nagios.sh
Then send me the file or attach it: /tmp/reconfigure.txt

Re: NagiosXI service-hosts setting left empty in file

Posted: Mon Mar 27, 2017 1:50 pm
by pf_nagios
Using username "root".
Last login: Mon Mar 27 11:35:40 2017 from buffalo-jdix.provident.local
[root@nagios ~]# script -a /tmp/reconfigure.txt
Script started, file is /tmp/reconfigure.txt
[root@nagios ~]# chage -l nagios
Last password change : Nov 23, 2015
Password expires : never
Password inactive : never
Account expires : never
Minimum number of days between password change : 0
Maximum number of days between password change : 99999
Number of days of warning before password expires : 7
[root@nagios ~]# su - nagios
Last login: Mon Mar 27 11:35:55 PDT 2017 on pts/2
[nagios@nagios ~]$ cd /usr/local/nagiosxi/liscripts/
-bash: cd: /usr/local/nagiosxi/liscripts/: No such file or directory
[nagios@nagios ~]$


[root@nagios /]# find -name rescconfigure_nagios.sh



returns nothing.

Thanks, Josh

Re: NagiosXI service-hosts setting left empty in file

Posted: Mon Mar 27, 2017 2:17 pm
by avandemore
Hm, not sure how I ended up with that text. Here is the corrected version:

Code: Select all

# script -a /tmp/reconfigure.txt
# chage -l nagios
# su - nagios
$ cd /usr/local/nagiosxi/scripts/
$ ./reconfigure_nagios.sh

Re: NagiosXI service-hosts setting left empty in file

Posted: Mon Mar 27, 2017 2:35 pm
by pf_nagios
Cool - here's the output, would you like me to try to delete and re-write the config again?


[nagios@nagios ~]$ cd /usr/local/nagiosxi/scripts/
[nagios@nagios scripts]$ ./reconfigure_nagios.sh
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=n@gweb' -O nagiosql.login--2017-03-27 12:34:13-- 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’

[ <=> ] 37,476 --.-K/s in 0.01s

2017-03-27 12:34:13 (2.39 MB/s) - ‘nagiosql.login’ saved [37476]

LOGIN SUCCESSFUL!
IMPORTING CONFIG FILES...URL: http://localhost/nagiosxi/includes/components/ccm/
Array
(
)
RESETTING PERMS
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=n@gweb' -O nagiosql.login--2017-03-27 12:34:14-- 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’

[ <=> ] 37,476 --.-K/s in 0.01s

2017-03-27 12:34:14 (2.70 MB/s) - ‘nagiosql.login’ saved [37476]

LOGIN SUCCESSFUL!
URL: http://localhost/nagiosxi/includes/components/ccm/
CMDLINE:
/usr/bin/wget --load-cookies=nagiosql.cookies http://localhost/nagiosxi/includes/components/ccm/ --no-check-certificate --post-data 'backend=1&cmd=apply&type=writeConfig' -O nagiosql.export.monitoring
--2017-03-27 12:34:14-- 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.export.monitoring’

[ <=> ] 22,833 --.-K/s in 0.01s

2017-03-27 12:34:17 (1.61 MB/s) - ‘nagiosql.export.monitoring’ saved [22833]

WRITE CONFIGS SUCCESSFUL!
OUTPUT:
Nagios Core 4.2.4
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 12-07-2016
License: GPL

Website: https://www.nagios.org
Reading configuration data...
Read main config file okay...
Warning: Duplicate definition found for service 'PING' on host 'sjciccmxark.prod.local' (config file '/usr/local/nagios/etc/services/_multiple_hosts.cfg', starting on line 68)
Warning: Duplicate definition found for service 'PING' on host 'virtualserver-servicing.provident.com' (config file '/usr/local/nagios/etc/services/_multiple_hosts.cfg', starting on line 94)
Warning: Duplicate definition found for service 'PING' on host 'virtualserver-training.provident.com' (config file '/usr/local/nagios/etc/services/_multiple_hosts.cfg', starting on line 94)
Warning: Duplicate definition found for service 'PING' on host 'ns500e1-2-eq-prod.local' (config file '/usr/local/nagios/etc/services/_multiple_hosts.cfg', starting on line 107)
Warning: Duplicate definition found for service 'PING' on host 'ns500e3-1-eq-prod.local' (config file '/usr/local/nagios/etc/services/_multiple_hosts.cfg', starting on line 107)
Warning: Duplicate definition found for service 'PING' on host 'ns5gt-trusted-eq-prod.local' (config file '/usr/local/nagios/etc/services/_multiple_hosts.cfg', starting on line 107)
Warning: Duplicate definition found for service 'PING' on host 'sjcft-4g1-eq-prod-staging.local' (config file '/usr/local/nagios/etc/services/_multiple_hosts.cfg', starting on line 107)
Warning: Duplicate definition found for service 'PING' on host 'sjc350pub' (config file '/usr/local/nagios/etc/services/_multiple_hosts.cfg', starting on line 133)
Warning: Duplicate definition found for service 'PING' on host 'sjciccmxark.prod.local' (config file '/usr/local/nagios/etc/services/ping-check.cfg', starting on line 16)
Warning: Duplicate definition found for service 'www.novahomeloans.servicemyloan.com' on host 'public_sjc_subservicing' (config file '/usr/local/nagios/etc/services/_multiple_hosts.cfg', starting on line 226)
Warning: Duplicate definition found for service 'windows system drive' on host 'betaws1.dev.local' (config file '/usr/local/nagios/etc/services/_multiple_hosts.cfg', starting on line 210)
Warning: Duplicate definition found for service 'PING' on host 'svc-docs2.prod.local' (config file '/usr/local/nagios/etc/services/_multiple_hosts.cfg', starting on line 183)
Warning: Duplicate definition found for service 'PING' on host 'sjc350int' (config file '/usr/local/nagios/etc/services/_multiple_hosts.cfg', starting on line 55)
Warning: Duplicate definition found for service 'PING' on host 'ns500e1-1-eq-prod.local' (config file '/usr/local/nagios/etc/services/_multiple_hosts.cfg', starting on line 42)
Warning: Duplicate definition found for service 'PING' on host 'virtualserver-pfnet.provident.com' (config file '/usr/local/nagios/etc/services/_multiple_hosts.cfg', starting on line 29)
Warning: Duplicate definition found for service 'PING' on host 'sfonasfile1' (config file '/usr/local/nagios/etc/services/_multiple_hosts.cfg', starting on line 16)
Read object config files okay...

Running pre-flight check on configuration data...

Checking objects...
Checked 1593 services.
Checked 339 hosts.
Checked 19 host groups.
Checked 3 service groups.
Warning: Contact 'Dave Means-p' has no service notification time period defined!
Warning: Contact 'Dave Means-p' has no host notification time period defined!
Warning: Contact 'Scott McCullough-p' has no service notification time period defined!
Warning: Contact 'Scott McCullough-p' has no host notification time period defined!
Checked 23 contacts.
Checked 6 contact groups.
Checked 305 commands.
Checked 18 time periods.
Checked 0 host escalations.
Checked 0 service escalations.
Checking for circular paths...
Checked 339 hosts
Checked 0 service dependencies
Checked 0 host dependencies
Checked 18 timeperiods
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...

Total Warnings: 4
Total Errors: 0

Things look okay - No serious problems were detected during the pre-flight check
RET: 0
[nagios@nagios scripts]$


EDIT: I PMed the file output - due to running the find command it contains some information you may not have wanted. A grep should sort it out, appologies for that.