2
0
mirror of https://github.com/munin-monitoring/contrib.git synced 2018-11-08 00:59:34 +01:00

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
This commit is contained in:
Johann Schmitz 2015-01-30 13:24:54 +01:00
parent 341798cdc3
commit 66c38543c7

View File

@ -1,7 +1,7 @@
#!/bin/bash
# Wildcard-plugin to monitor Firebird database transaction stats. To monitor a
# database, link firebird_<interface> to this file. E.g.
# ln -s /usr/share/munin/plugins/if_ /etc/munin/plugins/firebird_employee
# database, link firebird_<db> 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")
{