Watchdog::Mysql - Test status of Mysql service


Watchdog documentation  | view source Contained in the Watchdog distribution.

Index


NAME

Top

Watchdog::Mysql - Test status of Mysql service

SYNOPSIS

Top

  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

Top

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

CLASS METHODS

Top

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

Top

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

Top

Watchdog::Base

DBI

AUTHOR

Top

Paul Sharpe <paul@miraclefish.com>

COPYRIGHT

Top


Watchdog documentation  | view source Contained in the Watchdog distribution.