- 论坛徽章:
- 0
|
http://www.cpan.org/authors/id/G ... ipts/check_mysql.pl
如下这些代码是什么格式?没见过这个格式,是什么意思?
=pod
=head1 NAME
check_mysql.pl
=head1 DESCRIPTION
Enforce a timeout for SELECT queries on an MySQL server. Queries that reach the timeout are killed, and a report including the complete query and EXPLAIN output are emailed.
=head1 INSTALLATION
=over 4
=item 1
Create a special MySQL user for this script to use to connect to your database. The user should have a strong password and access control, as it is required that you grant the SUPER and PROCESS privileges to the user so that the script can view processes and kill queries.
=item 2
Edit the configurable items at the top of this script - Set the check frequency and timeout, database connection parameters, and the path to your system's sendmail program.
=back
=head1 USAGE
Simply run the program:
chmod +x check_mysql.pl
./check_mysql.pl
The script will connect to MySQL and begin monitoring for slow queries. For running as a daemon, I suggest using daemontools or similar to start the script and keep it running.
=head1 PREREQUISITES
This script requires C<DBI> and C<DBD::mysql>.
=head1 SCRIPT CATEGORIES
UNIX/System_administration
=cut |
|