Migrating Nagios Core to XI

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: Migrating Nagios Core to XI

Post by dwhitfield »

I assume you are using CentOS/RHEL 7? It should be in the defaults on CentOS 6.

You should be able to install with cpan:

Code: Select all

cpan YAML
cpan DBD::Sybase
Please let us know if you get any new error messages in the process. Thanks!
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Migrating Nagios Core to XI

Post by tgriep »

My mistake, the package can be installed using cpan as that is where it is from.
Run this as root to install it.

Code: Select all

cpan -i DBD::Sybase
The module needs to have the SYBASE environment variable setup before installing the DBD::Sybase perl module.
You may want to look at the site you downloaded the plugin to see what else is required to run the plugin or how to install it.
Be sure to check out our Knowledgebase for helpful articles and solutions!
notnagiospro
Posts: 11
Joined: Fri Jan 27, 2017 4:50 am

Re: Migrating Nagios Core to XI

Post by notnagiospro »

Ok i got this problem out of the way, i now got another error but this is regarding to our script and not a nagios configuration topic.

Can you find something regarding to the service dependencies in the System Profile that i uploaded?

Thank you for your help!
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Migrating Nagios Core to XI

Post by tgriep »

I couldn't find the System Profile, can you upload it again?
I don't think it was attached in the earlier post.
Also, post a screen capture of the current error in case it changed from earlier.
Thanks
Be sure to check out our Knowledgebase for helpful articles and solutions!
notnagiospro
Posts: 11
Joined: Fri Jan 27, 2017 4:50 am

Re: Migrating Nagios Core to XI

Post by notnagiospro »

Please find attached the System Profile and the Screenshot of the error.

The error Code from the Service is as follows:
CRITICAL: Could not get result set!

The status is unknown.

I can definitly say that this is an error from the script, but at the moment i don't know why the script doesn't work at this system because it does at the Nagios Core.
You do not have the required permissions to view the files attached to this post.
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Migrating Nagios Core to XI

Post by tgriep »

Problem is that the error is keeping the configuration files from being written to the files in the profile so the servicedependencies.cfg file was not included in the profile so I don't know what is on line 927 to cause the error.
The best thing to do is to inactivate the servicedependencies in the Core Config Manager and make sure all of the hosts and services are imported.
Make sure they are verified and are functional and then, enable the dependencies.
Also, in the profile, there are very little services that are imported in to the system "Total Services: 24 " so this it probably causing the issue.
If the service is not in the system, the dependency will have a verification problem.
I also found this error in the Apache Error logs. It looks like there is a permission problem with that file and you should see what it is.

Code: Select all

fopen(/usr/local/nagios/etc/services/epdwh01-bs.server.lan.cfg): failed to open stream: No such file or directory
Be sure to check out our Knowledgebase for helpful articles and solutions!
notnagiospro
Posts: 11
Joined: Fri Jan 27, 2017 4:50 am

Re: Migrating Nagios Core to XI

Post by notnagiospro »

Can you please give me an idea how i can resolve the servicedependencies issue?
I still got the one error:

Code: Select all

Error: Could not expand master service(s) (config file '/usr/local/nagios/etc/servicedependencies.cfg', starting at line 16)
But the actual servicedependencies file looks like this:

Code: Select all

###############################################################################
#
# Service dependency configuration file
#
# Created by: Nagios Core Config Manager 2.6.5
# Date:       2017-03-08 08:31:09
# Version:    Nagios 3.x config file
#
# --- DO NOT EDIT THIS FILE BY HAND ---
# Nagios CCM will overwrite all manual settings during the next update if you
# would like to edit files manually, place them in the 'static' directory or
# import your configs into the CCM by placing them in the 'import' directory.
#
###############################################################################

###############################################################################
#
# Service dependency configuration file
#
# END OF FILE
#
###############################################################################
I don't get where the problem is.
The rights for the file are as follows:

-rw-rw-r-- 1 apache nagios

everytime i change this, after i try to apply the configuration its like this again.
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Migrating Nagios Core to XI

Post by tgriep »

I think the configurations in the Core Config Manager are not synced up with the running config and is you follow the procedure below, you should be able to sync them up.
Go to the Core Config Manager
Under "Tools", click "Write Config Files" or if you are running a newer versions of XI, The menu is called "Config File Management"
Click the click the "Write" button, then the "Delete" button then click the "Write" button and then the "Verify" button
If you get any errors, resolve them and click on the "Delete" button, "Write", "Verify" until all of the errors are resolved.
Click the Apply Configuration link and click the "Apply Configuration" button

If the above doesn't work, login as root to the Nagios server, run the following and post the output here.

Code: Select all

chage -l nagios
chage -l apache
grep apa /etc/passwd
grep nag /etc/passwd
grep nag /etc/group
ls -l /usr/local/nagios
ls -l /usr/local/nagios/etc
I want to see if the accounts are active and the permissions of the files, etc...
Be sure to check out our Knowledgebase for helpful articles and solutions!
notnagiospro
Posts: 11
Joined: Fri Jan 27, 2017 4:50 am

Re: Migrating Nagios Core to XI

Post by notnagiospro »

I've done the steps in the Tools frontend. I got no errors back but i still can't activate the Service Dependencies.
The output of the commands:

Code: Select all

chage -l nagios
Last password change                                    : Jan 25, 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 -l apache
Last password change                                    : Jan 24, 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

grep apa /etc/passwd
apache:x:48:48:Apache:/usr/share/httpd:/sbin/nologin

grep nag /etc/passwd
nagios:x:8012:8012::/home/nagios:/bin/bash

grep nag /etc/group
nagios:x:8012:nagios,apache
nagcmd:x:8013:nagios,apache

ls -l /usr/local/nagios
total 28
drwxr-xr-x  2 nagios nagios 4096 Feb 20 08:29 bin
drwsrwsr-x  8 apache nagios 4096 Mar 10 07:57 etc
drwxr-xr-x  2 root   root      6 Feb 20 08:29 include
drwxrwsr-x  2 apache nagios 4096 Feb 20 08:30 libexec
drwxr-xr-x  2 nagios nagios 4096 Feb 20 08:28 sbin
drwxr-xr-x 18 nagios nagios 4096 Feb 20 08:29 share
drwxr-xr-x  6 nagios nagios 4096 Mar 10 08:03 var

ls -l /usr/local/nagios/etc
total 212
drwsrwsr-x 3 apache nagios  4096 Mar 10 07:57 cfgprep
-rw-rw-r-- 1 apache nagios   877 Mar  1 10:40 cgi.cfg
-rw-rw-r-- 1 apache nagios 31089 Mar 10 08:01 commands.cfg
-rw-rw-r-- 1 apache nagios  2126 Mar 10 08:02 contactgroups.cfg
-rw-rw-r-- 1 apache nagios  4937 Mar 10 08:02 contacts.cfg
-rw-rw-r-- 1 apache nagios  1675 Mar 10 08:02 contacttemplates.cfg
-rw-rw-r-- 1 apache nagios   817 Mar 10 08:02 hostdependencies.cfg
-rw-rw-r-- 1 apache nagios   819 Mar 10 08:02 hostescalations.cfg
-rw-rw-r-- 1 apache nagios   837 Mar 10 08:02 hostextinfo.cfg
-rw-rw-r-- 1 apache nagios  1928 Mar 10 08:01 hostgroups.cfg
drwsrwsr-x 2 apache nagios  4096 Mar 10 08:01 hosts
-rw-rw-r-- 1 apache nagios 16137 Mar 10 08:01 hosttemplates.cfg
drwsrwsr-x 2 apache nagios     6 Mar  7 10:00 import
-rwxrwxr-x 1 apache nagios  5671 Feb 20 10:13 nagios.cfg
-rwxrwxr-x 1 apache nagios  2229 Feb 20 08:29 ndo2db.cfg
-rwxrwxr-x 1 apache nagios  4827 Feb 20 08:29 ndomod.cfg
-rwxrwxr-x 1 apache nagios  8285 Mar  7 11:18 nrpe.cfg
-rwxrwxr-x 1 apache nagios  5345 Feb 20 08:29 nsca.cfg
drwsrwsr-x 4 apache nagios  4096 Mar 10 07:57 pnp
-rwxrwxr-x 1 apache nagios   210 Feb 20 08:28 resource.cfg
-rwxrwxr-x 1 apache nagios  1627 Feb 20 08:29 send_nsca.cfg
-rw-rw-r-- 1 apache nagios  9010 Mar 10 08:02 servicedependencies.cfg
-rw-rw-r-- 1 apache nagios   825 Mar 10 08:02 serviceescalations.cfg
-rw-rw-r-- 1 apache nagios   843 Mar 10 08:02 serviceextinfo.cfg
-rw-rw-r-- 1 apache nagios  1556 Mar 10 08:01 servicegroups.cfg
drwsrwsr-x 2 apache nagios  4096 Mar 10 08:01 services
-rw-rw-r-- 1 apache nagios 24973 Mar 10 08:01 servicetemplates.cfg
drwsrwsr-x 2 apache nagios    65 Mar 10 07:57 static
-rw-rw-r-- 1 apache nagios  5662 Mar 10 08:01 timeperiods.cfg
The error when i try to active a dependencie is the same as before.
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Migrating Nagios Core to XI

Post by tgriep »

The Apache user account needs to login to the system for the Nagios XI process to run and yours is disabled and that could be the issue.
Edit the /etc/passwd file and change the following line from

Code: Select all

apache:x:48:48:Apache:/usr/share/httpd:/sbin/nologin
to

Code: Select all

apache:x:48:48:Apache:/usr/share/httpd:/bin/bash
Save the file and see if the Apply Config works.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked