Percona NRPE Install (MySQL): Difference between revisions

From vwiki
Jump to navigation Jump to search
(Added NRPE category)
(Added Ubuntu install)
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 form more info - https://www.percona.com/doc/percona-monitoring-plugins/1.0/nagios/index.html
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_0.1-4.$(lsb_release -sc)_all.deb </code>
# Install package
#* <code> dpkg -i percona-release_0.1-4.$(lsb_release -sc)_all.deb </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 ==
# 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 46: Line 63:
[[Category:Nagios]]
[[Category:Nagios]]
[[Category:NRPE]]
[[Category:NRPE]]
[[Category:Ubuntu]]

Revision as of 17:48, 1 December 2016

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 - /etc/apt/sources.list.d/percona-release.list

  1. Download appropriate pagckage
  2. Install package
    • dpkg -i percona-release_0.1-4.$(lsb_release -sc)_all.deb
  3. Update cache
    • apt-get update

Install Plugins

apt-get install percona-nagios-plugins

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.

  1. Add the Percona repository
  2. Install the Percona NRPE Nagios plugins
    • yum install percona-nagios-plugins percona-toolkit

Plugin Setup

  1. Append checks to NRPE config file (see below - change user/pass as required)
    • vi /usr/local/nagios/etc/nrpe.cfg
  2. Check NRPE is set to allow parameters
    • dont_blame_nrpe=1
  3. Create MySQL user
    • mysql -u root -p
    • GRANT SELECT, PROCESS, SUPER ON *.* to 'nagios'@'localhost' IDENTIFIED BY 'nagios123';
# MySQL checks
command[check_mysql]=/usr/lib64/nagios/plugins/check_mysql -u nagios -p nagios123
command[check_mysql_status]=/usr/lib64/nagios/plugins/pmp-check-mysql-status -l nagios -p nagios123 $ARG1$
command[check_mysql_processlist]=/usr/lib64/nagios/plugins/pmp-check-mysql-processlist -l nagios -p nagios123
command[check_mysql_innodb]=/usr/lib64/nagios/plugins/pmp-check-mysql-innodb -l nagios -p nagios123 -C $ARG1$
command[check_mysql_status_uptime]=/usr/lib64/nagios/plugins/pmp-check-mysql-status -l nagios -p nagios123 -x Uptime -C '<' -w $ARG1$ -c $ARG2$
command[check_mysql_status_connx]=/usr/lib64/nagios/plugins/pmp-check-mysql-status -l nagios -p nagios123 -x Threads_connected -o / -y max_connections -T pct -w $ARG1$ -c $ARG2$
command[check_mysql_status_threadrun]=/usr/lib64/nagios/plugins/pmp-check-mysql-status -l nagios -p nagios123 -x Threads_running -w $ARG1$ -c $ARG2$
command[check_mysql_slave_running]=/usr/lib64/nagios/plugins/pmp-check-mysql-replication-running -l nagios -p nagios123
command[check_mysql_slave_delay]=/usr/lib64/nagios/plugins/pmp-check-mysql-replication-delay -l nagios -p nagios123

NRPE Compiled Without Argument Support

Sometime Nagios has been compiled and installed so that it will never accept arguments (regardless of dont_blame_nrpe config).

cd /root/nrpe/nrpe-2.13/
./configure --enable-command-args
/etc/init.d/nrpe stop
make
make install
/etc/init.d/nrpe start

{{#seo: |title=Percona MySQL NRPE plugin install |keywords=mysql,nrpe,nagios,monitor,percona, plugin |description=Instructions on installing the Percona NRPE plugin in order to be able to monitor a MySQL server from Nagios }}