NAME

Watchdog::Mysql - Test status of Mysql service

SYNOPSIS

use Watchdog::Mysql;
$h = new Watchdog::Mysql($name,$host,$port,$db);
($alive,$error) = $h->is_alive;
print $h->id, $alive ? ' is alive' : " is dead: $error", "\n";

DESCRIPTION

Watchdog::Mysql is an extension for monitoring a Mysql server.

CLASS METHODS

new($name,$host,$port,$db)

Returns a new Watchdog::Mysql object. $name is a string which will identify the service to a human (default is 'mysql'). $host is the hostname which is running the service (default is 'localhost'). $port is the port on which the service listens (default is 3306). $db is a database with no access control (default is 'test').

OBJECT METHODS

id()

Return a string describing the Mysql service.

is_alive()

Returns (1,undef) if the mysql server can be 'pinged' or (0,$error) where $error is a DBI error string if it can't.

SEE ALSO

Watchdog::Base

DBI

AUTHOR

Paul Sharpe <paul@miraclefish.com>

COPYRIGHT

Copyright (c) 1998 Paul Sharpe. England. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.