1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
|
check_mysql_health Nagios Plugin README
---------------------
This plugin is used to monitor a variety of mysql database metrics.
* For instructions on installing this plugin for use with Nagios,
see below. In addition, generic instructions for the GNU toolchain
can be found in the INSTALL file.
* For major changes between releases, read the CHANGES file.
* For information on detailed changes that have been made,
read the Changelog file.
* This plugin is self documenting. All plugins that comply with
the basic guidelines for development will provide detailed help when
invoked with the '-h' or '--help' options.
You can check for the latest plugin at:
http://www.consol.com/opensource/nagios/check-mysql-health
The documentation in this README covers only the most common features.
To view the full documentation and examples, go to
http://www.consol.com/opensource/nagios/check-mysql-health or
http://www.consol.de/opensource/nagios/check-mysql-health
Send mail to mail_redacted_for_web for assistance.
Please include the OS type/version and the Perl DBI/DBD version
that you are using.
Also, run the plugin with the '-vvv' option and provide the resulting
version information. Of course, there may be additional diagnostic information
required as well. Use good judgment.
For patch submissions and bug reports, please send me a mail. You can also find
me at http://www.nagios-portal.de
How to "compile" the check_mysql_health script.
--------------------------------------------------------
1) Run the configure script to initialize variables and create a Makefile, etc.
./configure --prefix=BASEDIRECTORY --with-nagios-user=SOMEUSER --with-nagios-group=SOMEGROUP --with-perl=PATH_TO_PERL --with-statefiles-dir=STATE_PATH
a) Replace BASEDIRECTORY with the path of the directory under which Nagios
is installed (default is '/usr/local/nagios')
b) Replace SOMEUSER with the name of a user on your system that will be
assigned permissions to the installed plugins (default is 'nagios')
c) Replace SOMEGRP with the name of a group on your system that will be
assigned permissions to the installed plugins (default is 'nagios')
d) Replace PATH_TO_PERL with the path where a perl binary can be found.
Besides the system wide perl you might have installed a private perl
just for the nagios plugins (default is the perl in your path).
e) Replace STATE_PATH with the directory where you want the script to
write state files which transport information from one run to the next.
(default is /tmp)
Simply running ./configure will be sufficient to create a check_mysql_health
script which you can customize later.
2) "Compile" the plugin with the following command:
make
This will produce a "check_mysql_health" script. You will also find
a "check_mysql_health.pl" which you better ignore. It is the base for
the compilation filled with placeholders. These will be replaced during
the make process.
3) Install the compiled plugin script with the following command:
make install
The installation procedure will attempt to place the plugin in a
'libexec/' subdirectory in the base directory you specified with
the --prefix argument to the configure script.
4) Verify that your configuration files for Nagios contains
the correct paths to the new plugin.
Command line parameters
-----------------------
--hostname=<the mysql connect string>
This is what you would also use with tnsping and sqlplus.
--username=<username>
This is the user which reads the system tables.
--password=<secret>
This is the user's password.
--mode=<operation mode>
This parameter tells the plugin what it should check.
The list of known modes may grow frequently. Please look at
http://www.consol.com/opensource/nagios/check-mysql-health for a list
of features.
--replication-user=<username of replication user>
This is the username used to authenticated mysql replication, this is useful
with the longprocs mode where the replication users process is not counted as
a longrunning process.
--warning=<warning threshold>
If the metric is out of this range, the plugin returns a warning.
--critical=<critical threshold>
If the metric is out of this range, the plugin returns a critical.
How to prepare the database for monitoring
--------------------------------------
GRANT USAGE ON *.* TO 'nagios'@'nagiosserver' IDENTIFIED BY 'nagiospassword';
--------------------------------------
That's it. If you have any problems or questions, feel free to send mail
to mail_redacted_for_web
Please do not send me a mail like this:
+-------------------------------------------------+
| I need monitor of database urgent. Please help. |
| Suresh |
+-------------------------------------------------+
I will answer you:
+-------------------------------------------------+
| A drumm Schelln konnst hom |
| Gerhard |
+-------------------------------------------------+
|