Restoring Nagios XI to factory default did not work well

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
habuhejleh
Posts: 32
Joined: Thu Feb 08, 2018 3:24 am

Restoring Nagios XI to factory default did not work well

Post by habuhejleh »

Dear All,

Kindly note that I did restore to the factory default to our Nagios XI by the below command:
cd /usr/local/nagiosxi/scripts/
./restore_defaults.sh

However the home page still displaying the hosts and services.
I tried redoing the above commands but still the same
I tried also rebooting the server but no luck

Please advise on how to solve this problem

Thank you,
Haitham
kyang

Re: Restoring Nagios XI to factory default did not work well

Post by kyang »

When you run the restore_defaults script. What is the output?

Is it similar to what is in this kb article? Could you post it for us.

Code: Select all

cd /usr/local/nagiosxi/scripts/
./restore_defaults.sh
https://support.nagios.com/kb/article.php?id=164

Also, what version of Nagios XI and what OS are you on?
habuhejleh
Posts: 32
Joined: Thu Feb 08, 2018 3:24 am

Re: Restoring Nagios XI to factory default did not work well

Post by habuhejleh »

Dear Kyang,

Please find he output below:
cd /usr/local/nagiosxi/scripts/
]0;root@localhost:/usr/local/nagiosxi/scripts[root@localhost scripts]# ./restore_defaults.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.login--2018-02-15 09:56:13-- 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”


[<=> ] 0 --.-K/s
[ <=> ] 35,825 --.-K/s in 0.02s

2018-02-15 09:56:14 (1.88 MB/s) - “nagiosql.login” saved [35825]

LOGIN SUCCESSFUL!
IMPORTING CONFIG FILES...URL: http://localhost/nagiosxi/includes/components/ccm/
Array
(
)
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--2018-02-15 09:56:14-- 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”


[<=> ] 0 --.-K/s
[ <=> ] 35,825 --.-K/s in 0.02s

2018-02-15 09:56:14 (2.11 MB/s) - “nagiosql.login” saved [35825]

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
--2018-02-15 09:56:14-- 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.export.monitoring”


[<=> ] 0 --.-K/s
[ <=> ] 21,689 --.-K/s in 0.01s

2018-02-15 09:56:15 (1.65 MB/s) - “nagiosql.export.monitoring” saved [21689]

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: Service has no hosts and/or service_description (config file '/usr/local/nagios/etc/services/localhost.cfg', starting on line 65)
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/1518611043.tar.gz
/ /usr/local/nagiosxi/scripts
RESTORING NOM SNAPSHOT : /usr/local/nagiosxi/nom/checkpoints/nagioscore/1518611043.tar.gz
/usr/local/nagiosxi/scripts
RESETTING PERMS


]0;root@localhost:/usr/local/nagiosxi/scripts[root@localhost scripts]#

Tha Nagios XI version is 5.3.0

Linux used is
[root@localhost nagiosadmin]# uname -mrs
Linux 2.6.32-642.4.2.el6.x86_64 x86_64
[root@localhost nagiosadmin]# uname -a
Linux localhost.localdomain 2.6.32-642.4.2.el6.x86_64 #1 SMP Tue Aug 23 19:58:13 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
[root@localhost nagiosadmin]# cat /etc/*release
CentOS release 6.8 (Final)
CentOS release 6.8 (Final)
CentOS release 6.8 (Final)


PLease advise ASAP
kyang

Re: Restoring Nagios XI to factory default did not work well

Post by kyang »

The error is in this file

Error: Service has no hosts and/or service_description (config file '/usr/local/nagios/etc/services/localhost.cfg', starting on line 65)

Code: Select all

/usr/local/nagios/etc/services/localhost.cfg

On line 65. That a look there and see what is missing.

Could you PM or post your profile for us to review?

Nagios XI Profile --> On the XI Home Page click "Admin" > "System Profile" --> "Download Profile" button
Save the profile.zip file and upload it here or PM me.

If you receive a PROFILE BUILD FAILED
Please follow this article,

https://support.nagios.com/kb/article.p ... ategory=44

After you PM the profile please update this thread, unless you post the profile on here. Thanks
habuhejleh
Posts: 32
Joined: Thu Feb 08, 2018 3:24 am

Re: Restoring Nagios XI to factory default did not work well

Post by habuhejleh »

Hi Kyang,

Here is the output of cat -n localhost.cfg
64 define service {
65 host_name localhost
66 service_description Service Status - httpd
67 use local-service
68 check_command check_xi_service_status!httpd!!!!!!
69 register 1
70 }

I have uploaded the the profile. please advise asap.
You do not have the required permissions to view the files attached to this post.
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: Restoring Nagios XI to factory default did not work well

Post by mcapra »

Please try the steps mentioned in this KB article:
https://support.nagios.com/kb/article.php?id=144

Something funky is going on with your configs. Probably in the CCM rather than the actual files.

I'd also double check, in the Core Config Manager, the service definitions you have for localhost. Make sure that that the services you have defined in the Core Config Manager are tied to a host.
Former Nagios employee
https://www.mcapra.com/
kyang

Re: Restoring Nagios XI to factory default did not work well

Post by kyang »

Thanks for the help @mcapra!

habuhejleh, please double check your definitions in the Core Config Manager as mcapra has suggested.

Don't forget to run through the kb article for those instructions.
Capture.PNG
Click Write --> Delete --> Write --> Verify --> Post the output of "Verify"

If no errors, then proceed to the restore_defaults.sh script.

Code: Select all

cd /usr/local/nagiosxi/scripts/
./restore_defaults.sh
You do not have the required permissions to view the files attached to this post.
habuhejleh
Posts: 32
Joined: Thu Feb 08, 2018 3:24 am

Re: Restoring Nagios XI to factory default did not work well

Post by habuhejleh »

Hi ,

Please find below the output:
64 define service {
65 host_name localhost
66 service_description Service Status - httpd
67 use local-service
68 check_command check_xi_service_status!httpd!!!
!!!
69 register 1
70 }

And find in the attached a screen show of localhost services.Please advice ASAP.
You do not have the required permissions to view the files attached to this post.
kyang

Re: Restoring Nagios XI to factory default did not work well

Post by kyang »

Did you run through the steps in that kb article? Here is the link.
https://support.nagios.com/kb/article.php?id=144

Could you send a screenshot of this service in your Core Config Manager? (CCM)

Here is an example of what I would like to see.
Capture.PNG
Thanks!
You do not have the required permissions to view the files attached to this post.
habuhejleh
Posts: 32
Joined: Thu Feb 08, 2018 3:24 am

Re: Restoring Nagios XI to factory default did not work well

Post by habuhejleh »

Yes I went through those steps with no luck
please find screen shots as below:

Please advise. Note that this Nagios is installed on VM.
You do not have the required permissions to view the files attached to this post.
Locked