Hi Team,
When ever i am trying to run " apply configuration" button after any change it takes a long time and at the end will show an error message.
Currently i am doing the apply configuration manually.
I tried to verify any errors in the config files.
also i have doubt related to the file permissions as well.
I have restarted and also verified for db error as well.
please find my current file permissions
/usr/local/nagios
drwxrwxr-x 2 nagios nagios 4096 Apr 3 03:44 bin
drwsrwsr-x 7 apache nagios 4096 Apr 3 03:46 etc
drwxr-xr-x 2 root root 4096 May 16 2017 include
drwxrwsr-x 2 apache nagios 4096 Mar 29 05:45 libexec
drwxrwxr-x 2 nagios nagios 4096 May 16 2017 sbin
drwxrwxr-x 18 nagios nagios 4096 May 16 2017 share
drwxrwxr-x 6 nagios nagios 4096 Apr 3 07:25 var
/usr/local/nagiosxi
drwxr-xr-x 2 nagios nagios 4096 Jun 9 2017 cron
drwxr-xr-x 3 nagios nagios 4096 May 16 2017 etc
drwxr-xr-x 19 nagios nagios 4096 May 16 2017 html
drwxr-xr-x 3 nagios nagios 4096 May 16 2017 nom
drwxr-xr-x 2 nagios nagios 4096 Apr 3 04:14 scripts
drwsrwsr-x 2 apache nagios 4096 Feb 23 02:55 tmp
-rw-r----- 1 root root 16935 Oct 30 22:39 tmp_xi_vars.cfg
drwxr-xr-x 2 nagios nagios 4096 May 16 2017 tools
drwxr-xr-x 5 nagios nagios 4096 Apr 3 07:29 var
/usr/local/nagios/etc
-rw-r--r-- 1 nagios nagios 860 Dec 25 21:44 cgi.cfg
-rw-rw-r-- 1 nagios nagios 29745 Apr 3 06:39 commands.cfg
-rw-rw-r-- 1 nagios nagios 1566 Apr 3 06:39 contactgroups.cfg
-rw-rw-r-- 1 nagios nagios 6961 Apr 3 06:39 contacts.cfg
-rw-rw-r-- 1 nagios nagios 1675 Apr 3 06:39 contacttemplates.cfg
-rw-rw-r-- 1 nagios nagios 817 Apr 3 06:39 hostdependencies.cfg
-rw-rw-r-- 1 nagios nagios 819 Apr 3 06:39 hostescalations.cfg
-rw-rw-r-- 1 nagios nagios 837 Apr 3 06:39 hostextinfo.cfg
-rw-rw-r-- 1 nagios nagios 3266 Apr 3 06:39 hostgroups.cfg
drwsrwsr-x 2 apache nagios 12288 Apr 3 06:30 hosts
-rw-rw-r-- 1 nagios nagios 16082 Apr 3 06:39 hosttemplates.cfg
drwsrwsr-x 2 apache nagios 4096 Apr 3 06:30 import
-rwxrwxr-x 1 nagios nagios 5828 Apr 2 11:48 nagios.cfg
-rw-rw-r-- 1 nagios nagios 2229 May 16 2017 ndo2db.cfg
-rw-rw-r-- 1 nagios nagios 4827 May 16 2017 ndomod.cfg
-rw-rw-r-- 1 nagios nagios 8133 Sep 20 2017 nrpe.cfg
-rw-rw-r-- 1 nagios nagios 5345 May 16 2017 nsca.cfg
drwxrwsr-x 4 apache nagios 4096 Apr 2 23:48 pnp
-rw-rw-r-- 1 nagios nagios 0 May 24 2017 recurringdowntime.cfg
-rwxrwxr-x 1 nagios nagios 210 May 16 2017 resource.cfg
-rwxrwxr-x 1 nagios nagios 264 Sep 20 2017 rundeck.sh
-rw-rw-r-- 1 nagios nagios 1627 May 16 2017 send_nsca.cfg
-rw-rw-r-- 1 nagios nagios 823 Apr 3 06:39 servicedependencies.cfg
-rw-rw-r-- 1 nagios nagios 825 Apr 3 06:39 serviceescalations.cfg
-rw-rw-r-- 1 nagios nagios 843 Apr 3 06:39 serviceextinfo.cfg
-rw-rw-r-- 1 nagios nagios 18594 Apr 3 06:39 servicegroups.cfg
-rw-r--r-- 1 nagios nagios 813 Jul 21 2017 servicegroups.cfg.org
drwsrwsr-x 2 apache nagios 12288 Apr 3 06:39 services
-rw-rw-r-- 1 nagios nagios 24852 Apr 3 06:39 servicetemplates.cfg
drwsrwsr-x 2 apache nagios 4096 Mar 5 06:00 static
-rw-rw-r-- 1 nagios nagios 9123 Apr 3 06:39 timeperiods.cfg
-rw-rw---- 1 nagios nagios 50805 Mar 5 06:40 tmp_xi_vars.cfg
Any suggestions to start the troubleshooting.
I already did repair_databases
i tried to identify the error by runinng the nagios -v command and getting the similar error for any files (Line 16 (NULL value) )
[root@va10xxx bin]# nagios -v /usr/local/nagios/etc/contactgroups.cfg
Nagios Core 4.2.4
Reading configuration data...
Error in configuration file '/usr/local/nagios/etc/contactgroups.cfg' - Line 16 (NULL value)
Error processing main config file!
[root@vxxxx bin]# nagios -v /usr/local/nagios/etc/servicegroups.cfg
Nagios Core 4.2.4
Website: https://www.nagios.org
Reading configuration data...
Error in configuration file '/usr/local/nagios/etc/servicegroups.cfg' - Line 16 (NULL value)
Error processing main config file!
Apply Configuration Failure
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Apply Configuration Failure
run this
Also, can you show the output if this
Finally, can you show us the error you see when running apply configuration in the UI?
Code: Select all
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfgCode: Select all
cat /etc/sudoers|grep NAGIOS-
nagios_ant
- Posts: 17
- Joined: Tue Jul 11, 2017 2:03 am
Re: Apply Configuration Failure
Hi Team,
Please find the details
it shows warning only . and sudo- i dont see any entry
Warning: Host 'va10tlvpxxx.com' has no default contacts or contactgroups defined!
Warning: Host 'va10tlvpxxx.wellpoint.com' has no default contacts or contactgroups defined!
Checked 106 hosts.
Checked 7 host groups.
Checked 15 service groups.
Checked 13 contacts.
Checked 5 contact groups.
Checked 148 commands.
Checked 20 time periods.
Checked 0 host escalations.
Checked 0 service escalations.
Checking for circular paths...
Checked 106 hosts
Checked 0 service dependencies
Checked 0 host dependencies
Checked 20 timeperiods
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...
Total Warnings: 34
Total Errors: 0
Things look okay - No serious problems were detected during the pre-flight check
[root@va10xxxx ~]# cat /etc/sudoers | grep NAGIOS
[root@va10xxxx ~]# id nagios
uid=570(nagios) gid=570(nagios) groups=570(nagios),10634(nagcmd)
Please find the details
it shows warning only . and sudo- i dont see any entry
Warning: Host 'va10tlvpxxx.com' has no default contacts or contactgroups defined!
Warning: Host 'va10tlvpxxx.wellpoint.com' has no default contacts or contactgroups defined!
Checked 106 hosts.
Checked 7 host groups.
Checked 15 service groups.
Checked 13 contacts.
Checked 5 contact groups.
Checked 148 commands.
Checked 20 time periods.
Checked 0 host escalations.
Checked 0 service escalations.
Checking for circular paths...
Checked 106 hosts
Checked 0 service dependencies
Checked 0 host dependencies
Checked 20 timeperiods
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...
Total Warnings: 34
Total Errors: 0
Things look okay - No serious problems were detected during the pre-flight check
[root@va10xxxx ~]# cat /etc/sudoers | grep NAGIOS
[root@va10xxxx ~]# id nagios
uid=570(nagios) gid=570(nagios) groups=570(nagios),10634(nagcmd)
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Apply Configuration Failure
This is the problem, someone removed the required nagios entries from the sudoers filenagios_ant wrote:Code: Select all
[root@va10xxxx ~]# cat /etc/sudoers | grep NAGIOS
Let your systems administrator know these entries must be in there
Code: Select all
# NEEDED TO ALLOW NAGIOS TO CHECK SERVICE STATUS
User_Alias NAGIOSXI=nagios
User_Alias NAGIOSXIWEB=apache
NAGIOSXI ALL = NOPASSWD:/etc/init.d/nagios start
NAGIOSXI ALL = NOPASSWD:/etc/init.d/nagios stop
NAGIOSXI ALL = NOPASSWD:/etc/init.d/nagios restart
NAGIOSXI ALL = NOPASSWD:/etc/init.d/nagios reload
NAGIOSXI ALL = NOPASSWD:/etc/init.d/nagios status
NAGIOSXI ALL = NOPASSWD:/etc/init.d/nagios checkconfig
NAGIOSXI ALL = NOPASSWD:/etc/init.d/ndo2db start
NAGIOSXI ALL = NOPASSWD:/etc/init.d/ndo2db stop
NAGIOSXI ALL = NOPASSWD:/etc/init.d/ndo2db restart
NAGIOSXI ALL = NOPASSWD:/etc/init.d/ndo2db reload
NAGIOSXI ALL = NOPASSWD:/etc/init.d/ndo2db status
NAGIOSXI ALL = NOPASSWD:/etc/init.d/npcd start
NAGIOSXI ALL = NOPASSWD:/etc/init.d/npcd stop
NAGIOSXI ALL = NOPASSWD:/etc/init.d/npcd restart
NAGIOSXI ALL = NOPASSWD:/etc/init.d/npcd reload
NAGIOSXI ALL = NOPASSWD:/etc/init.d/npcd status
NAGIOSXI ALL = NOPASSWD:/usr/bin/php /usr/local/nagiosxi/html/includes/components/autodiscovery/scripts/autodiscover_new.php *
NAGIOSXI ALL = NOPASSWD:/usr/local/nagiosxi/html/includes/components/profile/getprofile.sh
NAGIOSXI ALL = NOPASSWD:/usr/local/nagiosxi/scripts/upgrade_to_latest.sh
NAGIOSXI ALL = NOPASSWD:/usr/local/nagiosxi/scripts/change_timezone.sh
NAGIOSXI ALL = NOPASSWD:/usr/local/nagiosxi/scripts/manage_services.sh *
NAGIOSXI ALL = NOPASSWD:/usr/local/nagiosxi/scripts/reset_config_perms.sh
NAGIOSXI ALL = NOPASSWD:/usr/local/nagiosxi/scripts/backup_xi.sh *
NAGIOSXIWEB ALL = NOPASSWD:/usr/bin/tail -100 /var/log/messages
NAGIOSXIWEB ALL = NOPASSWD:/usr/bin/tail -100 /var/log/httpd/error_log
NAGIOSXIWEB ALL = NOPASSWD:/usr/bin/tail -100 /var/log/mysqld.log
NAGIOSXIWEB ALL = NOPASSWD:/usr/bin/php /usr/local/nagiosxi/html/includes/components/autodiscovery/scripts/autodiscover_new.php *
NAGIOSXIWEB ALL = NOPASSWD:/usr/local/nagiosxi/html/includes/components/profile/getprofile.sh
NAGIOSXIWEB ALL = NOPASSWD:/etc/init.d/snmptt restart
NAGIOSXIWEB ALL = NOPASSWD:/usr/local/nagiosxi/scripts/repair_databases.sh
NAGIOSXIWEB ALL = NOPASSWD:/usr/local/nagiosxi/scripts/manage_services.sh *-
nagios_ant
- Posts: 17
- Joined: Tue Jul 11, 2017 2:03 am
Re: Apply Configuration Failure
Thank you for the support..
We are starting nagios as root user. do we require the above sudo access? for nagios user?
We are starting nagios as root user. do we require the above sudo access? for nagios user?
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Apply Configuration Failure
You should not start nagios as root, it should run as nagios.
Also, yes you need to above because there are certain items that also need to run as the apache user, which is part of the nagios group
Also, yes you need to above because there are certain items that also need to run as the apache user, which is part of the nagios group