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

Francesco Duranti fduranti at q8.it
Mon Sep 25 17:01:31 CEST 2006


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


> 
> (even though this is related to dbcheck and not to hobbit 
> per-se I send 
> this email here, as I guess it may be of interest for other 
> agent-writers-to-be)
> 
> Hi,
> 
> I have an important number of mysql server to monitor using 
> dbcheck. On 
> some of them, I have created a monitoring account, on others I use an 
> already existing account.
> 
> Interestingly enough, servers with a similar configuration have a 
> similar name, so I would be interested in using regexp-based 
> configuration but as far as I know, dbcheck.ini must have an 
> entry for 
> each database to monitor.
> 
> Francesco, would it be feasible?
> 
> Cheers,
> Gildas
> 
> To unsubscribe from the hobbit list, send an e-mail to
> hobbit-unsubscribe at hswn.dk
> 
> 
> 



More information about the Xymon mailing list