[Pkg-nagios-changes] [pkg-nagios-plugins-contrib] 07/14: percona-nagios-plugins: Updating to 1.1.4

Jan Wagner waja at moszumanska.debian.org
Mon Sep 29 13:54:56 UTC 2014


This is an automated email from the git hooks/post-receive script.

waja pushed a commit to branch master
in repository pkg-nagios-plugins-contrib.

commit d514b06b40a1beeea07e5e4a1c37179b94582bbb
Author: Jan Wagner <waja at cyconet.org>
Date:   Mon Sep 29 14:13:30 2014 +0200

    percona-nagios-plugins: Updating to 1.1.4
---
 percona-nagios-plugins/control                     |  2 +-
 .../nagios/bin/pmp-check-aws-rds.py                |  2 +-
 .../nagios/bin/pmp-check-lvm-snapshots             |  2 +-
 .../nagios/bin/pmp-check-mysql-deadlocks           |  6 +++--
 .../nagios/bin/pmp-check-mysql-deleted-files       |  6 +++--
 .../nagios/bin/pmp-check-mysql-file-privs          |  6 +++--
 .../nagios/bin/pmp-check-mysql-innodb              |  6 +++--
 .../nagios/bin/pmp-check-mysql-pidfile             |  6 +++--
 .../nagios/bin/pmp-check-mysql-processlist         |  6 +++--
 .../nagios/bin/pmp-check-mysql-replication-delay   | 27 +++++++++++++++++-----
 .../nagios/bin/pmp-check-mysql-replication-running | 27 +++++++++++++++++-----
 .../nagios/bin/pmp-check-mysql-status              |  6 +++--
 .../nagios/bin/pmp-check-mysql-ts-count            |  6 +++--
 .../nagios/bin/pmp-check-pt-table-checksum         |  6 +++--
 .../nagios/bin/pmp-check-unix-memory               |  2 +-
 15 files changed, 82 insertions(+), 34 deletions(-)

diff --git a/percona-nagios-plugins/control b/percona-nagios-plugins/control
index 24348e1..da6cd29 100644
--- a/percona-nagios-plugins/control
+++ b/percona-nagios-plugins/control
@@ -1,5 +1,5 @@
 Watch: http://www.percona.com/downloads/percona-monitoring-plugins/LATEST/ >percona-monitoring-plugins-([0-9.]+)\.tar\.gz<
-Version: 1.1.3
+Version: 1.1.4
 Homepage: http://www.percona.com/doc/percona-monitoring-plugins/
 Uploaders: Bernd Zeimetz <bzed at debian.org>
 Description: Percona Monitoring Plugins (nagios)
diff --git a/percona-nagios-plugins/nagios/bin/pmp-check-aws-rds.py b/percona-nagios-plugins/nagios/bin/pmp-check-aws-rds.py
index cfa42d9..9e557cf 100755
--- a/percona-nagios-plugins/nagios/bin/pmp-check-aws-rds.py
+++ b/percona-nagios-plugins/nagios/bin/pmp-check-aws-rds.py
@@ -407,7 +407,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.
 
 =head1 VERSION
 
-Percona Monitoring Plugins pmp-check-aws-rds.py 1.1.3
+Percona Monitoring Plugins pmp-check-aws-rds.py 1.1.4
 
 =cut
 
diff --git a/percona-nagios-plugins/nagios/bin/pmp-check-lvm-snapshots b/percona-nagios-plugins/nagios/bin/pmp-check-lvm-snapshots
index c79d067..1e79bf5 100755
--- a/percona-nagios-plugins/nagios/bin/pmp-check-lvm-snapshots
+++ b/percona-nagios-plugins/nagios/bin/pmp-check-lvm-snapshots
@@ -180,7 +180,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.
 
 =head1 VERSION
 
-Percona Monitoring Plugins pmp-check-lvm-snapshots 1.1.3
+Percona Monitoring Plugins pmp-check-lvm-snapshots 1.1.4
 
 =cut
 
diff --git a/percona-nagios-plugins/nagios/bin/pmp-check-mysql-deadlocks b/percona-nagios-plugins/nagios/bin/pmp-check-mysql-deadlocks
index d3c4191..5e39418 100755
--- a/percona-nagios-plugins/nagios/bin/pmp-check-mysql-deadlocks
+++ b/percona-nagios-plugins/nagios/bin/pmp-check-mysql-deadlocks
@@ -35,6 +35,7 @@ main() {
          -H)              shift; OPT_HOST="${1}"; shift; ;;
          -i)              shift; OPT_INTERVAL="${1}"; shift; ;;
          -l)              shift; OPT_USER="${1}"; shift; ;;
+         -L)              shift; OPT_LOPA="${1}"; shift; ;;
          -p)              shift; OPT_PASS="${1}"; shift; ;;
          -P)              shift; OPT_PORT="${1}"; shift; ;;
          -S)              shift; OPT_SOCK="${1}"; shift; ;;
@@ -85,7 +86,7 @@ main() {
 mysql_exec() {
    mysql ${OPT_DEFT:+--defaults-file="${OPT_DEFT}"} ${OPT_HOST:+-h"${OPT_HOST}"} ${OPT_USER:+-u"${OPT_USER}"} \
       ${OPT_PASS:+-p"${OPT_PASS}"} ${OPT_SOCK:+-S"${OPT_SOCK}"} ${OPT_PORT:+-P"${OPT_PORT}"} \
-      -ss -e "$1"
+      ${OPT_LOPA:+--login-path="${OPT_LOPA}"} -ss -e "$1"
 }
 
 # ########################################################################
@@ -133,6 +134,7 @@ pmp-check-mysql-deadlocks - Alert when pt-deadlock-logger has recorded too many
     -H HOST         MySQL hostname.
     -i INTERVAL     Interval over which to count, in minutes; default 1.
     -l USER         MySQL username.
+    -L LOGIN-PATH   Use login-path to access MySQL (with MySQL client 5.6).
     -p PASS         MySQL password.
     -P PORT         MySQL port.
     -S SOCKET       MySQL socket file.
@@ -180,7 +182,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.
 
 =head1 VERSION
 
-Percona Monitoring Plugins pmp-check-mysql-deadlocks 1.1.3
+Percona Monitoring Plugins pmp-check-mysql-deadlocks 1.1.4
 
 =cut
 
diff --git a/percona-nagios-plugins/nagios/bin/pmp-check-mysql-deleted-files b/percona-nagios-plugins/nagios/bin/pmp-check-mysql-deleted-files
index 8470188..fc7c1dc 100755
--- a/percona-nagios-plugins/nagios/bin/pmp-check-mysql-deleted-files
+++ b/percona-nagios-plugins/nagios/bin/pmp-check-mysql-deleted-files
@@ -32,6 +32,7 @@ main() {
          --defaults-file) shift; OPT_DEFT="${1}"; shift; ;;
          -H)              shift; OPT_HOST="${1}"; shift; ;;
          -l)              shift; OPT_USER="${1}"; shift; ;;
+         -L)              shift; OPT_LOPA="${1}"; shift; ;;
          -p)              shift; OPT_PASS="${1}"; shift; ;;
          -P)              shift; OPT_PORT="${1}"; shift; ;;
          -S)              shift; OPT_SOCK="${1}"; shift; ;;
@@ -109,7 +110,7 @@ _pidof() {
 mysql_exec() {
    mysql ${OPT_DEFT:+--defaults-file="${OPT_DEFT}"} ${OPT_HOST:+-h"${OPT_HOST}"} ${OPT_USER:+-u"${OPT_USER}"} \
       ${OPT_PASS:+-p"${OPT_PASS}"} ${OPT_SOCK:+-S"${OPT_SOCK}"} ${OPT_PORT:+-P"${OPT_PORT}"} \
-      -ss -e "$1"
+      ${OPT_LOPA:+--login-path="${OPT_LOPA}"} -ss -e "$1"
 }
 
 # ########################################################################
@@ -189,6 +190,7 @@ pmp-check-mysql-deleted-files - Alert when MySQL's files are deleted.
                     Defaults to /etc/nagios/mysql.cnf if it exists.
     -H HOST         MySQL hostname.
     -l USER         MySQL username.
+    -L LOGIN-PATH   Use login-path to access MySQL (with MySQL client 5.6).
     -p PASS         MySQL password.
     -P PORT         MySQL port.
     -S SOCKET       MySQL socket file.
@@ -275,7 +277,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.
 
 =head1 VERSION
 
-Percona Monitoring Plugins pmp-check-mysql-deleted-files 1.1.3
+Percona Monitoring Plugins pmp-check-mysql-deleted-files 1.1.4
 
 =cut
 
diff --git a/percona-nagios-plugins/nagios/bin/pmp-check-mysql-file-privs b/percona-nagios-plugins/nagios/bin/pmp-check-mysql-file-privs
index c0083cf..6c79072 100755
--- a/percona-nagios-plugins/nagios/bin/pmp-check-mysql-file-privs
+++ b/percona-nagios-plugins/nagios/bin/pmp-check-mysql-file-privs
@@ -33,6 +33,7 @@ main() {
          -g)              shift; OPT_UNIX_GROUP="${1}"; shift; ;;
          -H)              shift; OPT_HOST="${1}"; shift; ;;
          -l)              shift; OPT_USER="${1}"; shift; ;;
+         -L)              shift; OPT_LOPA="${1}"; shift; ;;
          -p)              shift; OPT_PASS="${1}"; shift; ;;
          -P)              shift; OPT_PORT="${1}"; shift; ;;
          -S)              shift; OPT_SOCK="${1}"; shift; ;;
@@ -125,7 +126,7 @@ main() {
 mysql_exec() {
    mysql ${OPT_DEFT:+--defaults-file="${OPT_DEFT}"} ${OPT_HOST:+-h"${OPT_HOST}"} ${OPT_USER:+-u"${OPT_USER}"} \
       ${OPT_PASS:+-p"${OPT_PASS}"} ${OPT_SOCK:+-S"${OPT_SOCK}"} ${OPT_PORT:+-P"${OPT_PORT}"} \
-      -ss -e "$1"
+      ${OPT_LOPA:+--login-path="${OPT_LOPA}"} -ss -e "$1"
 }
 
 # ########################################################################
@@ -183,6 +184,7 @@ pmp-check-mysql-file-privs - Alert if MySQL data directory privileges are wrong.
     -g GROUP        The Unix group who should own the files; default mysql.
     -H HOST         MySQL hostname.
     -l USER         MySQL username.
+    -L LOGIN-PATH   Use login-path to access MySQL (with MySQL client 5.6).
     -p PASS         MySQL password.
     -P PORT         MySQL port.
     -S SOCKET       MySQL socket file.
@@ -278,7 +280,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.
 
 =head1 VERSION
 
-Percona Monitoring Plugins pmp-check-mysql-file-privs 1.1.3
+Percona Monitoring Plugins pmp-check-mysql-file-privs 1.1.4
 
 =cut
 
diff --git a/percona-nagios-plugins/nagios/bin/pmp-check-mysql-innodb b/percona-nagios-plugins/nagios/bin/pmp-check-mysql-innodb
index a0899bc..0ac4369 100755
--- a/percona-nagios-plugins/nagios/bin/pmp-check-mysql-innodb
+++ b/percona-nagios-plugins/nagios/bin/pmp-check-mysql-innodb
@@ -33,6 +33,7 @@ main() {
          --defaults-file) shift; OPT_DEFT="${1}"; shift; ;;
          -H)              shift; OPT_HOST="${1}"; shift; ;;
          -l)              shift; OPT_USER="${1}"; shift; ;;
+         -L)              shift; OPT_LOPA="${1}"; shift; ;;
          -p)              shift; OPT_PASS="${1}"; shift; ;;
          -P)              shift; OPT_PORT="${1}"; shift; ;;
          -S)              shift; OPT_SOCK="${1}"; shift; ;;
@@ -164,7 +165,7 @@ main() {
 mysql_exec() {
    mysql ${OPT_DEFT:+--defaults-file="${OPT_DEFT}"} ${OPT_HOST:+-h"${OPT_HOST}"} ${OPT_USER:+-u"${OPT_USER}"} \
       ${OPT_PASS:+-p"${OPT_PASS}"} ${OPT_SOCK:+-S"${OPT_SOCK}"} ${OPT_PORT:+-P"${OPT_PORT}"} \
-      -ss -e "$1"
+      ${OPT_LOPA:+--login-path="${OPT_LOPA}"} -ss -e "$1"
 }
 
 # ########################################################################
@@ -274,6 +275,7 @@ pmp-check-mysql-innodb - Alert on problems inside InnoDB.
                     Defaults to /etc/nagios/mysql.cnf if it exists.
     -H HOST         MySQL hostname.
     -l USER         MySQL username.
+    -L LOGIN-PATH   Use login-path to access MySQL (with MySQL client 5.6).
     -p PASS         MySQL password.
     -P PORT         MySQL port.
     -S SOCKET       MySQL socket file.
@@ -356,7 +358,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.
 
 =head1 VERSION
 
-Percona Monitoring Plugins pmp-check-mysql-innodb 1.1.3
+Percona Monitoring Plugins pmp-check-mysql-innodb 1.1.4
 
 =cut
 
diff --git a/percona-nagios-plugins/nagios/bin/pmp-check-mysql-pidfile b/percona-nagios-plugins/nagios/bin/pmp-check-mysql-pidfile
index 5cd1880..ecfd8e1 100755
--- a/percona-nagios-plugins/nagios/bin/pmp-check-mysql-pidfile
+++ b/percona-nagios-plugins/nagios/bin/pmp-check-mysql-pidfile
@@ -32,6 +32,7 @@ main() {
          --defaults-file) shift; OPT_DEFT="${1}"; shift; ;;
          -H)              shift; OPT_HOST="${1}"; shift; ;;
          -l)              shift; OPT_USER="${1}"; shift; ;;
+         -L)              shift; OPT_LOPA="${1}"; shift; ;;
          -p)              shift; OPT_PASS="${1}"; shift; ;;
          -P)              shift; OPT_PORT="${1}"; shift; ;;
          -S)              shift; OPT_SOCK="${1}"; shift; ;;
@@ -120,7 +121,7 @@ main() {
 mysql_exec() {
    mysql ${OPT_DEFT:+--defaults-file="${OPT_DEFT}"} ${OPT_HOST:+-h"${OPT_HOST}"} ${OPT_USER:+-u"${OPT_USER}"} \
       ${OPT_PASS:+-p"${OPT_PASS}"} ${OPT_SOCK:+-S"${OPT_SOCK}"} ${OPT_PORT:+-P"${OPT_PORT}"} \
-      -ss -e "$1"
+      ${OPT_LOPA:+--login-path="${OPT_LOPA}"} -ss -e "$1"
 }
 
 # ########################################################################
@@ -198,6 +199,7 @@ pmp-check-mysql-pidfile - Alert when the mysqld PID file is missing.
                     Defaults to /etc/nagios/mysql.cnf if it exists.
     -H HOST         MySQL hostname.
     -l USER         MySQL username.
+    -L LOGIN-PATH   Use login-path to access MySQL (with MySQL client 5.6).
     -p PASS         MySQL password.
     -P PORT         MySQL port.
     -S SOCKET       MySQL socket file.
@@ -280,7 +282,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.
 
 =head1 VERSION
 
-Percona Monitoring Plugins pmp-check-mysql-pidfile 1.1.3
+Percona Monitoring Plugins pmp-check-mysql-pidfile 1.1.4
 
 =cut
 
diff --git a/percona-nagios-plugins/nagios/bin/pmp-check-mysql-processlist b/percona-nagios-plugins/nagios/bin/pmp-check-mysql-processlist
index b79e938..02d684a 100755
--- a/percona-nagios-plugins/nagios/bin/pmp-check-mysql-processlist
+++ b/percona-nagios-plugins/nagios/bin/pmp-check-mysql-processlist
@@ -33,6 +33,7 @@ main() {
          --defaults-file) shift; OPT_DEFT="${1}"; shift; ;;
          -H)              shift; OPT_HOST="${1}"; shift; ;;
          -l)              shift; OPT_USER="${1}"; shift; ;;
+         -L)              shift; OPT_LOPA="${1}"; shift; ;;
          -p)              shift; OPT_PASS="${1}"; shift; ;;
          -P)              shift; OPT_PORT="${1}"; shift; ;;
          -S)              shift; OPT_SOCK="${1}"; shift; ;;
@@ -172,7 +173,7 @@ max() {
 mysql_exec() {
    mysql ${OPT_DEFT:+--defaults-file="${OPT_DEFT}"} ${OPT_HOST:+-h"${OPT_HOST}"} ${OPT_USER:+-u"${OPT_USER}"} \
       ${OPT_PASS:+-p"${OPT_PASS}"} ${OPT_SOCK:+-S"${OPT_SOCK}"} ${OPT_PORT:+-P"${OPT_PORT}"} \
-      -ss -e "$1"
+      ${OPT_LOPA:+--login-path="${OPT_LOPA}"} -ss -e "$1"
 }
 
 # ########################################################################
@@ -221,6 +222,7 @@ pmp-check-mysql-processlist - Alert when MySQL processlist has dangerous pattern
                     Defaults to /etc/nagios/mysql.cnf if it exists.
     -H HOST         MySQL hostname.
     -l USER         MySQL username.
+    -L LOGIN-PATH   Use login-path to access MySQL (with MySQL client 5.6).
     -p PASS         MySQL password.
     -P PORT         MySQL port.
     -S SOCKET       MySQL socket file.
@@ -312,7 +314,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.
 
 =head1 VERSION
 
-Percona Monitoring Plugins pmp-check-mysql-processlist 1.1.3
+Percona Monitoring Plugins pmp-check-mysql-processlist 1.1.4
 
 =cut
 
diff --git a/percona-nagios-plugins/nagios/bin/pmp-check-mysql-replication-delay b/percona-nagios-plugins/nagios/bin/pmp-check-mysql-replication-delay
index 3a383d9..2d22c18 100755
--- a/percona-nagios-plugins/nagios/bin/pmp-check-mysql-replication-delay
+++ b/percona-nagios-plugins/nagios/bin/pmp-check-mysql-replication-delay
@@ -4,7 +4,7 @@
 # This program is part of Percona Monitoring Plugins
 # License: GPL License (see COPYING)
 # Authors:
-#  Baron Schwartz
+#  Baron Schwartz, Roman Vynar
 # ########################################################################
 
 # ########################################################################
@@ -32,6 +32,8 @@ main() {
          --defaults-file) shift; OPT_DEFT="${1}"; shift; ;;
          -H)              shift; OPT_HOST="${1}"; shift; ;;
          -l)              shift; OPT_USER="${1}"; shift; ;;
+         -L)              shift; OPT_LOPA="${1}"; shift; ;;
+         -m)              shift; OPT_MIN="${1}"; shift; ;;
          -p)              shift; OPT_PASS="${1}"; shift; ;;
          -P)              shift; OPT_PORT="${1}"; shift; ;;
          -S)              shift; OPT_SOCK="${1}"; shift; ;;
@@ -46,6 +48,7 @@ main() {
    done
    OPT_WARN=${OPT_WARN:-300}
    OPT_CRIT=${OPT_CRIT:-600}
+   OPT_MIN=${OPT_MIN:-0}
    if [ -e '/etc/nagios/mysql.cnf' ]; then
       OPT_DEFT="${OPT_DEFT:-/etc/nagios/mysql.cnf}"
    fi
@@ -63,7 +66,7 @@ main() {
       else
          NOW_FUNC='UNIX_TIMESTAMP(UTC_TIMESTAMP)'
       fi
-      SQL="SELECT MAX(${NOW_FUNC} - UNIX_TIMESTAMP(ts)) AS delay
+      SQL="SELECT MAX(${NOW_FUNC} - ROUND(UNIX_TIMESTAMP(ts))) AS delay
          FROM ${OPT_TABLE} WHERE (${OPT_SRVID:-0} = 0 OR server_id = ${OPT_SRVID:-0})"
       LEVEL=$(mysql_exec "${SQL}")
       MYSQL_CONN=$?
@@ -71,7 +74,8 @@ main() {
       local TEMP=$(mktemp -t "${0##*/}.XXXXXX") || exit $?
       trap "rm -f '${TEMP}' >/dev/null 2>&1" EXIT
       if [ -z "$1" ]; then
-         mysql_exec 'SHOW SLAVE STATUS\G' > "${TEMP}"
+         # Leverage lock-free SHOW SLAVE STATUS NOLOCK with Percona Server
+         mysql_exec "SHOW SLAVE STATUS NOLOCK\G" > "${TEMP}" 2>/dev/null || mysql_exec "SHOW SLAVE STATUS\G" > "${TEMP}"
          MYSQL_CONN=$?
       else
          # This is for testing only.
@@ -91,6 +95,9 @@ main() {
       NOTE="${LEVEL:-0} seconds of replication delay"
       if [ "${LEVEL:-""}" = "NULL" ]; then
          NOTE="UNK replica is stopped"
+      # pt-slave-delayed slave
+      elif [ "${LEVEL:-0}" -lt "${OPT_MIN}" ]; then
+         NOTE="CRIT (delayed slave) $NOTE | $PERFDATA"
       elif [ "${LEVEL:-0}" -gt "${OPT_CRIT}" ]; then
          NOTE="CRIT $NOTE | $PERFDATA"
       elif [ "${LEVEL:-0}" -gt "${OPT_WARN}" ]; then
@@ -110,7 +117,7 @@ main() {
 mysql_exec() {
    mysql ${OPT_DEFT:+--defaults-file="${OPT_DEFT}"} ${OPT_HOST:+-h"${OPT_HOST}"} ${OPT_USER:+-u"${OPT_USER}"} \
       ${OPT_PASS:+-p"${OPT_PASS}"} ${OPT_SOCK:+-S"${OPT_SOCK}"} ${OPT_PORT:+-P"${OPT_PORT}"} \
-      -ss -e "$1"
+      ${OPT_LOPA:+--login-path="${OPT_LOPA}"} -ss -e "$1"
 }
 
 # ########################################################################
@@ -157,6 +164,8 @@ pmp-check-mysql-replication-delay - Alert when MySQL replication becomes delayed
                     Defaults to /etc/nagios/mysql.cnf if it exists.
     -H HOST         MySQL hostname.
     -l USER         MySQL username.
+    -L LOGIN-PATH   Use login-path to access MySQL (with MySQL client 5.6).
+    -m CRIT         Minimal threshold to ensure for delayed slaves; default 0.
     -p PASS         MySQL password.
     -P PORT         MySQL port.
     -S SOCKET       MySQL socket file.
@@ -179,6 +188,10 @@ Percona Toolkit instead.  Use the -T option to specify which table pt-heartbeat
 updates.  Use the -s option to specify the master's server_id to compare
 against; otherwise the plugin reports the maximum delay from any server.
 
+If you want to run this check against the delayed slaves, e.g. those running
+with pt-slave-delay tool, you may want to use -m option specifying the minimal
+delay that should be ongoing, otherwise the plugin will alert critical.
+
 =head1 PRIVILEGES
 
 This plugin executes the following commands against MySQL:
@@ -187,7 +200,9 @@ This plugin executes the following commands against MySQL:
 
 =item *
 
-C<SHOW SLAVE STATUS>.
+C<SHOW SLAVE STATUS NOLOCK> with Percona Server and w/o NOLOCK otherwise.
+
+or 
 
 =item *
 
@@ -214,7 +229,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.
 
 =head1 VERSION
 
-Percona Monitoring Plugins pmp-check-mysql-replication-delay 1.1.3
+Percona Monitoring Plugins pmp-check-mysql-replication-delay 1.1.4
 
 =cut
 
diff --git a/percona-nagios-plugins/nagios/bin/pmp-check-mysql-replication-running b/percona-nagios-plugins/nagios/bin/pmp-check-mysql-replication-running
index 9680b3a..0001679 100755
--- a/percona-nagios-plugins/nagios/bin/pmp-check-mysql-replication-running
+++ b/percona-nagios-plugins/nagios/bin/pmp-check-mysql-replication-running
@@ -4,7 +4,7 @@
 # This program is part of Percona Monitoring Plugins
 # License: GPL License (see COPYING)
 # Authors:
-#  Baron Schwartz
+#  Baron Schwartz, Roman Vynar
 # ########################################################################
 
 # ########################################################################
@@ -30,8 +30,10 @@ main() {
       case "${o}" in
          -c)              shift; OPT_CRIT="${1}"; shift; ;;
          --defaults-file) shift; OPT_DEFT="${1}"; shift; ;;
+         -d)              shift; OPT_DELD=1; shift; ;;
          -H)              shift; OPT_HOST="${1}"; shift; ;;
          -l)              shift; OPT_USER="${1}"; shift; ;;
+         -L)              shift; OPT_LOPA="${1}"; shift; ;;
          -p)              shift; OPT_PASS="${1}"; shift; ;;
          -P)              shift; OPT_PORT="${1}"; shift; ;;
          -S)              shift; OPT_SOCK="${1}"; shift; ;;
@@ -57,7 +59,8 @@ main() {
    local TEMP=$(mktemp -t "${0##*/}.XXXXXX") || exit $?
    trap "rm -f '${TEMP}' >/dev/null 2>&1" EXIT
    if [ -z "$1" ]; then
-      mysql_exec 'SHOW SLAVE STATUS\G' > "${TEMP}"
+      # Leverage lock-free SHOW SLAVE STATUS NOLOCK with Percona Server
+      mysql_exec "SHOW SLAVE STATUS NOLOCK\G" > "${TEMP}" 2>/dev/null || mysql_exec "SHOW SLAVE STATUS\G" > "${TEMP}"
    else
       # This is just for testing.  /dev/null it.
       cat "$1" > "${TEMP}" 2>/dev/null
@@ -70,6 +73,11 @@ main() {
          NOTE=$(awk '$1 ~ /_Running:|Last_Error:/{print substr($0, 1, 100)}' "${TEMP}")
          if grep 'Last_Error: .' "${TEMP}" >/dev/null 2>&1; then
             NOTE="CRIT $NOTE"
+         # pt-slave-delayed slave
+         elif [ -n "${OPT_DELD}" ] &&
+              grep 'Slave_IO_Running: Yes' "${TEMP}" >/dev/null 2>&1 &&
+              grep 'Slave_SQL_Running: No' "${TEMP}" >/dev/null 2>&1; then
+            NOTE="OK (delayed slave) $NOTE"
          elif egrep "_Running: (No|Connecting)" "${TEMP}" >/dev/null 2>&1; then
             if [ "${OPT_CRIT}" ]; then
                NOTE="CRIT $NOTE"
@@ -99,7 +107,7 @@ main() {
 mysql_exec() {
    mysql ${OPT_DEFT:+--defaults-file="${OPT_DEFT}"} ${OPT_HOST:+-h"${OPT_HOST}"} ${OPT_USER:+-u"${OPT_USER}"} \
       ${OPT_PASS:+-p"${OPT_PASS}"} ${OPT_SOCK:+-S"${OPT_SOCK}"} ${OPT_PORT:+-P"${OPT_PORT}"} \
-      -ss -e "$1"
+      ${OPT_LOPA:+--login-path="${OPT_LOPA}"} -ss -e "$1"
 }
 
 # ########################################################################
@@ -141,11 +149,14 @@ pmp-check-mysql-replication-running - Alert when MySQL replication stops.
 
   Usage: pmp-check-mysql-replication-running [OPTIONS]
   Options:
-    -c CRIT         Report CRITICAL when replication is stopped without errors.
+    -c CRIT         Report CRITICAL when replication is stopped with or w/o errors.
     --defaults-file FILE Only read mysql options from the given file.
                     Defaults to /etc/nagios/mysql.cnf if it exists.
+    -d              Useful for slaves delayed by pt-slave-delay. It will not alert
+                    when IO thread is running, SQL one is not and no errors.
     -H HOST         MySQL hostname.
     -l USER         MySQL username.
+    -L LOGIN-PATH   Use login-path to access MySQL (with MySQL client 5.6).
     -p PASS         MySQL password.
     -P PORT         MySQL port.
     -S SOCKET       MySQL socket file.
@@ -174,6 +185,10 @@ produces no output, which means it is not configured as a replica.  By default,
 this plugin will report that replication is healthy when a server isn't
 configured as a replica.
 
+If you want to run this check against the delayed slaves, e.g. those running
+with pt-slave-delay tool, you may want to specify -d option. It will not alert
+when Slave_IO_Running is Yes, Slave_SQL_Running is No and there are no errors.
+
 =head1 PRIVILEGES
 
 This plugin executes the following commands against MySQL:
@@ -182,7 +197,7 @@ This plugin executes the following commands against MySQL:
 
 =item *
 
-C<SHOW SLAVE STATUS>.
+C<SHOW SLAVE STATUS NOLOCK> with Percona Server and w/o NOLOCK otherwise.
 
 =back
 
@@ -205,7 +220,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.
 
 =head1 VERSION
 
-Percona Monitoring Plugins pmp-check-mysql-replication-running 1.1.3
+Percona Monitoring Plugins pmp-check-mysql-replication-running 1.1.4
 
 =cut
 
diff --git a/percona-nagios-plugins/nagios/bin/pmp-check-mysql-status b/percona-nagios-plugins/nagios/bin/pmp-check-mysql-status
index 6f52986..23e217a 100755
--- a/percona-nagios-plugins/nagios/bin/pmp-check-mysql-status
+++ b/percona-nagios-plugins/nagios/bin/pmp-check-mysql-status
@@ -34,6 +34,7 @@ main() {
          -H)              shift; OPT_HOST="${1}"; shift; ;;
          -I)              shift; OPT_INCR="${1}"; shift; ;;
          -l)              shift; OPT_USER="${1}"; shift; ;;
+         -L)              shift; OPT_LOPA="${1}"; shift; ;;
          -o)              shift; OPT_OPER="${1}"; shift; ;;
          -p)              shift; OPT_PASS="${1}"; shift; ;;
          -P)              shift; OPT_PORT="${1}"; shift; ;;
@@ -149,7 +150,7 @@ main() {
 mysql_exec() {
    mysql ${OPT_DEFT:+--defaults-file="${OPT_DEFT}"} ${OPT_HOST:+-h"${OPT_HOST}"} ${OPT_USER:+-u"${OPT_USER}"} \
       ${OPT_PASS:+-p"${OPT_PASS}"} ${OPT_SOCK:+-S"${OPT_SOCK}"} ${OPT_PORT:+-P"${OPT_PORT}"} \
-      -ss -e "$1"
+      ${OPT_LOPA:+--login-path="${OPT_LOPA}"} -ss -e "$1"
 }
 
 # ########################################################################
@@ -342,6 +343,7 @@ pmp-check-mysql-status - Check MySQL SHOW GLOBAL STATUS output.
     -H HOST         MySQL hostname.
     -I INCR         Make SHOW STATUS incremental over this delay.
     -l USER         MySQL username.
+    -L LOGIN-PATH   Use login-path to access MySQL (with MySQL client 5.6).
     -o OPERATOR     The operator to apply to -x and -y.
     -p PASS         MySQL password.
     -P PORT         MySQL port.
@@ -471,7 +473,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.
 
 =head1 VERSION
 
-Percona Monitoring Plugins pmp-check-mysql-status 1.1.3
+Percona Monitoring Plugins pmp-check-mysql-status 1.1.4
 
 =cut
 
diff --git a/percona-nagios-plugins/nagios/bin/pmp-check-mysql-ts-count b/percona-nagios-plugins/nagios/bin/pmp-check-mysql-ts-count
index 0190522..1dce380 100755
--- a/percona-nagios-plugins/nagios/bin/pmp-check-mysql-ts-count
+++ b/percona-nagios-plugins/nagios/bin/pmp-check-mysql-ts-count
@@ -35,6 +35,7 @@ main() {
          -H)              shift; OPT_HOST="${1}"; shift; ;;
          -i)              shift; OPT_INTERVAL="${1}"; shift; ;;
          -l)              shift; OPT_USER="${1}"; shift; ;;
+         -L)              shift; OPT_LOPA="${1}"; shift; ;;
          -p)              shift; OPT_PASS="${1}"; shift; ;;
          -P)              shift; OPT_PORT="${1}"; shift; ;;
          -S)              shift; OPT_SOCK="${1}"; shift; ;;
@@ -97,7 +98,7 @@ main() {
 mysql_exec() {
    mysql ${OPT_DEFT:+--defaults-file="${OPT_DEFT}"} ${OPT_HOST:+-h"${OPT_HOST}"} ${OPT_USER:+-u"${OPT_USER}"} \
       ${OPT_PASS:+-p"${OPT_PASS}"} ${OPT_SOCK:+-S"${OPT_SOCK}"} ${OPT_PORT:+-P"${OPT_PORT}"} \
-      -ss -e "$1"
+      ${OPT_LOPA:+--login-path="${OPT_LOPA}"} -ss -e "$1"
 }
 
 # ########################################################################
@@ -145,6 +146,7 @@ pmp-check-mysql-ts-count - Generic alert based on pmp-check-mysql-deadlocks to c
     -H HOST         MySQL hostname.
     -i INTERVAL     Interval over which to count, in minutes; default 1.
     -l USER         MySQL username.
+    -L LOGIN-PATH   Use login-path to access MySQL (with MySQL client 5.6).
     -p PASS         MySQL password.
     -P PORT         MySQL port.
     -S SOCKET       MySQL socket file.
@@ -199,7 +201,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.
 
 =head1 VERSION
 
-Percona Monitoring Plugins pmp-check-mysql-ts-count 1.1.3
+Percona Monitoring Plugins pmp-check-mysql-ts-count 1.1.4
 
 =cut
 
diff --git a/percona-nagios-plugins/nagios/bin/pmp-check-pt-table-checksum b/percona-nagios-plugins/nagios/bin/pmp-check-pt-table-checksum
index 8668222..1fd7b74 100755
--- a/percona-nagios-plugins/nagios/bin/pmp-check-pt-table-checksum
+++ b/percona-nagios-plugins/nagios/bin/pmp-check-pt-table-checksum
@@ -33,6 +33,7 @@ main() {
          -H)              shift; OPT_HOST="${1}"; shift; ;;
          -i)              shift; OPT_INTERVAL="${1}"; shift; ;;
          -l)              shift; OPT_USER="${1}"; shift; ;;
+         -L)              shift; OPT_LOPA="${1}"; shift; ;;
          -p)              shift; OPT_PASS="${1}"; shift; ;;
          -P)              shift; OPT_PORT="${1}"; shift; ;;
          -S)              shift; OPT_SOCK="${1}"; shift; ;;
@@ -100,7 +101,7 @@ main() {
 mysql_exec() {
    mysql ${OPT_DEFT:+--defaults-file="${OPT_DEFT}"} ${OPT_HOST:+-h"${OPT_HOST}"} ${OPT_USER:+-u"${OPT_USER}"} \
       ${OPT_PASS:+-p"${OPT_PASS}"} ${OPT_SOCK:+-S"${OPT_SOCK}"} ${OPT_PORT:+-P"${OPT_PORT}"} \
-      -ss -e "$1"
+      ${OPT_LOPA:+--login-path="${OPT_LOPA}"} -ss -e "$1"
 }
 
 # ########################################################################
@@ -155,6 +156,7 @@ pmp-check-pt-table-checksum - Alert when pt-table-checksum finds data difference
                     Defaults to /etc/nagios/mysql.cnf if it exists.
     -H HOST         MySQL hostname.
     -l USER         MySQL username.
+    -L LOGIN-PATH   Use login-path to access MySQL (with MySQL client 5.6).
     -p PASS         MySQL password.
     -P PORT         MySQL port.
     -S SOCKET       MySQL socket file.
@@ -228,7 +230,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.
 
 =head1 VERSION
 
-Percona Monitoring Plugins pmp-check-pt-table-checksum 1.1.3
+Percona Monitoring Plugins pmp-check-pt-table-checksum 1.1.4
 
 =cut
 
diff --git a/percona-nagios-plugins/nagios/bin/pmp-check-unix-memory b/percona-nagios-plugins/nagios/bin/pmp-check-unix-memory
index ce575f1..dbd16ed 100755
--- a/percona-nagios-plugins/nagios/bin/pmp-check-unix-memory
+++ b/percona-nagios-plugins/nagios/bin/pmp-check-unix-memory
@@ -199,7 +199,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.
 
 =head1 VERSION
 
-Percona Monitoring Plugins pmp-check-unix-memory 1.1.3
+Percona Monitoring Plugins pmp-check-unix-memory 1.1.4
 
 =cut
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-nagios/pkg-nagios-plugins-contrib.git



More information about the Pkg-nagios-changes mailing list