Cannot import host using NCPA Monitoring Wizard

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
genna
Posts: 34
Joined: Mon Aug 14, 2017 8:10 pm

Cannot import host using NCPA Monitoring Wizard

Post 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
kyang

Re: Cannot import host using NCPA Monitoring Wizard

Post 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
genna
Posts: 34
Joined: Mon Aug 14, 2017 8:10 pm

Re: Cannot import host using NCPA Monitoring Wizard

Post 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.
kyang

Re: Cannot import host using NCPA Monitoring Wizard

Post 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.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Cannot import host using NCPA Monitoring Wizard

Post 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

Code: Select all

pear install HTML_Template_IT
- You must restart apache again

Code: Select all

service httpd restart
- Restart services

Code: Select all

service nagios stop
service ndo2db restart
service nagios start
Let us know if this solved your issue. Thank you!
Be sure to check out our Knowledgebase for helpful articles and solutions!
genna
Posts: 34
Joined: Mon Aug 14, 2017 8:10 pm

Re: Cannot import host using NCPA Monitoring Wizard

Post 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:
.RESETTING PERMS
URL: http://localhost/nagiosxi/includes/components/ccm/
CMDLINE
--2017-11-10 16:00:18-- 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’

0K .......... .......... .......... ...... 2.00M=0.02s

2017-11-10 16:00:19 (2.00 MB/s) - ‘nagiosql.login’ saved [37760]

/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.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-11-10 16:00:19-- 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-10 16:00:20 ERROR 500: Internal Server Error.

NAGIOSQL WRITE CONFIGS FAILED!\n
OUTPUT=NAGIOSQL WRITE CONFIGS FAILED!\n
RETURNCODE=5
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Cannot import host using NCPA Monitoring Wizard

Post 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)?

Code: Select all

chage nagios -l
chage apache -l
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
Be sure to check out our Knowledgebase for helpful articles and solutions!
genna
Posts: 34
Joined: Mon Aug 14, 2017 8:10 pm

Re: Cannot import host using NCPA Monitoring Wizard

Post 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)?

Code: Select all

chage nagios -l
chage apache -l
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
kyang

Re: Cannot import host using NCPA Monitoring Wizard

Post 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.
Last edited by kyang on Tue Nov 14, 2017 10:03 am, edited 1 time in total.
genna
Posts: 34
Joined: Mon Aug 14, 2017 8:10 pm

Re: Cannot import host using NCPA Monitoring Wizard

Post by genna »

Hi @kyang
I have posted profile in PM.
Thanks
Genna
Last edited by Anonymous on Wed Nov 15, 2017 10:17 am, edited 1 time in total.
Reason: Profile received! Put in teamshare
Locked