Page 1 of 2
Cannot import host using NCPA Monitoring Wizard
Posted: Wed Nov 08, 2017 1:15 am
by genna
Hi,
I have installed and configured NCPA listner on a host and checked connectivity from Nagios XI to that host.
I have started NCPA Wizard and went through steps 1,2,3. Press "Finish" - system went to "Waiting for configuration verification....". After 5 minutes it gave an error :
Configuration Error
An error occurred while attempting to apply your configuration to the monitoring engine. Contact your Nagios administrator if this problem persists.
I can see following lines in httpd/error_log
[Wed Nov 08 15:39:42.356408 2017] [:error] [pid 17198] [client 10.56.32.81:59257] PHP Notice: Undefined index: tpl in /usr/local/nagiosxi/html/config/monitoringwizard.php on line 0, referer:
http://10.105.160.71/nagiosxi/config/mo ... wizard.php
[Wed Nov 08 15:39:50.690128 2017] [:error] [pid 16074] [client 10.56.32.81:59268] PHP Notice: Undefined index: tpl in /usr/local/nagiosxi/html/config/monitoringwizard.php on line 0, referer:
http://10.105.160.71/nagiosxi/config/mo ... wizard.php
[Wed Nov 08 15:39:57.329487 2017] [:error] [pid 16095] [client 10.56.32.81:59274] PHP Notice: Undefined index: unit in /usr/local/nagiosxi/html/includes/configwizards/ncpa/ncpa.inc.php on line 687, referer:
http://10.105.160.71/nagiosxi/config/mo ... wizard.php
[Wed Nov 08
15:39:57.329574 2017] [:error] [pid 16095] [client 10.56.32.81:59274] PHP Notice: Undefined index: unit in /usr/local/nagiosxi/html/includes/configwizards/ncpa/ncpa.inc.php on line 709, referer:
http://10.105.160.71/nagiosxi/config/mo ... wizard.php
[Wed Nov 08
15:45:04.424408 2017] [:error] [pid 16070] [client 127.0.0.1:35472] PHP Fatal error: Class 'HTML_Template_IT' not found in /usr/local/nagiosxi/html/includes/components/ccm/classes/config_class.php on line 988
It happens on two Nagios XI servers one running 5.4.9 the other 5.4.10 and both ruing PHP 5.6
Re: Cannot import host using NCPA Monitoring Wizard
Posted: Wed Nov 08, 2017 10:23 am
by kyang
What is the NCPA version that you install on the client machine? What is the version of the "NCPA Agent" wizard that you are currently using?
Admin->Manage Config Wizards
Run the following command on the Nagios XI server and show the output:
Code: Select all
/usr/local/nagios/libexec/check_ncpa.py -V
Re: Cannot import host using NCPA Monitoring Wizard
Posted: Wed Nov 08, 2017 6:38 pm
by genna
kyang wrote:What is the NCPA version that you install on the client machine?
2.0.5
kyang wrote:What is the version of the "NCPA Agent" wizard that you are currently using?
Admin->Manage Config Wizards
1.4.4
kyang wrote:
Run the following command on the Nagios XI server and show the output:
Code: Select all
/usr/local/nagios/libexec/check_ncpa.py -V
Code: Select all
[root@int-dev-nag-wm ~]# /usr/local/nagios/libexec/check_ncpa.py -V
check_ncpa.py, Version 1.1.1
[root@int-dev-nag-wm ~]# /usr/local/nagios/libexec/check_ncpa.py -H 10.105.160.111 -t TcV8ZuVhsV7cgAnI -M 'memory/virtual/percent'
OK: Percent was 20.20 % | 'percent'=20.20%;;;
[root@int-dev-nag-wm ~]#
So it appears that there are no connectivity issues between XI server and a client machine.
Re: Cannot import host using NCPA Monitoring Wizard
Posted: Thu Nov 09, 2017 10:18 am
by kyang
Okay, I see that you have an older version of the Config Wizard.
Update it by going to Admin --> Manage Config --> Check for Updates --> scroll down to the NCPA wizard and install update.
Once finished, you should be on 1.5.1
After that try using the Config Wizard again, and tell us the result.
Re: Cannot import host using NCPA Monitoring Wizard
Posted: Thu Nov 09, 2017 10:48 am
by lmiltchev
I am not sure what procedure you followed while upgrading the PHP to 5.6, but you need to make sure that
pear dependencies are installed.
- Must install ssh2 (either using pecl or by using php<version>-pecl-ssh2 if available) -
run each command separately one at a time
Code: Select all
yum install -y libssh2-devel
pecl install ssh2
echo "extension=ssh2.so" > /etc/php.d/ssh2.ini
- Must install HTML_Template_IT from pear
- You must restart apache again
- Restart services
Code: Select all
service nagios stop
service ndo2db restart
service nagios start
Let us know if this solved your issue. Thank you!
Re: Cannot import host using NCPA Monitoring Wizard
Posted: Fri Nov 10, 2017 12:07 am
by genna
Hi @kyang
Template Update did not help
Hi @lmiltchev
I have done those steps when moved to PHP 5.6
Also it appears the problem is not limited to NCPA Monitoiring Wizard. It happens every time I apply configuration change. When I apply config change I can see in cmdsubsys.log a lot of messages :
.Another reconfigure process is still running, sleeping...
Eventually it errors out with following entry in the log:
Re: Cannot import host using NCPA Monitoring Wizard
Posted: Fri Nov 10, 2017 10:45 am
by lmiltchev
I see "500 Internal Server Error" in the log. Are you using a proxy or SSL?
Do you see the same error, when you run reconfigure_nagios.sh from the command line as nagios user?
Code: Select all
su nagios
cd /usr/local/nagiosxi/scripts
./reconfigure_nagios.sh
Have you tried resetting the permissions?
Code: Select all
/usr/local/nagiosxi/scripts/reset_config_perms.sh
Is the nagios or apache user accounts expired (not active)?
Do you see config errors when you run the Write Config Tool from the web UI (CCM > Tools > Config File Management > Write Configs > Verify Files)?
What is the "max_execution_time" value in the php.ini file?
Code: Select all
grep max_execution_time /etc/php.ini
Re: Cannot import host using NCPA Monitoring Wizard
Posted: Sun Nov 12, 2017 5:55 pm
by genna
lmiltchev wrote:I see "500 Internal Server Error" in the log. Are you using a proxy or SSL?
I'm not sure I understand the question. Are we using proxy or SSL between what and what? The error is appearing inside nagios log performing a nagios internal command. The 500 response it to
http://localhost request so I doubt either ssl or proxy is in play.
lmiltchev wrote:Do you see the same error, when you run reconfigure_nagios.sh from the command line as nagios user?
Code: Select all
su nagios
cd /usr/local/nagiosxi/scripts
./reconfigure_nagios.sh
Yes I do
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://loca lhost/nagiosxi/includes/components/ccm/ --no-check-certificate --post-data 'subm it=Login&hidelog=true&loginSubmitted=true&backend=1&username=nagiosxi&password=5 XU7Aq7W9PMN' -O nagiosql.login--2017-11-13 09:05:00-- http://localhost/nagiosxi /includes/components/ccm/
Resolving localhost (localhost)... 127.0.0.1, ::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,760 --.-K/s in 0.05s
2017-11-13 09:05:01 (750 KB/s) - ‘nagiosql.login’ saved [37760]
LOGIN SUCCESSFUL!
IMPORTING CONFIG FILES...URL: http://localhost/nagiosxi/includes/components/ccm/
Array
(
)
Another reconfigure process is still running, sleeping...
........ 2 pages of the above message .......
Another reconfigure process is still running, sleeping...
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=5XU7Aq7W9PMN' -O nagiosql.login--2017-11-13 09:10:03-- http://localhost/nagiosxi/includes/components/ccm/
Resolving localhost (localhost)... 127.0.0.1, ::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,760 --.-K/s in 0.02s
2017-11-13 09:10:03 (1.85 MB/s) - ‘nagiosql.login’ saved [37760]
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-11-13 09:10:04-- http://localhost/nagiosxi/includes/components/ccm/
Resolving localhost (localhost)... 127.0.0.1, ::1
Connecting to localhost (localhost)|127.0.0.1|:80... connected.
HTTP request sent, awaiting response... 500 Internal Server Error
2017-11-13 09:10:04 ERROR 500: Internal Server Error.
NAGIOSQL WRITE CONFIGS FAILED!\n
lmiltchev wrote:
Have you tried resetting the permissions?
Code: Select all
/usr/local/nagiosxi/scripts/reset_config_perms.sh
I have tried that and it did not help
lmiltchev wrote:
Is the nagios or apache user accounts expired (not active)?
No. They are set to never expire
Code: Select all
> chage nagios -l
Last password change : Sep 18, 2017
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
> chage apache -l
Last password change : Sep 18, 2017
Password expires : never
Password inactive : never
Account expires : never
Minimum number of days between password change : -1
Maximum number of days between password change : -1
Number of days of warning before password expires : -1
lmiltchev wrote:
Do you see config errors when you run the Write Config Tool from the web UI (CCM > Tools > Config File Management > Write Configs > Verify Files)?
I don't think so. When I press "Write Configs" screen goes blank ( except menus on top and left . No errors in the cmdsubsys.log. "Verify Files" works
lmiltchev wrote:
What is the "max_execution_time" value in the php.ini file?
Code: Select all
grep max_execution_time /etc/php.ini
Code: Select all
> grep max_execution_time /etc/opt/rh/rh-php56/php.ini
max_execution_time = 60
Re: Cannot import host using NCPA Monitoring Wizard
Posted: Mon Nov 13, 2017 12:27 pm
by kyang
Can you send us your system profile from Admin -> System Config -> System Profile -> Download Profile
You can either PM me or post it through here.
This will give us access to many of the logs we would otherwise ask for individually. If security is a concern, you can unzip the profile take out what you like, and then zip it up again. We may end up needing something you remove, but we can ask for that specifically.
Re: Cannot import host using NCPA Monitoring Wizard
Posted: Tue Nov 14, 2017 7:16 pm
by genna
Hi @kyang
I have posted profile in PM.
Thanks
Genna