From c7bceeb4263d3664f5b20c0729cef1b29e45f748 Mon Sep 17 00:00:00 2001 From: Kasandra Padisha Date: Wed, 21 Sep 2011 18:23:52 +0200 Subject: [PATCH] Initial version --- plugins/other/cacti_poller_time | 36 +++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100755 plugins/other/cacti_poller_time diff --git a/plugins/other/cacti_poller_time b/plugins/other/cacti_poller_time new file mode 100755 index 00000000..8c6cc8d0 --- /dev/null +++ b/plugins/other/cacti_poller_time @@ -0,0 +1,36 @@ +#!/bin/bash +# +# Munin script to obtain the poller time +# by kasandrapadisha@gmail.com +# + +#----- Configuration variables +database="cacti" +hostname="localhost" +user="admincacti" +password="passwdcacti" + + +#----- Configuration variables +if [[ $1 != "" ]]; then + if [[ $1 == "autoconf" ]]; then + echo "yes" + exit 0 + fi + if [[ $1 == "config" ]]; then + echo "graph_title Poller Time" + echo "graph_vlabel Time(s)" + echo "poller_time.label time(s)" + echo 'graph_category cacti' + exit 0 + fi +fi + +salida=`mysql -B -e "SELECT value FROM settings WHERE name='stats_poller' LIMIT 1" -h $hostname --user=$user --password=$password $database` + +if [[ $? != 0 ]]; then + echo "No se pudo ejecutar" + exit 0 +fi + +echo $salida | cut -f 2 -d":" | awk '{print"poller_time.value "$1}'