Page 1 of 2

Web update says it fails, but shows as at newst version

Posted: Mon Oct 12, 2015 8:26 am
by SavaSC
Hello,

The web update is acting weird on one of my NagiosXI instances. When I run it it tells me "The update did not complete successfully. Please try updating manually." However, if I tell it to check for updates again it comes back that I am now at the newest version. Here is the output on the web update page.

Code: Select all

---- Starting Nagios XI Backup ----
Backing up Core Config Manager (NagiosQL)...
tar: Removing leading `/' from member names
tar: Removing leading `/' from member names
Backing up Nagios Core...
tar: Removing leading `/' from member names
tar: /usr/local/nagios/var/rw/nagios.qh: socket ignored
tar: /usr/local/nagios/var/ndo.sock: socket ignored
Backing up Nagios XI...
tar: Removing leading `/' from member names
Backing up MRTG...
tar: Removing leading `/' from member names
Backing up NRDP...
tar: Removing leading `/' from member names
Backing up Nagvis...
tar: Removing leading `/' from member names
Backing up MySQL databases...
Backing up PostgresQL databases...
Backing up logrotate config files...
Backing up Apache config files...
Compressing backup...
 
===============
BACKUP COMPLETE
===============
Backup stored in /store/backups/nagiosxi/autoupgrade_backup..tar.gz

---- Starting Nagios XI Upgrade ----
Cleaning up temp directory...
Downloading Latest Nagios XI Tarball...
Checking required prereqs... 
Please wait... 

OLD VERSION: 511
Saving old crontab to /tmp/nagios.crontab.orig.3...
Removing XI cron jobs...
Saving old crontab to /tmp/root.crontab.orig.3...
Removing XI cron jobs...
Archive:  sourceguardian/ixed4.lin.x86-32.zip
  inflating: /usr/lib/php/modules/ixed.5.1.lin  
Sourceguardian extension found for PHP version 5.1
Sourceguardian extension already in php.ini
Copying over new XI directory...
Updating NagiosQL...
NAGIOSQL-POST
Patching NDOUtils...
NDOUtils already patched at level 103
Updating sequences...
Could not open input file: /usr/local/nagiosxi/tmp/nagiosxi/nagiosxi/basedir/tools/import_xiconfig.php
Nagios XI Postgres Database Sequence Information

OLD VALUES
--------------
xi_commands_command_id_seq = 10738
xi_events_event_id_seq = 1742009
xi_meta_meta_id_seq = 1742367
xi_options_option_id_seq = 130
xi_sysstat_sysstat_id_seq = 99
xi_usermeta_usermeta_id_seq = 1793
xi_users_user_id_seq = 66

NEW VALUES
--------------
xi_commands_command_id_seq = 10738
xi_events_event_id_seq = 1742009
xi_meta_meta_id_seq = 1742367
xi_options_option_id_seq = 130
xi_sysstat_sysstat_id_seq = 99
xi_usermeta_usermeta_id_seq = 1793
xi_users_user_id_seq = 66

Installing new PNP templates...
Updating init script...
Enabling large install tweaks...
Fixing config file permissions...
Fixing htpasswd permissions...
Checking group memberships...
Installing new XI templates...
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=mqe860' -O nagiosql.login--2015-10-12 08:16:19--  http://localhost/nagiosxi/includes/components/ccm/
Resolving localhost... 127.0.0.1
Connecting to localhost|127.0.0.1|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: `nagiosql.login'

     0K .......... .......... .......... ....                   482K=0.07s

2015-10-12 08:16:20 (482 KB/s) - `nagiosql.login' saved [35678]

LOGIN SUCCESSFUL!
IMPORTING CONFIG FILES...URL: http://localhost/nagiosxi/includes/components/ccm/
Array
(
    [0] => xi_timeperiod_24x7.cfg
)
IMPORTING /usr/local/nagios/etc/import/xi_timeperiod_24x7.cfg
CMDLINE:
/usr/bin/wget --load-cookies=nagiosql.cookies http://localhost/nagiosxi/includes/components/ccm/ --no-check-certificate --post-data 'cmd=admin&type=import&importsubmitted=true&chbOverwrite=1&subForm=Import&selImportFile[]=/usr/local/nagios/etc/import/xi_timeperiod_24x7.cfg' -O nagiosql.import.monitoring
--2015-10-12 08:16:20--  http://localhost/nagiosxi/includes/components/ccm/
Resolving localhost... 127.0.0.1
Connecting to localhost|127.0.0.1|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: `nagiosql.import.monitoring'

     0K .......... .......... .......... .......... .......... 1.83M
    50K ..                                                     4.72M=0.03s

2015-10-12 08:16:21 (1.91 MB/s) - `nagiosql.import.monitoring' saved [53673]

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=mqe860' -O nagiosql.login--2015-10-12 08:16:21--  http://localhost/nagiosxi/includes/components/ccm/
Resolving localhost... 127.0.0.1
Connecting to localhost|127.0.0.1|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: `nagiosql.login'

     0K .......... .......... .......... ....                  1.28M=0.03s

2015-10-12 08:16:22 (1.28 MB/s) - `nagiosql.login' saved [35678]

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 'cmd=apply&type=writeConfig' -O nagiosql.export.monitoring
--2015-10-12 08:16:22--  http://localhost/nagiosxi/includes/components/ccm/
Resolving localhost... 127.0.0.1
Connecting to localhost|127.0.0.1|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: `nagiosql.export.monitoring'

     0K .......... ....                                        26.6K=0.5s

2015-10-12 08:16:23 (26.6 KB/s) - `nagiosql.export.monitoring' saved [14949]

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

Website: https://www.nagios.org
Reading configuration data...
   Read main config file okay...
Error: Template 'use' specified in host definition could not be not found (config file '/usr/local/nagios/etc/hosttemplates.cfg', starting on line 361)
   Error processing object config files!


***> One or more problems was encountered while processing the config files...

     Check your configuration file(s) to ensure that they contain valid
     directives and data defintions.  If you are upgrading from a previous
     version of Nagios, you should be aware that some variables/definitions
     may have been removed or modified in this version.  Make sure to read
     the HTML documentation regarding the config files, as well as the
     'Whats New' section to find out what has changed.
RET: 1
/usr/local/nagiosxi/nom/checkpoints/nagioscore/errors /usr/local/nagiosxi/scripts
tar: Removing leading `/' from member names
/usr/local/nagiosxi/scripts
LATEST NOM SNAPSHOT: /usr/local/nagiosxi/nom/checkpoints/nagioscore/1444582082.tar.gz
/ /usr/local/nagiosxi/scripts
RESTORING NOM SNAPSHOT : /usr/local/nagiosxi/nom/checkpoints/nagioscore/1444582082.tar.gz
/usr/local/nagiosxi/scripts
RESETTING PERMS
Any suggestions?

Re: Web update says it fails, but shows as at newst version

Posted: Mon Oct 12, 2015 12:35 pm
by tgriep
There was a bug in XI 5R1.0 that was fixed in the release from last Thursday.
There are errors in your hosttemplates.cfg file. Can you post the following file so we can review it?

Code: Select all

/usr/local/nagios/etc/hosttemplates.cfg

Re: Web update says it fails, but shows as at newst version

Posted: Mon Oct 12, 2015 12:55 pm
by SavaSC
I was just looking at that error. Here is the file.

Re: Web update says it fails, but shows as at newst version

Posted: Mon Oct 12, 2015 1:35 pm
by tgriep
The hosttemplate file is good. It looks like the error from the upgrade did a restore to a previous good snapshot to the file you uploaded doesn't have the error.
What version of XI did you upgrade to?

Re: Web update says it fails, but shows as at newst version

Posted: Mon Oct 12, 2015 1:41 pm
by SavaSC
Version 5.2 from 5R1

Re: Web update says it fails, but shows as at newst version

Posted: Mon Oct 12, 2015 2:06 pm
by tgriep
Does the hosttemplates.cfg look complete to you?
Are you receiving any errors when you apply the config?

Re: Web update says it fails, but shows as at newst version

Posted: Mon Oct 12, 2015 2:23 pm
by SavaSC
Yes, it looks correct. Yes, I am getting an error when I apply. Here is the error:

Code: Select all

Error: Template 'use' specified in host definition could not be not found (config file '/usr/local/nagios/etc/hosttemplates.cfg', starting on line 361)
As there is no line 361, it's very weird. I did a vacuuming of the PostgresSQL databases (because it had been quite a while since that had been done) but that didn't help.

Re: Web update says it fails, but shows as at newst version

Posted: Mon Oct 12, 2015 3:36 pm
by tgriep
Lets try this procedure to see if this works for you.

Go to the Core Config Manager
Under "Tools", click "Write Config Files"
Click the "Delete" button then click the "Write" button and then the "Verify" button
If you get any errors, resolve them and click on the "Write", "Verify" until all of the errors are resolved.
Click Apply Configuration and click the "Apply Configuration" button

Re: Web update says it fails, but shows as at newst version

Posted: Tue Oct 13, 2015 8:00 am
by SavaSC
When I get to the "Verify" step, I get the same error. Here is how it looks:

Code: Select all

Error: Template 'use' specified in host definition could not be not found (config file '/usr/local/nagios/etc/hosttemplates.cfg', starting on line 361) 
 
Nagios Core 4.1.1 
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors 
Copyright (c) 1999-2009 Ethan Galstad 
Last Modified: 08-19-2015 
License: GPL 

Website: https://www.nagios.org 
Reading configuration data... 
 Read main config file okay... 
Error: Template 'use' specified in host definition could not be not found (config file '/usr/local/nagios/etc/hosttemplates.cfg', starting on line 361) 
 Error processing object config files! 


***> One or more problems was encountered while processing the config files... 

 Check your configuration file(s) to ensure that they contain valid 
 directives and data defintions. If you are upgrading from a previous 
 version of Nagios, you should be aware that some variables/definitions 
 may have been removed or modified in this version. Make sure to read 
 the HTML documentation regarding the config files, as well as the 
 'Whats New' section to find out what has changed. 

Re: Web update says it fails, but shows as at newst version

Posted: Tue Oct 13, 2015 1:45 pm
by tgriep
Go in to the Core Config Manager, select the host templates link and on any of the templates, Click on the Floppy Icon and that will bring up all of the templates in the view.
Copy that data is it an editor and check the template at line 361 to get the name of the template that has the error. Fix it and save the settings and see if you can write and verify the changes are good.
Keep doing that until they are repaired and when the verify is clean, you should be able to apply the config.

If you have any questions on the host template settings, post the template here so we can review it.