2011-09-21 18:23:52 +02:00
|
|
|
#!/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)"
|
2017-02-23 04:00:39 +01:00
|
|
|
echo 'graph_category munin'
|
2011-09-21 18:23:52 +02:00
|
|
|
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}'
|