Page 3 of 4

Re: NagiosXI service-hosts setting left empty in file

Posted: Mon Mar 27, 2017 2:52 pm
by avandemore
Yes but you may wish to review this doc and make sure your sudoers is correct.

You may also want to toggle your TZ:
XI > Admin > System Settings > Timezone > random
XI > Admin > System Settings > Timezone > correct

Also XI > Admin > Check File Permissions

Re: NagiosXI service-hosts setting left empty in file

Posted: Fri Apr 21, 2017 2:11 pm
by pf_nagios
What doc?

I reset- the time zone but I don't think that will change anything.

File permissions reported ok by the 'check file permissions' page.

Re: NagiosXI service-hosts setting left empty in file

Posted: Mon Apr 24, 2017 9:07 am
by avandemore
Yeah including that would be helpful. Here you go:

https://support.nagios.com/kb/article.php?id=34

Re: NagiosXI service-hosts setting left empty in file

Posted: Mon Apr 24, 2017 10:10 am
by pf_nagios
I gave that a try despite this not fitting my symptoms well except both symptom descriptions could include 'applying configuration'. This did not resolve the issue. Do you guys do more in depth trouble shooting through webex or anything? Can I get you more logs?


This is stopping us from updating our nagios configuration at all and this is becoming critical for our IT staff.

Re: NagiosXI service-hosts setting left empty in file

Posted: Mon Apr 24, 2017 1:48 pm
by ssax
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 let it run:

Code: Select all

tail -F /usr/local/nagiosxi/var/cmdsubsys.log
Then try to apply configuration through the web interface and send me the full output of the tail command.

Also, please PM these files as well:

Code: Select all

/usr/local/nagiosxi/html/config.inc.php
/usr/local/nagiosxi/html/includes/components/ccm/config.inc.php
And send the output of these commands:

Code: Select all

echo "STATUS;" | mysql -undoutils -pn@gweb nagios
echo "STATUS;" | mysql -unagiosxi -pn@gweb nagiosxi
echo "STATUS;" | mysql -unagiosql -pn@gweb nagiosql
Thank you

Re: NagiosXI service-hosts setting left empty in file

Posted: Mon Apr 24, 2017 2:10 pm
by pf_nagios
[root@nagios ~]# tail -F /usr/local/nagiosxi/var/cmdsubsys.log
........................................................
PROCESSED 1 COMMANDS
tail: /usr/local/nagiosxi/var/cmdsubsys.log: file truncated
............................PROCESSING COMMAND ID 22...
PROCESS COMMAND: CMD=17, DATA=
APPLYING NAGIOSCORE CONFIG...
CMDLINE=cd /usr/local/nagiosxi/scripts && ./reconfigure_nagios.sh
URL: http://localhost/nagiosxi/includes/components/ccm/
CMDLINE
--2017-04-24 12:06:29-- 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 .......... .......... .......... ..... 1.57M=0.02s

2017-04-24 12:06:30 (1.57 MB/s) - ‘nagiosql.login’ saved [36715]

/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-04-24 12:06:30-- 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.18M=0.02s

2017-04-24 12:06:30 (2.18 MB/s) - ‘nagiosql.login’ saved [36715]

/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-04-24 12:06:31-- 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.58M=0.01s

2017-04-24 12:06:33 (1.58 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/1493047871.tar.gz
/ /usr/local/nagiosxi/scripts
RESTORING NOM SNAPSHOT : /usr/local/nagiosxi/nom/checkpoints/nagioscore/1493047871.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
............................tail: /usr/local/nagiosxi/var/cmdsubsys.log: file truncated
.
PROCESSED 1 COMMANDS

Re: NagiosXI service-hosts setting left empty in file

Posted: Mon Apr 24, 2017 2:17 pm
by ssax
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
- Then attach this file:

Code: Select all

/usr/local/nagios/etc/services/zultyscdrdb.cfg

Re: NagiosXI service-hosts setting left empty in file

Posted: Mon Apr 24, 2017 2:26 pm
by pf_nagios
I attached a pic from the gui where it shows the host is assigned to the service.


[root@nagios ~]# clear
[root@nagios ~]# cat /usr/local/nagios/etc/services/zultyscdrdb.cfg
###############################################################################
#
# Service configuration file
#
# Created by: Nagios Core Config Manager 2.6.5
# Date: 2017-04-24 12:20:43
# 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 service {
service_description chk E disk space
check_command check_nt_disk!E!90!95!
is_volatile 0
max_check_attempts 3
check_interval 20
retry_interval 5
active_checks_enabled 1
passive_checks_enabled 1
check_period 24x7
obsess_over_service 0
check_freshness 0
event_handler_enabled 1
low_flap_threshold 20
high_flap_threshold 30
flap_detection_enabled 1
process_perf_data 0
retain_status_information 1
retain_nonstatus_information 1
notification_interval 1440
notification_period extendedworkhours
notifications_enabled 1
contact_groups GeneralAdmins-e,GeneralAdmins-p
register 1
}

define service {
service_description PING
check_command check-host-alive
is_volatile 0
max_check_attempts 3
check_interval 5
retry_interval 2
active_checks_enabled 1
passive_checks_enabled 1
check_period 24x7
obsess_over_service 1
check_freshness 0
event_handler_enabled 1
low_flap_threshold 1
high_flap_threshold 1
flap_detection_enabled 1
process_perf_data 1
retain_status_information 1
retain_nonstatus_information 1
notification_interval 1440
notification_period 24x7
notifications_enabled 1
contact_groups GeneralAdmins-e,GeneralAdmins-p
register 1
}

###############################################################################
#
# Service configuration file
#
# END OF FILE
#
###############################################################################
[root@nagios ~]#

Re: NagiosXI service-hosts setting left empty in file

Posted: Mon Apr 24, 2017 3:23 pm
by ssax
Let's 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 so that we can get a remote session setup.

Thank you

Re: NagiosXI service-hosts setting left empty in file

Posted: Mon Apr 24, 2017 3:41 pm
by pf_nagios
Great, sent in an email. Thanks for the support thus far.