mirror of
https://github.com/munin-monitoring/contrib.git
synced 2018-11-08 00:59:34 +01:00
Initial version
This commit is contained in:
parent
ed746fda0a
commit
4b5ab0b30b
36
plugins/other/cacti-host
Executable file
36
plugins/other/cacti-host
Executable file
@ -0,0 +1,36 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Munin script to obtain the number o hosts
|
||||
# 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 Servidores consultados"
|
||||
echo "graph_vlabel Numero servidores (s)"
|
||||
echo "poller_hosts.label hosts(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 6 -d":" | awk '{print"poller_hosts.value "$1}'
|
Loading…
Reference in New Issue
Block a user