From 66c38543c7acb1c80c694b3ea05460d023fb0d69 Mon Sep 17 00:00:00 2001 From: Johann Schmitz Date: Fri, 30 Jan 2015 13:24:54 +0100 Subject: [PATCH] Fixed firebird plugin: * Use gstat from path if available; fall back to /opt/firebird/bin/gstat if gstat could not be found * Use bash to strip of firebird_ prefix from name * Fixed description --- plugins/firebird/firebird | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/plugins/firebird/firebird b/plugins/firebird/firebird index b29a2246..74781a9b 100755 --- a/plugins/firebird/firebird +++ b/plugins/firebird/firebird @@ -1,7 +1,7 @@ #!/bin/bash # Wildcard-plugin to monitor Firebird database transaction stats. To monitor a -# database, link firebird_ to this file. E.g. -# ln -s /usr/share/munin/plugins/if_ /etc/munin/plugins/firebird_employee +# database, link firebird_ to this file. E.g. +# ln -s /usr/share/munin/plugins/firebird_ /etc/munin/plugins/firebird_employee # # ...will monitor firebird database "employee" # @@ -47,9 +47,11 @@ EOM exit 0;; esac -db=`echo $0 | awk -F'_' '{print $2}'` +db=${0/firebird_/} -/opt/firebird/bin/gstat -h ${db} | awk -F'[\t]+' \ +gstat=$(which gstat 2> /dev/null) + +${gstat:=/opt/firebird/bin/gstat} -h ${db} | awk -F'[\t]+' \ '{ sub(/^ */,""); if ($2 == "Oldest transaction") {