Page 1 of 2

Status Not Applied

Posted: Mon Jun 29, 2015 1:59 pm
by daveinvb
When I make updates to a host and apply configuration, the status says Not Applied. At first I didn't think this was an issue, but now I'm seeing that I am continuing to get notifications for hosts that I updated previously today. I checked the time settings and what Nagios is set to and what the sever is set to match.

Re: Status Not Applied

Posted: Mon Jun 29, 2015 2:07 pm
by abrist
What version are you running? There was a bug concerning this that was fixed in 2014r2.7.

Re: Status Not Applied

Posted: Mon Jun 29, 2015 2:14 pm
by daveinvb
Nagios XI 2014R2.7

Re: Status Not Applied

Posted: Mon Jun 29, 2015 2:21 pm
by abrist
Lets force a rewrite of all the configs. Go to CCM --> write config files --> Click "Delete", then "Write", and then finally "Verify". If all is ok, run another apply configuration.
If you are still have issues, check for db errors:

Code: Select all

tail -25 /var/log/mysqld.log
And then, just for good measure, check your system time and then force a restart on mysqld and try to apply config one more time:

Code: Select all

date
service mysqld restart

Re: Status Not Applied

Posted: Mon Jun 29, 2015 2:25 pm
by ssax
In addtion to abrists post, if it's still not working, please post the output of these commands:

Code: Select all

date
* Change hosts to services if it's a service and the config file name to one that is showing "Not Applied".

Code: Select all

ls -l /usr/local/nagios/etc/hosts/yourhostwithissue.cfg

Re: Status Not Applied

Posted: Mon Jun 29, 2015 2:35 pm
by daveinvb

Code: Select all

Nagios Core 4.0.8 
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors 
Copyright (c) 1999-2009 Ethan Galstad 
Last Modified: 08-12-2014 
License: GPL 

Website: http://www.nagios.org 
Reading configuration data... 
Read main config file okay... 
Read object config files okay... 

Running pre-flight check on configuration data... 

Checking objects... 
Checked 8 services. 
Checked 1025 hosts. 
Checked 55 host groups. 
Checked 3 service groups. 
Checked 11 contacts. 
Checked 7 contact groups. 
Checked 124 commands. 
Checked 12 time periods. 
Checked 0 host escalations. 
Checked 0 service escalations. 
Checking for circular paths... 
Checked 1025 hosts 
Checked 0 service dependencies 
Checked 0 host dependencies 
Checked 12 timeperiods 
Checking global event handlers... 
Checking obsessive compulsive processor commands... 
Checking misc settings... 

Total Warnings: 0 
Total Errors: 0 

Things look okay - No serious problems were detected during the pre-flight check 

Code: Select all

sudo tail -25 /var/log/mariadb/mariadb.log
150618 14:54:32 [Note] /usr/libexec/mysqld: ready for connections.
Version: '5.5.41-MariaDB'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  MariaDB Server
150625 10:00:14 [Note] /usr/libexec/mysqld: Normal shutdown

150625 10:00:14 [Note] Event Scheduler: Purging the queue. 0 events
150625 10:00:14  InnoDB: Starting shutdown...
150625 10:00:15  InnoDB: Shutdown completed; log sequence number 1597945
150625 10:00:15 [Note] /usr/libexec/mysqld: Shutdown complete

150625 10:00:15 mysqld_safe mysqld from pid file /var/run/mariadb/mariadb.pid ended
150625 10:01:25 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
150625 10:01:25 InnoDB: The InnoDB memory heap is disabled
150625 10:01:25 InnoDB: Mutexes and rw_locks use GCC atomic builtins
150625 10:01:25 InnoDB: Compressed tables use zlib 1.2.7
150625 10:01:25 InnoDB: Using Linux native AIO
150625 10:01:25 InnoDB: Initializing buffer pool, size = 128.0M
150625 10:01:25 InnoDB: Completed initialization of buffer pool
150625 10:01:25 InnoDB: highest supported file format is Barracuda.
150625 10:01:25  InnoDB: Waiting for the background threads to start
150625 10:01:26 Percona XtraDB (http://www.percona.com) 5.5.40-MariaDB-36.1 started; log sequence number 1597945
150625 10:01:26 [Note] Plugin 'FEEDBACK' is disabled.
150625 10:01:26 [Note] Server socket created on IP: '0.0.0.0'.
150625 10:01:26 [Note] Event Scheduler: Loaded 0 events
150625 10:01:26 [Note] /usr/libexec/mysqld: ready for connections.
Version: '5.5.41-MariaDB'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  MariaDB Server

Code: Select all

$ date
Mon Jun 29 15:26:42 EDT 2015

Code: Select all

$ sudo service mysqld restart
Redirecting to /bin/systemctl restart  mysqld.service
Failed to issue method call: Unit mysqld.service failed to load: No such file or directory.
It's happening to numerous hosts, but here is one

Code: Select all

-rw-r--r-- 1 apache nagios 1127 Jun 29 15:24 Clayton Core.cfg

Re: Status Not Applied

Posted: Mon Jun 29, 2015 2:45 pm
by ssax
Oh, you're using mariadb, you probably want to run:

Code: Select all

systemctl restart mariadb.service
When did you last modify that Clayton Core.cfg host/service? It's only 2 minutes behind the time now, did you edit it earlier today and it put the time in the future or did you really just modify it 2 minutes ago?

Re: Status Not Applied

Posted: Mon Jun 29, 2015 2:54 pm
by daveinvb
I restarted mariadb, and no change.

The time is due to the time that I deleted the config files and re-wrote them. I deleted them again after restarting mariadb and this is the result.

Code: Select all

-rw-r--r-- 1 apache nagios 1127 Jun 29 15:51 Clayton Core.cfg
However, many of my host objects still say "Not Applied".

Re: Status Not Applied

Posted: Mon Jun 29, 2015 3:27 pm
by tgriep
Run the following in a shell, Apply the Configuration and post the output of the tail command back here.

Code: Select all

tail -f /usr/local/nagiosxi/var/cmdsubsys.log

Re: Status Not Applied

Posted: Mon Jun 29, 2015 4:29 pm
by daveinvb

Code: Select all

]# tail -f /usr/local/nagiosxi/var/cmdsubsys.log
.......
PROCESSED 0 COMMANDS

APPLYING NAGIOSCORE CONFIG...
CMDLINE=cd /usr/local/nagiosxi/scripts && ./reconfigure_nagios.sh
URL: http://localhost/nagiosxi/includes/components/ccm/
CMDLINE
--2015-06-29 17:26:24--  http://localhost/nagiosxi/includes/components/ccm/
Resolving localhost (localhost)... ::1, 127.0.0.1
Connecting to localhost (localhost)|::1|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: ‘nagiosql.login’

     0K ..........                                             1.51M=0.007s

2015-06-29 17:26:25 (1.51 MB/s) - ‘nagiosql.login’ saved [10379]

/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&username=nagiosxi&password=n@gweb' -O nagiosql.loginLOGIN SUCCESSFUL!
IMPORTING CONFIG FILES...URL: http://localhost/nagiosxi/includes/components/ccm/
Array
(
)
RESETTING PERMS
SETUID ROOT OK
URL: http://localhost/nagiosxi/includes/components/ccm/
CMDLINE
--2015-06-29 17:26:25--  http://localhost/nagiosxi/includes/components/ccm/
Resolving localhost (localhost)... ::1, 127.0.0.1
Connecting to localhost (localhost)|::1|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: ‘nagiosql.login’

     0K ..........                                             1.69M=0.006s

2015-06-29 17:26:25 (1.69 MB/s) - ‘nagiosql.login’ saved [10379]

/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&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 'cmd=apply&type=writeConfig' -O nagiosql.export.monitoring
--2015-06-29 17:26:25--  http://localhost/nagiosxi/includes/components/ccm/
Resolving localhost (localhost)... ::1, 127.0.0.1
Connecting to localhost (localhost)|::1|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: ‘nagiosql.export.monitoring’

     0K .......... .....                                       2.31K=6.7s

2015-06-29 17:26:32 (2.31 KB/s) - ‘nagiosql.export.monitoring’ saved [15813]

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

Website: http://www.nagios.org
Reading configuration data...
   Read main config file okay...
   Read object config files okay...

Running pre-flight check on configuration data...

Checking objects...
        Checked 8 services.
        Checked 1026 hosts.
        Checked 55 host groups.
        Checked 3 service groups.
        Checked 11 contacts.
        Checked 7 contact groups.
        Checked 124 commands.
        Checked 12 time periods.
        Checked 0 host escalations.
        Checked 0 service escalations.
Checking for circular paths...
        Checked 1026 hosts
        Checked 0 service dependencies
        Checked 0 host dependencies
        Checked 12 timeperiods
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...

Total Warnings: 0
Total Errors:   0

Things look okay - No serious problems were detected during the pre-flight check
RET: 0
OUTPUT=RET: 0
RETURNCODE=0
............................tail: /usr/local/nagiosxi/var/cmdsubsys.log: file truncated
.
PROCESSED 1 COMMANDS