additions to unix-agent. addition of basic munin-plugin support.

git-svn-id: http://www.observium.org/svn/observer/trunk@3088 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2012-04-26 11:57:52 +00:00
parent b56d3d6320
commit 283f33afa1
12 changed files with 146 additions and 154 deletions

View File

@@ -0,0 +1,5 @@
These are local plugin scripts for the Observium Unix Agent.
*DO NOT* put all of these files into your local folder, only use the scripts you want.
Make sure that you configure any scripts that require configuration. (MySQL!)

View File

@@ -14,7 +14,7 @@
use LWP::Simple;
$CACHETIME = 30;
$CACHEFILE = '/tmp/snmp-cache-apache';
$CACHEFILE = '/tmp/observium-agent-apache';
# check for cache file newer CACHETIME seconds ago
if ( -f $CACHEFILE && time - (stat( $CACHEFILE ))[9] < $CACHETIME) {

14
scripts/agent-local/munin Executable file
View File

@@ -0,0 +1,14 @@
# Lokale Einzelchecks
if cd munin-scripts
then
for skript in $(ls)
do
if [ -x "$skript" ] ; then
echo "<<<munin-$skript>>>"
./$skript
./$skript config
fi
done
cd ..
fi

View File

@@ -49,7 +49,7 @@ $mysql_port = 3306;
$mysql_ssl = FALSE; # Whether to use SSL to connect to MySQL.
$heartbeat = ''; # db.tbl in case you use mk-heartbeat from Maatkit.
$cache_dir = '/tmp'; # If set, this uses caching to avoid multiple calls.
$cache_dir = '/tmp'; # If set, this uses caching to avoid multiple calls.
$cache_time = 30; # How long to cache data.
$chk_options = array (
@@ -283,7 +283,7 @@ function ss_get_mysql_stats( $options ) {
}
$sanitized_host = str_replace(array(":", "/"), array("", "_"), $host);
$cache_file = "$cache_dir/mysql_stats.txt";
$cache_file = "$cache_dir/observium-agent-mysql";
debug("Cache file is $cache_file");
# First, check the cache.