Recent Upgrade Woes

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
klewia
Posts: 25
Joined: Thu Oct 04, 2012 9:56 am

Recent Upgrade Woes

Post by klewia »

I recently upgraded Nagios XI from 2012 R12 to 2014 R2.6 and encountered a few issues.

Code: Select all

Error: Service has no hosts and/or service_description (config file '/usr/local/nagios/etc/services/<redacted>msd1.ems.local.cfg', starting on line 223)
^ I have tried completely removing this host and Service(s) and still get this error; I also checked line 223 (and all lines before/after) and noted that it has a host/service_description for each service line.


I have also reverted snapshots to the point just after nagios was upgraded. Prior to the error above I was getting the old duplicate time period problem I experienced after an upgrade in 2013. - Working with support we did some database scripting to change time periods on many hosts. Please also note that I have never manually changed anything in this deployment; all edits were done via the XI interface/Core Config Manager.

Code: Select all

Nagios XI Installation Profile
Download Profile	
System:
Nagios XI Version : 2014R2.6
Nagios.Ems.local 2.6.32-504.12.2.el6.i686 i686
CentOS release 6.6 (Final)
Gnome is not installed
Apache Information
PHP Version: 5.3.3
Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:37.0) Gecko/20100101 Firefox/37.0
Server Name: pinnnagios
Server Address: 10.60.10.60
Server Port: 80
Date/Time
PHP Timezone: America/New_York
PHP Time: Thu, 07 May 2015 15:21:42 -0400
System Time: Thu, 07 May 2015 15:21:42 -0400
Nagios XI Data
License ends in: SNTMQU

nagios (pid 1803) is running...
NPCD running (pid 1690).
ndo2db (pid 1831) is running...
CPU Load 15: 0.35
Total Hosts: 110
Total Services: 824
Function 'get_base_uri' returns: http://pinnnagios/nagiosxi/
Function 'get_base_url' returns: http://pinnnagios/nagiosxi/
Function 'get_backend_url(internal_call=false)' returns: http://pinnnagios/nagiosxi/includes/components/profile/profile.php
Function 'get_backend_url(internal_call=true)' returns: http://localhost/nagiosxi/backend/
Ping Test localhost
Running:

/bin/ping -c 3 localhost 2>&1 

PING localhost (127.0.0.1) 56(84) bytes of data.
64 bytes from localhost (127.0.0.1): icmp_seq=1 ttl=64 time=0.022 ms
64 bytes from localhost (127.0.0.1): icmp_seq=2 ttl=64 time=0.048 ms
64 bytes from localhost (127.0.0.1): icmp_seq=3 ttl=64 time=0.040 ms

--- localhost ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 1999ms
rtt min/avg/max/mdev = 0.022/0.036/0.048/0.012 ms
Test wget To localhost
WGET From URL: http://localhost/nagiosxi/includes/components/ccm/
Running:

/usr/bin/wget http://localhost/nagiosxi/includes/components/ccm/ 

--2015-05-07 15:21:44-- 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: "/usr/local/nagiosxi/tmp/ccm_index.tmp"

0K ........ 595K=0.01s

2015-05-07 15:21:44 (595 KB/s) - "/usr/local/nagiosxi/tmp/ccm_index.tmp" saved [8385]

Network Settings

1: lo:  mtu 65536 qdisc noqueue state UNKNOWN 

    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00

    inet 127.0.0.1/8 scope host lo

    inet6 ::1/128 scope host 

       valid_lft forever preferred_lft forever

2: eth0:  mtu 1500 qdisc pfifo_fast state UNKNOWN qlen 1000

    link/ether 00:50:56:b0:00:09 brd ff:ff:ff:ff:ff:ff

    inet 10.60.10.60/24 brd 10.60.10.255 scope global eth0

    inet6 fe80::250:56ff:feb0:9/64 scope link 

       valid_lft forever preferred_lft forever


Kernel IP routing table

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface

10.60.10.0      *               255.255.255.0   U     0      0        0 eth0

169.254.0.0     *               255.255.0.0     U     1002   0        0 eth0

default         10.60.10.1      0.0.0.0         UG    0      0        0 eth0

jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: Recent Upgrade Woes

Post by jdalrymple »

klewia wrote:I recently upgraded Nagios XI from 2012 R12 to 2014 R2.6 and encountered a few issues.
That's only 1 issue :) We can work with that.

So can you run /usr/local/nagiosxi/scripts/reconfigure_nagios.sh and post the output?
klewia
Posts: 25
Joined: Thu Oct 04, 2012 9:56 am

Re: Recent Upgrade Woes

Post by klewia »

Hopefully only one! - I suspect the Time-periods error to return - its haunted this deployment since 2012!

Hmm I do not see that script in that directory!
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Recent Upgrade Woes

Post by lmiltchev »

Hmm I do not see that script in that directory!
This is strange. Run the following command and show us the output in code wraps:

Code: Select all

ll /usr/local/nagiosxi/scripts
Be sure to check out our Knowledgebase for helpful articles and solutions!
klewia
Posts: 25
Joined: Thu Oct 04, 2012 9:56 am

Re: Recent Upgrade Woes

Post by klewia »

Code: Select all

[root@PinnNagios ~]# ls /usr/local/nagiosxi/scripts
backup_xi.sh                        nagiosql.import.monitoring
change_timezone.sh                  nagiosql.login
contact_notification_handler.php    nagiosql_login.php
export_nagiosql.sh                  nagiosql_snapshot.sh
fixperms.sh                         nagiosql_trim_backups.sh
handle_nagioscore_event.php         nom_create_nagioscore_checkpoint_cond.sh
handle_nagioscore_notification.php  nom_create_nagioscore_checkpoint.sh
import_nagiosql.sh                  nom_create_nagioscore_errorpoint.sh
import_xiconfig.php                 nom_restore_nagioscore_checkpoint.sh
kill_rrdtool.sh                     nom_restore_nagioscore_checkpoint_specific.sh
manage_services.sh                  nom_trim_nagioscore_checkpoints.sh
nagiosql.cookies                    parse_core_eventlog.php
nagiosql_defaults.sql               patch_ndoutils.php
nagiosql.delete.contact             reconfigure_nagios.sh
nagiosql_delete_contact.php         repair_databases.sh
nagiosql.delete.host                repairmysql.sh
nagiosql_delete_host.php            reset_config_perms
nagiosql_delete_object.sh           reset_config_perms.c
nagiosql.delete.service             reset_config_perms.sh
nagiosql_delete_service.php         reset_nagiosadmin_password.php
nagiosql.delete.timeperiod          restart_nagios_with_export.sh
nagiosql_delete_timeperiod.php      restore_defaults.sh
nagiosql.export.additional          restore_xi.sh
nagiosql_exportall.php              send_to_auditlog.php
nagiosql.export.monitoring          uninstall_xi.sh
nagiosql_importall.php              upgrade_to_latest.sh
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: Recent Upgrade Woes

Post by jdalrymple »

klewia wrote:

Code: Select all

[root@PinnNagios ~]# ls /usr/local/nagiosxi/scripts
<snip>
nagiosql_defaults.sql               patch_ndoutils.php
nagiosql.delete.contact             reconfigure_nagios.sh
nagiosql_delete_contact.php         repair_databases.sh
<snip>
It's there :)
klewia
Posts: 25
Joined: Thu Oct 04, 2012 9:56 am

Re: Recent Upgrade Woes

Post by klewia »

Code: Select all

[root@PinnNagios ~]# /usr/local/nagiosxi/scripts/reconfigure_nagios.sh
/usr/local/nagiosxi/scripts/reconfigure_nagios.sh: line 17: ./import_nagiosql.sh: No such file or directory
I might have been a bit hasty in my response yesterday.
jolson
Attack Rabbit
Posts: 2560
Joined: Thu Feb 12, 2015 12:40 pm

Re: Recent Upgrade Woes

Post by jolson »

Since the script uses relational paths, you will need to change your directory to the script folder before running it:

Code: Select all

cd /usr/local/nagiosxi/scripts
./reconfigure_nagios.sh
Twits Blog
Show me a man who lives alone and has a perpetually clean kitchen, and 8 times out of 9 I'll show you a man with detestable spiritual qualities.
klewia
Posts: 25
Joined: Thu Oct 04, 2012 9:56 am

Re: Recent Upgrade Woes

Post by klewia »

Code: Select all

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=5u4n0l' -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=5u4n0l' -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=<red>iteConfig' -O nagiosql.export.monitoring
<red>ITE 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...
Warning: use_embedded_perl_implicitly is deprecated and will be removed.
Warning: sleep_time is deprecated and will be removed.
Warning: p1_file is deprecated and will be removed.
Warning: external_command_buffer_slots is deprecated and will be removed. All commands are always processed upon arrival
Warning: enable_embedded_perl is deprecated and will be removed.
Warning: command_check_interval is deprecated and will be removed. Commands are always handled on arrival
   Read main config file okay...
Warning: failure_prediction_enabled is obsoleted and no longer has any effect in host type objects (config file '/usr/local/nagios/etc/hosttemplates.cfg', starting at line 16)
Warning: failure_prediction_enabled is obsoleted and no longer has any effect in host type objects (config file '/usr/local/nagios/etc/hosttemplates.cfg', starting at line 145)
Warning: failure_prediction_enabled is obsoleted and no longer has any effect in service type objects (config file '/usr/local/nagios/etc/servicetemplates.cfg', starting at line 33)
Warning: failure_prediction_enabled is obsoleted and no longer has any effect in service type objects (config file '/usr/local/nagios/etc/servicetemplates.cfg', starting at line 136)
   Read object config files okay...

Running pre-flight check on configuration data...

Checking objects...
Warning: Service 'HTTP' on host '<red>Nagios' has no check time period defined!
Warning: Service 'HTTP' on host '<red>Nagios' has no notification time period defined!
Warning: Service 'NRPE' on host '<red>Nagios' has no check time period defined!
Warning: Service 'NRPE' on host '<red>Nagios' has no notification time period defined!
Warning: Service 'Ping' on host '<red>Nagios' has no check time period defined!
Warning: Service 'Ping' on host '<red>Nagios' has no notification time period defined!
Warning: Service 'SSH' on host '<red>Nagios' has no check time period defined!
Warning: Service 'SSH' on host '<red>Nagios' has no notification time period defined!
Warning: Service 'Current Load' on host 'localhost' has no check time period defined!
Warning: Service 'Current Users' on host 'localhost' has no check time period defined!
Warning: Service 'HTTP' on host 'localhost' has no check time period defined!
Warning: Service 'PING' on host 'localhost' has no check time period defined!
Warning: Service 'Root Partition' on host 'localhost' has no check time period defined!
Warning: Service 'SSH' on host 'localhost' has no check time period defined!
Warning: Service 'Swap Usage' on host 'localhost' has no check time period defined!
Warning: Service 'Total Processes' on host 'localhost' has no check time period defined!
Warning: Service 'CPU Usage' on host 'mail.<red>local' has no check time period defined!
Warning: Service 'CPU Usage' on host 'mail.<red>local' has no notification time period defined!
Warning: Service 'Drive C: Disk Usage' on host 'mail.<red>local' has no check time period defined!
Warning: Service 'Drive C: Disk Usage' on host 'mail.<red>local' has no notification time period defined!
Warning: Service 'Memory Usage' on host 'mail.<red>local' has no check time period defined!
Warning: Service 'Memory Usage' on host 'mail.<red>local' has no notification time period defined!
	Checked 850 services.
Warning: Host '<red><red>k8.<red>local' has no default contacts or contactgroups defined!
	Checked 110 hosts.
	Checked 5 host groups.
	Checked 3 service groups.
Warning: Contact 'Security Team Pager' has no service notification time period defined!
Warning: Contact 'Security Team Pager' has no host notification time period defined!
	Checked 15 contacts.
	Checked 5 contact groups.
	Checked 109 commands.
	Checked 17 time periods.
	Checked 0 host escalations.
	Checked 0 service escalations.
Checking for circular paths...
	Checked 110 hosts
	Checked 0 service dependencies
	Checked 0 host dependencies
	Checked 17 timeperiods
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...

Total Warnings: 600
Total Errors:   0

Things look okay - No serious probl<red>were detected during the pre-flight check
RET: 0
I deleted some of the warnings - it exceeded the forum character limit.
jolson
Attack Rabbit
Posts: 2560
Joined: Thu Feb 12, 2015 12:40 pm

Re: Recent Upgrade Woes

Post by jolson »

Would you please re-run the script as the 'nagios' user?

Code: Select all

su - nagios
cd /usr/local/nagiosxi/scripts
./reconfigure_nagios.sh
Twits Blog
Show me a man who lives alone and has a perpetually clean kitchen, and 8 times out of 9 I'll show you a man with detestable spiritual qualities.
Locked