2,187
edits
(Added NRPE category) |
(→Percona Repository: Updated) |
||
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
Instructions on installed the Percona NRPE plugin in order to be able to monitor a MySQL server from Nagios. See the following page | Instructions on installed the Percona NRPE plugin in order to be able to monitor a MySQL server from Nagios. See the following page for more info - https://www.percona.com/doc/percona-monitoring-plugins/1.1/nagios/index.html | ||
== Ubuntu Install == | |||
=== Percona Repository === | |||
If you don't have it available already, you'll need to add the Percona repository (if it is you should have the following file - <code>/etc/apt/sources.list.d/percona-release.list</code> | |||
# Download appropriate pagckage | |||
#* <code> wget https://repo.percona.com/apt/percona-release_latest.$(lsb_release -sc)_all.deb </code> | |||
# Install package | |||
#* <code> dpkg -i percona-release_latest.$(lsb_release -sc)_all.deb </code> | |||
# Enable the repository | |||
#* <code>percona-release setup ps80</code> | |||
# Update cache | |||
#* <code> apt-get update </code> | |||
=== Install Plugins === | |||
<code>apt-get install percona-nagios-plugins</code> | |||
== Red Hat Install == | |||
Note that the instructions below were written for an older version than is current, please check the Percona site (URL above) for up to date info. | |||
# Add the Percona repository | # Add the Percona repository | ||
#* <code> yum install http://www.percona.com/downloads/percona-release/redhat/0.1-3/percona-release-0.1-3.noarch.rpm </code> | #* <code> yum install http://www.percona.com/downloads/percona-release/redhat/0.1-3/percona-release-0.1-3.noarch.rpm </code> | ||
# Install the Percona NRPE Nagios plugins | # Install the Percona NRPE Nagios plugins | ||
#* <code> yum install percona-nagios-plugins percona-toolkit</code> | #* <code> yum install percona-nagios-plugins percona-toolkit</code> | ||
== Plugin Setup == | |||
Change the user/pass used in the example below | |||
# Append checks to NRPE config file (see below - change user/pass as required) | # Append checks to NRPE config file (see below - change user/pass as required) | ||
#* <code> vi /usr/local/nagios/etc/nrpe.cfg </code> | #* <code> vi /usr/local/nagios/etc/nrpe.cfg </code> | ||
Line 12: | Line 32: | ||
#* <code> mysql -u root -p </code> | #* <code> mysql -u root -p </code> | ||
#* <code> GRANT SELECT, PROCESS, SUPER ON *.* to 'nagios'@'localhost' IDENTIFIED BY 'nagios123'; </code> | #* <code> GRANT SELECT, PROCESS, SUPER ON *.* to 'nagios'@'localhost' IDENTIFIED BY 'nagios123'; </code> | ||
# Create credentials config file for checks to use | |||
#* <code> vi /etc/nagios/mysql.cnf </code> | |||
#* Add the following lines | |||
#* <code> [client] </code> | |||
#* <code> user = nagios </code> | |||
#* <code> password = nagios123 </code> | |||
# Change owner and permissions of credentials config file | |||
#* <code> chown root:nagios /etc/nagios/mysql.cnf </code> | |||
#* <code> chmod 640 /etc/nagios/mysql.cnf </code> | |||
<pre> | <pre> | ||
# MySQL checks | # Example MySQL checks | ||
command[check_mysql_status]=/usr/lib64/nagios/plugins/pmp-check-mysql-status $ARG1$ | |||
command[check_mysql_status]=/usr/lib64/nagios/plugins/pmp-check-mysql-status | command[check_mysql_processlist]=/usr/lib64/nagios/plugins/pmp-check-mysql-processlist | ||
command[check_mysql_processlist]=/usr/lib64/nagios/plugins/pmp-check-mysql-processlist | command[check_mysql_innodb]=/usr/lib64/nagios/plugins/pmp-check-mysql-innodb -C $ARG1$ | ||
command[check_mysql_innodb]=/usr/lib64/nagios/plugins/pmp-check-mysql-innodb | command[check_mysql_status_uptime]=/usr/lib64/nagios/plugins/pmp-check-mysql-status x Uptime -C '<' -w $ARG1$ -c $ARG2$ | ||
command[check_mysql_status_uptime]=/usr/lib64/nagios/plugins/pmp-check-mysql-status | command[check_mysql_status_connx]=/usr/lib64/nagios/plugins/pmp-check-mysql-status -x Threads_connected -o / -y max_connections -T pct -w $ARG1$ -c $ARG2$ | ||
command[check_mysql_status_connx]=/usr/lib64/nagios/plugins/pmp-check-mysql-status | command[check_mysql_status_threadrun]=/usr/lib64/nagios/plugins/pmp-check-mysql-status -x Threads_running -w $ARG1$ -c $ARG2$ | ||
command[check_mysql_status_threadrun]=/usr/lib64/nagios/plugins/pmp-check-mysql-status | command[check_mysql_slave_running]=/usr/lib64/nagios/plugins/pmp-check-mysql-replication-running | ||
command[check_mysql_slave_running]=/usr/lib64/nagios/plugins/pmp-check-mysql-replication-running | command[check_mysql_slave_delay]=/usr/lib64/nagios/plugins/pmp-check-mysql-replication-delay | ||
command[check_mysql_slave_delay]=/usr/lib64/nagios/plugins/pmp-check-mysql-replication-delay | |||
</pre> | </pre> | ||
Line 46: | Line 74: | ||
[[Category:Nagios]] | [[Category:Nagios]] | ||
[[Category:NRPE]] | [[Category:NRPE]] | ||
[[Category:Ubuntu]] |