Not changes applied after apply configuration

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
cristhofer.perez
Posts: 12
Joined: Fri Jun 05, 2015 6:43 am

Not changes applied after apply configuration

Post by cristhofer.perez »

Hello to everyone,

I can add host and services without any problem. Besides, I can delete too. The problem appears when I want to change any service characteristic as warning or critical values. I change them, save and apply the new configuration. The process finished without problems. I try using /usr/local/nagiosxi/scripts/reconfigure_nagios.sh and via web.

Have you got any idea where can be the problem?

I am using CentOS release 6.6.

Via web ...
Command submitted for processing...
Waiting for configuration verification......
Configuration applied successfully.
Success! Nagios Core was restarted with an updated configuration.

Via reconfigure_nagios.sh
(I deleted some urls to send this post)
bash-4.1# ./reconfigure_nagios.sh
URL: 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&username=nagiosxi&password=n@gweb' -O nagiosql.login--2015-06-16 09:05:57-- localhost/nagiosxi/includes/components/ccm/
Resolving localhost... ::1, 127.0.0.1
Connecting to localhost|::1|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: “nagiosql.login”

[ <=> ] 11,165 --.-K/s in 0s

2015-06-16 09:05:57 (761 MB/s) - “nagiosql.login” saved [11165]

LOGIN SUCCESSFUL!
IMPORTING CONFIG FILES...URL: localhost/nagiosxi/includes/components/ccm/
Array
(
)
SETUID ROOT OK
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&username=nagiosxi&password=n@gweb' -O nagiosql.login--2015-06-16 09:05:58-- http://localhost/nagiosxi/includes/components/ccm/
Resolving localhost... ::1, 127.0.0.1
Connecting to localhost|::1|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: “nagiosql.login”

[ <=> ] 11,165 --.-K/s in 0s

2015-06-16 09:05:58 (710 MB/s) - “nagiosql.login” saved [11165]

LOGIN SUCCESSFUL!
URL: localhost/nagiosxi/includes/components/ccm/
CMDLINE:
/usr/bin/wget --load-cookies=nagiosql.cookies localhost/nagiosxi/includes/components/ccm/ --no-check-certificate --post-data 'cmd=apply&type=writeConfig' -O nagiosql.export.monitoring
--2015-06-16 09:05:58-- localhost/nagiosxi/includes/components/ccm/
Resolving localhost... ::1, 127.0.0.1
Connecting to localhost|::1|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: “nagiosql.export.monitoring”

[ <=> ] 14,019 --.-K/s in 0.01s

2015-06-16 09:05:59 (1.25 MB/s) - “nagiosql.export.monitoring” saved [14019]

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 14 services.
Warning: Host 'testing' has no default contacts or contactgroups defined!
Checked 3 hosts.
Checked 9 host groups.
Checked 7 service groups.
Checked 2 contacts.
Checked 2 contact groups.
Checked 119 commands.
Checked 8 time periods.
Checked 0 host escalations.
Checked 0 service escalations.
Checking for circular paths...
Checked 3 hosts
Checked 0 service dependencies
Checked 0 host dependencies
Checked 8 timeperiods
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...

Total Warnings: 1
Total Errors: 0

Things look okay - No serious problems were detected during the pre-flight check
RET: 0
Running configuration check...
Stopping nagios:. done.
Starting nagios: done.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Not changes applied after apply configuration

Post by lmiltchev »

So when you modify the warning or critical thresholds, and apply configuration (or run reconfigure_nagios.sh) , changes don't take effect, correct? What is the Nagios XI version that you are currently using? Run the following commands and show us the output:

Code: Select all

uname -a
cat /etc/*release
Also, run:

Code: Select all

su nagios
cd /usr/local/nagiosxi/scripts
./reconfigure_nagios.sh &> /tmp/reconfig.txt
and post the "reconfig.txt" file, that was created in the "/tmp/" directory by running the above command.
Be sure to check out our Knowledgebase for helpful articles and solutions!
cristhofer.perez
Posts: 12
Joined: Fri Jun 05, 2015 6:43 am

Re: Not changes applied after apply configuration

Post by cristhofer.perez »

Hello Imiltchev, thanks for your response.


So when you modify the warning or critical thresholds, and apply configuration (or run reconfigure_nagios.sh) , changes don't take effect, correct? What is the Nagios XI version that you are currently using? Run the following commands and show us the output:

Yes, changes don't take effect.

The NagiosXI version is Nagios XI 2014R2.7

Code: Select all

uname -a
cat /etc/*release

# cat /etc/*release
CentOS release 5.5

Code: Select all

# ./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&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
/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
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 14 services.
Warning: Host 'test' has no default contacts or contactgroups defined!
        Checked 3 hosts.
        Checked 9 host groups.
        Checked 7 service groups.
        Checked 2 contacts.
        Checked 2 contact groups.
        Checked 119 commands.
        Checked 8 time periods.
        Checked 0 host escalations.
        Checked 0 service escalations.
Checking for circular paths...
        Checked 3 hosts
        Checked 0 service dependencies
        Checked 0 host dependencies
        Checked 8 timeperiods
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...

Total Warnings: 1
Total Errors:   0

Things look okay - No serious problems were detected during the pre-flight check
RET: 0
Running configuration check...
Stopping nagios:. done.
Starting nagios: done.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Not changes applied after apply configuration

Post by lmiltchev »

I don't see any errors in the output. Let's try a couple of things.

1. Go to: Configure->Core Config Manager->Services->select "localhost" from the "Filter by Config Name" drop-down menu and click on the "View Text Config" actions button (the diskette icon). Show us the "Current Users" service definition. The "default" config should look like this:

Code: Select all

define service {
	host_name			localhost
	service_description		Current Users
	use				local-service
	check_command			check_local_users!20!50
	register			1
	}
2. Go to Configure->Core Config Manager->Services->select "localhost" from the "Filter by Config Name" drop-down menu and click on the "Current Users". Change the warning and critical thresholds in the $ARG1$ and $ARG2$ fields to let's say 1 and 5. Click on "Save". Apply Configuration.

3. Go back to the CCM, click on the "View Text Config" actions button (the diskette icon), and show us the "Current Users" service definition once again. Did the thresholds change. Did they change in the actual config (flat file)?

Code: Select all

cat /usr/local/nagios/etc/services/localhost.cfg
BTW, did you try modifying the threshold via the CCM or by going to:

Code: Select all

Home->Service Detail-><your service>->Configure->Re-configure this service
and modifying the thresholds in the "Monitor the service with this command..." field?
Be sure to check out our Knowledgebase for helpful articles and solutions!
cristhofer.perez
Posts: 12
Joined: Fri Jun 05, 2015 6:43 am

Re: Not changes applied after apply configuration

Post by cristhofer.perez »

Hello Imiltchev, thanks for your response.

I use all the tools that you told me. Thanks they were very usefull.

I saw that when I apply the changes they were saving on .cfg files. The problem seems to be something about the service status. It not change!
I force that a service from critical status to ok status. For example:


PROCS OK: 45 processes with STATE = RSZDT

I change the service to:

Code: Select all

define service {
	host_name			localhost
	service_description		Total Processes
	use					local-service
	check_command		check_local_procs!10!30!RSZDT!!!!!
	register				1
	}	

On advance settings I have:
Performance Data: procs=45;250;400;0;

This service must be critical and I think that performance date range must be 10;30

NOTES:
I am using the lastest version of NCPA on clients.
The NagiosXI version is Nagios XI 2014R2.7
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Not changes applied after apply configuration

Post by abrist »

Are you changing the config files themselves (will not work), or are you altering the thresholds through the CCM (proper way)?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
cristhofer.perez
Posts: 12
Joined: Fri Jun 05, 2015 6:43 am

Re: Not changes applied after apply configuration

Post by cristhofer.perez »

Hello,

I was using the CCM. At last, I checked the database too and the service changes was write properly. The values of warning and critical changed properly but not take effects in web.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Not changes applied after apply configuration

Post by lmiltchev »

Let's stop/start/restart the services - run:

Code: Select all

service nagios stop
killall nagios
service ndo2db stop
service ndo2db start
service nagios start
service mysqld restart
service crond restart
If this didn't fix your issue, go to:

Admin->System Profile->Download Profile

save and PM me the "profile.zip".
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Not changes applied after apply configuration

Post by tgriep »

Could you run the following to see if this fixes the issue?

Code: Select all

service mysqld stop
cd /var/lib/mysql/nagios
myisamchk -r -f *
service mysqld start
rm -f /usr/local/nagiosxi/var/dbmaint.lock
php /usr/local/nagiosxi/cron/dbmaint.php
Could you upload this file so we can review it?

Code: Select all

/etc/my.cnf
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Not changes applied after apply configuration

Post by lmiltchev »

In addition to what tgrip said, I noticed that your php and system time is out of sync.

Code: Select all

===Date/Time====

PHP Timezone: UTC 
PHP Time: Thu, 18 Jun 2015 08:14:35 +0000
System Time: Thu, 18 Jun 2015 04:14:35 -0400
You will need to fix that as this can also be causing issues. Please, follow the steps outlined in the document below:

https://assets.nagios.com/downloads/nag ... m_Time.pdf
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked