using mysql

Marc Powell marc at ena.com
Sat May 7 16:04:39 CEST 2005



> -----Original Message-----
> From: nagios-users-admin at lists.sourceforge.net [mailto:nagios-users-
> admin at lists.sourceforge.net] On Behalf Of Trevor Cullingsworth
> Sent: Friday, May 06, 2005 7:19 PM
> To: nagios-users at lists.sourceforge.net
> Subject: [Nagios-users] using mysql
> 
> Hi all,
> 
> Does anyone have a document on how to set up nagios to use mysql for
its
> config files?

It's not possible and would require large code changes. As database
support has been removed entirely from the core 2.0 code, this is
unlikely to happen. If you have any questions about that, there's plenty
of discussion of it in the archives.

> 
> Right now, I have nagios 1.2 compiled with mysql support.  I also have
> Nagmin running and I have mysql set up.  When I configured Nagmin, I
was
> able to populate a mysql database that I called "nagios" from info
> extrapolated from the nagios .cfg files - hosts.cfg, hostgroups.cfg,
> contactgroups.cfg, etc.
> 
> I want to have nagios check against this database for its monitoring
> rather than use the flat .cfg files.  I have not gotten this to work.
If
> I change an IP address of a host I want to check in the mysql
database,
> nagios still continues to check the IP address of the host  that is
> configured in the hosts.cfg file for example.

Nagios 1.x only uses the database for status data, not configuration
data, excepting hostextinfo and serviceextinfo definitions. Any changes
you make with Nagmin must be exported to flat file and Nagios reloaded.

> 
> I have the following set up in nagios.cfg:
> 
> 
> 	xdddb_host=localhost
> 	xdddb_port=3306
> 	xdddb_username=nagios
> 	xdddb_password=********
> 	xdddb_database=nagios
> 
> 
> And I have the following set up in cgi.cfg:
> 
> 
> 	nagios_check_command=/usr/bin/perl
> /usr/local/nagios/libexec/check_mysql
> 
> 
> 
> However, when I look at nagios from my browser it is giving me the
> following:
> 
> 
> 	Process Status Information
> Process Status:	   UNKNOWN
> Check Command Output: 	 Nagios check command did not return any
output

You should be using check_nagios_db.pl. check_mysql does not return the
correct information for the nagios_check_command. This is unrelated to
your original request.
 
> How can I get nagios to use the hosts, contactgroup, etc. from the
mysql
> database instead of the *.cfg files under the Nagios home etc
directory?

Again, you cannot. Nagmin may store it's information in the DB but it
must be exported to flat-file and nagios reloaded for changes to be
seen.

--
Marc


-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.
Get your fingers limbered up and give it your best shot. 4 great events, 4
opportunities to win big! Highest score wins.NEC IT Guy Games. Play to
win an NEC 61 plasma display. Visit http://www.necitguy.com/?r 
_______________________________________________
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