[hobbit] [dbcheck] feature request: regexp-based config

Gildas Le Nadan gn1 at sanger.ac.uk
Tue Sep 26 12:41:17 CEST 2006


Francesco Duranti wrote:
> Hi Gildas,
> at this moment it's not possible to do, I'll think on how to do it for a
> future release (I'm currently working on a custom query check engine and
> some more informix check). 
> For now I was thinking of making the [default] section work also for
> mysql as it does for oracle and informix databases without defining a
> sid.
> You will be able to use the "default" behaviour of dbcheck.pl:
> If dbcheck find a hosts flagged with dbcheck in the bb-hosts file it
> will try to get the information for it from the dbcheck.ini file.
> If no section are defined for it it will get the default parameters from
> the [default] section. This work quite well for oracle because if no sid
> is defined it will assume the sid is equal to the hostname and it will
> check with default parameters the database.
> For mysql database it will not work because it will need to use a
> hostname and port to connect.
> At this moment (if you want to try) you can change line 696-697 from:
>        /mysql/ && do {
>                 if ($port) {
> 
> To 
>        /mysql/ && do {
>                 $dbhost=$hostname if (!$dbhost);
>                 if ($port) {
> 
> And it should let you check mysql servers without defining any
> parameters if they have:
> 1) same port
> 2) same username/password
> 
> You just have to add dbtype, port, username and password to the default
> section just like:
> [default]
> dbtype                  = mysql
> Port				= 3306
> username                = usertest
> password                = pw1234
> 
> This will work if all the database have a common user/pw to connect and
> if you have most of the database that are mysql databases.
> 
> Let me know if this solved your problem.
> 
> Francesco

Yes, it actually does for now. I've configured the default entry to be 
the one with the most present parameters.

That way I may wait for the release where it will be fixed :)

Cheers,
Gildas



More information about the Xymon mailing list