Help integrating MySQL db

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
lce411
Posts: 41
Joined: Thu Jun 07, 2012 1:28 pm

Help integrating MySQL db

Post by lce411 »

As the subject suggests, I need some help integrating a MySQL server with our Nagios server. We are using an older version of Nagios 2.12 and I have not been able to find documentation online that outlines the steps needed to off-load the current db (does Nagios use a db, natively?), from the Nagios server to a MySQL server. I've gotten so far as to be able to log into the MySQL server from the Nagios server, so my firewall exception is working, but when I try to start the mysqldump process, it says it can't connect. I'm trying to initiate this from the Nagios server. What information should I post to start the t/sing process with anyone who may be willing to help?
GaWd
Posts: 51
Joined: Wed Dec 15, 2010 1:45 pm

Re: Help integrating MySQL db

Post by GaWd »

Well, you should probably upgrade to a newer version of software, to begin with.

Then you should look into one of the 3rd party programs that do just this-NagiosQL and a few others are out there.
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: Help integrating MySQL db

Post by mguthrie »

If you're talking about offloading ndoutils onto a second machine, the documentation below should cover the steps needed. The doc is made for Nagios XI, but it should work the same for Core on most of the steps.

http://assets.nagios.com/downloads/nagi ... Server.pdf
lce411
Posts: 41
Joined: Thu Jun 07, 2012 1:28 pm

Re: Help integrating MySQL db

Post by lce411 »

If my first step is to upgrade my Nagios software, does anyone have the steps for doing so? I saw steps for how to install from source, but couldn't find any upgrade steps.

- Do I just unpack the tar.gz file and install it from source?
- Will the old configs be picked up or do I need to save them off, so they aren't over-written?
lce411
Posts: 41
Joined: Thu Jun 07, 2012 1:28 pm

Re: Help integrating MySQL db

Post by lce411 »

mguthrie wrote:If you're talking about offloading ndoutils onto a second machine, the documentation below should cover the steps needed. The doc is made for Nagios XI, but it should work the same for Core on most of the steps.

http://assets.nagios.com/downloads/nagi ... Server.pdf
I started to run through the documentation you linked above and I have a question about the section that says to edit the config.inc.php file. That file on my nagios server doesn't look the same as the documentation says it should. Here is mine:

Code: Select all

<?php
//

$cfg['cgi_config_file']='/usr/local/nagios/etc/cgi.cfg';  // location of the CGI config file

$cfg['cgi_base_url']='/nagios/cgi-bin';

// FILE LOCATION DEFAULTS
$cfg['main_config_file']='/usr/local/nagios/etc/nagios.cfg';  // default location of the main Nagios config file
$cfg['status_file']='/usr/local/nagios/var/status.dat'; // default location of Nagios status file
$cfg['state_retention_file']='/usr/local/nagios/var/retention.dat'; // default location of Nagios retention file

// utilities
require_once(dirname(__FILE__).'/includes/utils.inc.php');

?>
I don't have the 'ndoutils' entry that it says to look for. Should I got ahead and make the entries the documentation says to, or do I need to find a different file to edit?
agriffin
Posts: 876
Joined: Mon May 09, 2011 9:36 am

Re: Help integrating MySQL db

Post by agriffin »

That file is Nagios XI-specific, and you can ignore it if you're using Nagios Core 2.12 like you said. You are probably looking at a different config.inc.php, since it's actually a common filename for PHP applications.
lce411
Posts: 41
Joined: Thu Jun 07, 2012 1:28 pm

Re: Help integrating MySQL db

Post by lce411 »

Does anyone know of or have steps for doing this with Core? I went through the steps above and a few of the files in the documentation did not apply, so I'm worried I'm missing something.
agriffin
Posts: 876
Joined: Mon May 09, 2011 9:36 am

Re: Help integrating MySQL db

Post by agriffin »

You would only be missing something if you're using any add-ons besides ndoutils that use MySQL. Otherwise, skipping the Nagios XI-specific portions is just fine for Nagios Core. Sorry, I don't know of any documents for Nagios Core.
lce411
Posts: 41
Joined: Thu Jun 07, 2012 1:28 pm

Re: Help integrating MySQL db

Post by lce411 »

agriffin wrote:You would only be missing something if you're using any add-ons besides ndoutils that use MySQL. Otherwise, skipping the Nagios XI-specific portions is just fine for Nagios Core. Sorry, I don't know of any documents for Nagios Core.
I'm still having problems getting any Nagios data to be passed to the MySQL server. I've gone through the Nagios XI document and changed what I think should be changed but I still don't see the db growing. When i check the web-GUI front-end, I still see checks logged at the current time. Shouldn't that data be sent to the MySQL db? Is that proof that the data is still not being directed to the MySQL db?
agriffin
Posts: 876
Joined: Mon May 09, 2011 9:36 am

Re: Help integrating MySQL db

Post by agriffin »

lce411 wrote:When i check the web-GUI front-end, I still see checks logged at the current time. Shouldn't that data be sent to the MySQL db? Is that proof that the data is still not being directed to the MySQL db?
No, it could still be working. The web front-end doesn't use the MySQL database on Core.

You should stop MySQL on the local machine and check any add-ons you have installed that use the ndoutils database to make sure they are still getting new data.
Locked