Nagios 'could not connect' to MySQL database

Richard.Luys at vanderlet.nl Richard.Luys at vanderlet.nl
Tue Aug 16 14:24:29 CEST 2005


Werner,
 

> -----Original Message-----
> From: nagios-users-admin at lists.sourceforge.net 
> [mailto:nagios-users-admin at lists.sourceforge.net] On Behalf 
> Of Werner Flamme
> Sent: Tuesday, August 16, 2005 1:59 PM
> To: Nagios-users at lists.sourceforge.net
> Subject: Re: [Nagios-users] Nagios 'could not connect' to 
> MySQL database
> 
> Richard.Luys at vanderlet.nl schrieb am 16.08.2005 12:57:
> > I know, this sounds like a newbie question, but 
> unfortunately it seems 
> > a bit more complex...
> > 
> ---snip---
> > When I check the nagios.log I get the following errors:
> > [1123752497] Finished daemonizing... (New PID=26747) [1123752497] 
> > Error: Could not connect to MySQL database 'nagios' on host 
> > 'localhost' using username 'nagios' and password 'removed'.  Status 
> > data will not be saved!
> > 
> > As I said, the provided host, database, username and password are 
> > correct. I can use them with the mysql-client to connect to the 
> > database, and use SELECT and INSERT statements succesfully.
> > 
> > It looks like nagios cannot find the database; the 
> MySQL-logging does 
> > not show any connection attempts from the Nagios-process... Port 
> > (3306) is used, and telnet localhost 3306 works fine.
> 
> Yes, AFAIk there is an issue when you use localhost - the 
> connection will be made via socket instead of port 3306.
> 
> Try your machine's name or IP address (as you find in 
> /etc/hosts) instead of 'localhost' in the config - same error then?

Tried it with the IP-address, exactly the same error (except for
'localhost' which is replaced by an ip-address, duh ;-) ).

Also tried the check_nagios_db.pl script; gives me the exact same error
(could not connect...). Since this script is using the Perl::DBI thingy
to connect to the database, I wonder what Nagios uses internally? As I
said: the MySQL client works fine, but connection with Perl::DBI does
not. I think that if we know the similarities in the way Nagios connects
and how Perl::DBI connects, we can figure out wat is happening, and
hopefully how to fix it...

> 
> > 
> > Who helps me out?
> Dunno yet ;-)
Thanks anyway, I appreciate your efforts!

> >  
> > 
> > Thanks in advance and best regards,
> > VANDERLET B.V.  
> > 
> > R. (Richard) Luys
> > 
> 
> HTH
> Werner
It didn't, but I won't give up...
> 
> -- 
> Werner Flamme, Abt. WKDV
> UFZ Umweltforschungszentrum Leipzig-Halle GmbH,
> Permoserstr. 15, 04318 Leipzig - http://www.ufz.de
> eMail: werner.flamme at ufz.de, Tel.: (0341) 235-2500
> 
> 
> 
> 
> 
> 
> 
> -------------------------------------------------------
> SF.Net email is Sponsored by the Better Software Conference & EXPO
> September 19-22, 2005 * San Francisco, CA * Development 
> Lifecycle Practices
> Agile & Plan-Driven Development * Managing Projects & Teams * 
> Testing & QA
> Security * Process Improvement & Measurement * 
> http://www.sqe.com/bsce5sf
> _______________________________________________
> 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
> 

This e-mail message and its attachments are subject to the disclaimer published at the following website of VANDERLET: http://www.vanderlet.nl/disclaimer 



-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
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