Nagios and MySQL
Andreas Ericsson
ae at op5.se
Thu Mar 26 09:50:56 CET 2009
Mark Weaver wrote:
> Hi List,
> I was wondering if anyone has connected their standard Nagios installation up to
> a MySQL backend?
>
> I'm looking at this from a purely disaster recovery aspect. It's easy enough to
> backup the configuration, but the data is another matter.
>
Why you would want to move data from flat files to a database for disaster
recovery purposes is beyond me. Care to explain?
> My current Nagios installation is version 3 installed on a CentOS 4.7 server.
> The installation was done via Yum from the rpmforge repo. Much cleaner install
> than compiling the tarballs and much easier to manage.
>
> Yes, I could archive all the installation paths, but because they were installed
> via the RPM method things are spread out all over the file system. It would be
> real nice if I had all the data contained within a MySQL backend. That way if I
> had to restore should my Nag server die or suffer some horrible fate it could be
> a matter of reinstalling the packages, restoring the /etc/nagios directory where
> all the configs live, restore the database and I'm of again.
>
This should work reasonably well:
tar czf "nagios-backup-$(date +%Y-%m-%d.%T).tar.gz" $(rpm -ql nagios)
> I've looked at a few suggested Nagios front ends including Centreon and they
> turned out to be bad experiences. Mostly due to the fact that being
> a Nagios noobie I didn't know what the hell the front was doing. The worst of it
> though was the way those front ends kept over-writing my
> configuration files in favor of it's own. Made a real mess of things and after
> the third reinstallation of Nagios on my sandbox I decided they
> weren't worth the effort or the misery. (Centreon and NagiosQL)
>
> Groundworks is out of the question because as soon as it was installed and
> running it disabled my current instance of MySQL in favor of it's
> own. Not such a big deal as at the time it was on my sandbox machine, but had
> that been a production machine where I've got web applications
> running I'd have been seriously pissed! Funny that... Groundworks didn't mention
> anything about that rather rude behavior.
>
> No, I'd much rather be able to connect a standard Nagios install to a MySQL
> backend and use everything else as is.
>
What particular data is it you want to put in the database? We have plenty of
scripts, eventbrokers and programs written specifically to gather Nagios data
and put it in a database. If you use our webconfiguration tool, it will
overwrite your configuration files when you click "save", but that's sort of
expected behaviour, I guess.
Still, I think you're going about this the wrong way if you only want it for
backup reasons.
--
Andreas Ericsson andreas.ericsson at op5.se
OP5 AB www.op5.se
Tel: +46 8-230225 Fax: +46 8-230231
Considering the successes of the wars on alcohol, poverty, drugs and
terror, I think we should give some serious thought to declaring war
on peace.
------------------------------------------------------------------------------
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue.
::: Messages without supporting info will risk being sent to /dev/null
More information about the Users
mailing list