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

replace hard-coded paths (e.g. '/var/lib/munin/plugin-state') with '$MUNIN_PLUGSTATE'

see http://guide.munin-monitoring.org/en/latest/plugin/env.html
This commit is contained in:
Lars Kruse 2017-04-18 23:32:55 +02:00
parent a2b340a791
commit 4b2fcbf8b9
42 changed files with 45 additions and 51 deletions

View file

@ -18,7 +18,6 @@
# #
# Config variables: # Config variables:
# AMAVIS_LOG - file where amavis logs are written # AMAVIS_LOG - file where amavis logs are written
# STATEFILE - file which is needed to keep track of AMAVIS_LOG
# LOGTAIL - location of logtail # LOGTAIL - location of logtail
# BC - location of bc # BC - location of bc
# #
@ -27,7 +26,7 @@
# #
AMAVIS_LOG=${logfile:-/var/log/mail.log} AMAVIS_LOG=${logfile:-/var/log/mail.log}
STATEFILE=/var/lib/munin/plugin-state/amavis.offset STATEFILE=$MUNIN_PLUGSTATE/amavis.offset
LOGTAIL=${logtail:-`which logtail`} LOGTAIL=${logtail:-`which logtail`}
BC=${bc:-`which bc`} BC=${bc:-`which bc`}

View file

@ -18,7 +18,7 @@
LOGDIR=${logdir:-/var/log/amavis} LOGDIR=${logdir:-/var/log/amavis}
MAIL_LOG=$LOGDIR/${logfile:-amavisd.log} MAIL_LOG=$LOGDIR/${logfile:-amavisd.log}
LOGTAIL=${logtail:-`which logtail`} LOGTAIL=${logtail:-`which logtail`}
STATEFILE=/var/lib/munin/plugin-state/amavis.offset STATEFILE=$MUNIN_PLUGSTATE/amavis.offset
if [ "$1" = "autoconf" ]; then if [ "$1" = "autoconf" ]; then
if [ -f "${MAIL_LOG}" -a -n "${LOGTAIL}" -a -x "${LOGTAIL}" ] ; then if [ -f "${MAIL_LOG}" -a -n "${LOGTAIL}" -a -x "${LOGTAIL}" ] ; then

View file

@ -16,9 +16,8 @@ Counts the in/out bandwidth used by each projects/vhost. [Logtail] (https://www.
## Installation ## Installation
The setup is pretty straight forward. First you need to configure the plugin: The setup is pretty straight forward. First you need to configure the plugin:
Define the file which will be used by logtail to identify it's position in the log and the path to logtail: Define the path to logtail:
$statepath = '/usr/local/var/munin/plugin-state'; # directory where logtail will save the state
$logtail = '/usr/local/bin/logtail'; $logtail = '/usr/local/bin/logtail';
Multiple logs can be used for the same project/vhost and a regular expression (regex) can be used as a filter: Multiple logs can be used for the same project/vhost and a regular expression (regex) can be used as a filter:

View file

@ -26,7 +26,7 @@ use strict;
my $server = 'Apache'; my $server = 'Apache';
my $statepath = '/usr/local/var/munin/plugin-state'; my $statepath = $ENV{MUNIN_PLUGSTATE};
my $logtail = '/usr/local/bin/logtail'; my $logtail = '/usr/local/bin/logtail';
my %logs = ( my %logs = (

View file

@ -31,7 +31,7 @@ use strict;
my $server = 'Apache'; my $server = 'Apache';
my $statepath = '/usr/local/var/munin/plugin-state'; my $statepath = $ENV{MUNIN_PLUGSTATE};
my $logtail = '/usr/local/bin/logtail'; my $logtail = '/usr/local/bin/logtail';
my %logs = ( my %logs = (

View file

@ -31,7 +31,7 @@ use strict;
my $server = 'Apache'; my $server = 'Apache';
my $statepath = '/usr/local/var/munin/plugin-state'; my $statepath = $ENV{MUNIN_PLUGSTATE};
my $logtail = '/usr/local/bin/logtail'; my $logtail = '/usr/local/bin/logtail';
my %logs = ( my %logs = (

View file

@ -12,7 +12,7 @@
# ####################################################################################### CONFIG # ####################################################################################### CONFIG
DIRECTORY=${MUNIN_PLUGINSTATE:-/var/lib/munin/plugin-state/apache_users} DIRECTORY=$MUNIN_PLUGSTATE/apache_users
TIMESTAMP=$DIRECTORY/.apache_users TIMESTAMP=$DIRECTORY/.apache_users
ACCESSLOG=/var/log/apache2/access_log ACCESSLOG=/var/log/apache2/access_log

View file

@ -19,7 +19,7 @@
B3NAME=${0##*/b3error_} B3NAME=${0##*/b3error_}
LOGTAIL=${logtail:-`which logtail`} LOGTAIL=${logtail:-`which logtail`}
#logfile from env #logfile from env
STATEFILE=/var/lib/munin/plugin-state/${B3NAME}.offset STATEFILE=$MUNIN_PLUGSTATE/${B3NAME}.offset
mktempfile () { mktempfile () {
mktemp -t $1 mktemp -t $1
@ -92,4 +92,4 @@ echo "eventqueue.value ${eventqueue}"
echo "parseline.value ${parseline}" echo "parseline.value ${parseline}"
echo "other.value ${other}" echo "other.value ${other}"
exit 0 exit 0

View file

@ -32,7 +32,7 @@ mktemp -t
MAIL_LOG=${logfile:-/var/log/mail.log} MAIL_LOG=${logfile:-/var/log/mail.log}
LOGTAIL=${logtail:-`which logtail`} LOGTAIL=${logtail:-`which logtail`}
STATEFILE=/var/lib/munin/plugin-state/dkimproxy_mails.offset STATEFILE=$MUNIN_PLUGSTATE/dkimproxy_mails.offset
if [ "$1" = "autoconf" ]; then if [ "$1" = "autoconf" ]; then
if [ -f "${MAIL_LOG}" -a -n "${LOGTAIL}" -a -x "${LOGTAIL}" ] ; then if [ -f "${MAIL_LOG}" -a -n "${LOGTAIL}" -a -x "${LOGTAIL}" ] ; then

View file

@ -22,7 +22,7 @@ mktemp -t $1
LOGFILE=${logfile:-/var/log/proftpd/xferlog} LOGFILE=${logfile:-/var/log/proftpd/xferlog}
LOGTAIL=${logtail:-`which logtail`} LOGTAIL=${logtail:-`which logtail`}
STATEFILE=/var/lib/munin/plugin-state/xferlog-bytes.offset STATEFILE=$MUNIN_PLUGSTATE/xferlog-bytes.offset
if [ "$1" = "autoconf" ]; then if [ "$1" = "autoconf" ]; then
if [ -f "${LOGFILE}" -a -n "${LOGTAIL}" -a -x "${LOGTAIL}" ] ; then if [ -f "${LOGFILE}" -a -n "${LOGTAIL}" -a -x "${LOGTAIL}" ] ; then

View file

@ -22,7 +22,7 @@ mktemp -t $1
LOGFILE=${logfile:-/var/log/proftpd/xferlog} LOGFILE=${logfile:-/var/log/proftpd/xferlog}
LOGTAIL=${logtail:-`which logtail`} LOGTAIL=${logtail:-`which logtail`}
STATEFILE=/var/lib/munin/plugin-state/xferlog-count.offset STATEFILE=$MUNIN_PLUGSTATE/xferlog-count.offset
if [ "$1" = "autoconf" ]; then if [ "$1" = "autoconf" ]; then
if [ -f "${LOGFILE}" -a -n "${LOGTAIL}" -a -x "${LOGTAIL}" ] ; then if [ -f "${LOGFILE}" -a -n "${LOGTAIL}" -a -x "${LOGTAIL}" ] ; then

View file

@ -32,7 +32,7 @@
LOGFILE=/var/log/pure-ftpd/transfer.log LOGFILE=/var/log/pure-ftpd/transfer.log
LOGTAIL=$(which logtail) LOGTAIL=$(which logtail)
OFFSET_FILE=/var/lib/munin/plugin-state/pure-ftpd-bw.offset OFFSET_FILE=$MUNIN_PLUGSTATE/pure-ftpd-bw.offset
if [ "$1" = "autoconf" ]; then if [ "$1" = "autoconf" ]; then

View file

@ -22,7 +22,7 @@
LOGFILE=/var/log/syslog LOGFILE=/var/log/syslog
LOGTAIL=$(which logtail) LOGTAIL=$(which logtail)
OFFSET_FILE=/var/lib/munin/plugin-state/pure-ftpd-conns.offset OFFSET_FILE=$MUNIN_PLUGSTATE/pure-ftpd-conns.offset
if [ "$1" = "autoconf" ]; then if [ "$1" = "autoconf" ]; then

View file

@ -25,14 +25,13 @@
# env.logtail /usr/bin/logtail # env.logtail /usr/bin/logtail
PROGNAME=vsftpd PROGNAME=vsftpd
STATEDIR=/var/lib/munin/plugin-state
LOGFILE=${logfile:-/var/log/vsftpd.log} LOGFILE=${logfile:-/var/log/vsftpd.log}
LOGTAIL=${logtail:-`which logtail`} LOGTAIL=${logtail:-`which logtail`}
OFFSET=${STATEDIR}/${PROGNAME}.offset OFFSET=${MUNIN_PLUGSTATE}/${PROGNAME}.offset
STATE=${STATEDIR}/${PROGNAME}.state STATE=${MUNIN_PLUGSTATE}/${PROGNAME}.state
PIVOT=${STATEDIR}/${PROGNAME}.pivot PIVOT=${MUNIN_PLUGSTATE}/${PROGNAME}.pivot
install_ok() install_ok()

View file

@ -30,7 +30,7 @@
$var = getenv('game_config_file'); $var = getenv('game_config_file');
$config = ($var) ? $var : "/etc/munin/munin-game.ini"; $config = ($var) ? $var : "/etc/munin/munin-game.ini";
$var = getenv('game_state_file'); $var = getenv('game_state_file');
$state = ($var) ? $var : "/var/lib/munin/plugin-state/game"; $state = ($var) ? $var : (getenv('MUNIN_PLUGSTATE') . "/game");
function p($str) { function p($str) {
// Quick function to print a string with an EOL on the end // Quick function to print a string with an EOL on the end

View file

@ -87,7 +87,7 @@ use HTML::LinkExtor;
use LWP::ConnCache; use LWP::ConnCache;
my $url_file="/etc/munin/http_load_urls.txt"; my $url_file="/etc/munin/http_load_urls.txt";
my $cachedir="/var/lib/munin/plugin-state"; my $cachedir=$ENV{MUNIN_PLUGSTATE};
my $debug=0; my $debug=0;
my $timeout=10; my $timeout=10;

View file

@ -39,7 +39,7 @@ my $logfile = $ENV{logfile} || "/var/log/app/jvm/gc.log";
my $grtitle = $ENV{graphtitle} || 'Sun Java'; my $grtitle = $ENV{graphtitle} || 'Sun Java';
my $grname = $ENV{graphtitle} || 'sun-jvm'; my $grname = $ENV{graphtitle} || 'sun-jvm';
my $statefile = "/var/lib/munin/plugin-state/plugin-java_sun_${grname}_minorgcs.state"; my $statefile = "$ENV{MUNIN_PLUGSTATE}/plugin-java_sun_${grname}_minorgcs.state";
my $pos = 0; my $pos = 0;
my $count = 0; my $count = 0;
my $seconds = 0; my $seconds = 0;

View file

@ -70,7 +70,7 @@ use Time::localtime;
my $address = $ENV{address} || "xen:///"; my $address = $ENV{address} || "xen:///";
my $username = $ENV{username} || ""; my $username = $ENV{username} || "";
my $password = $ENV{password} || ""; my $password = $ENV{password} || "";
my $tmpfile = $ENV{tmpfile} || "/var/lib/munin/plugin-state/libvirt"; my $tmpfile = $ENV{tmpfile} || "$ENV{MUNIN_PLUGSTATE}/libvirt";
my $decimals=5; my $decimals=5;
my %show=(); my %show=();

View file

@ -6,7 +6,7 @@ use YAML;
my (%conf, $state, $have_read, $totlines); my (%conf, $state, $have_read, $totlines);
%conf = (logfile => $ENV{LOGFILE} || '/home/user/.procmail/log', %conf = (logfile => $ENV{LOGFILE} || '/home/user/.procmail/log',
state => $ENV{STATEFILE} || '/var/lib/munin/plugin-state/munin-plugin-procmail.state'); state => $ENV{STATEFILE} || "$ENV{MUNIN_PLUGSTATE}/munin-plugin-procmail.state");
$state = YAML::LoadFile($conf{state}); $state = YAML::LoadFile($conf{state});
$have_read = 0; $have_read = 0;

View file

@ -88,7 +88,7 @@ init();
sub autoconf { sub autoconf {
$0 =~ /bandwidth_(.+)*$/; $0 =~ /bandwidth_(.+)*$/;
$interface = $1; $interface = $1;
$history = "/var/lib/munin/plugin-state/bandwidth_$interface.state"; $history = "$ENV{MUNIN_PLUGSTATE}/bandwidth_$interface.state";
} }
sub bit32or64 { sub bit32or64 {

View file

@ -17,7 +17,7 @@ use strict;
my $QUERYLOG = $ENV{logfile} || '/var/log/dansguardian/access.log'; my $QUERYLOG = $ENV{logfile} || '/var/log/dansguardian/access.log';
my $STATEFILE = $ENV{statefile} my $STATEFILE = $ENV{statefile}
|| '/var/lib/munin/plugin-state/dansguardian.state'; || "$ENV{MUNIN_PLUGSTATE}/dansguardian.state";
my %IN; my %IN;
sub get_state { sub get_state {

View file

@ -16,9 +16,8 @@ Counts the in/out bandwidth used by each projects/vhost. [Logtail] (https://www.
## Installation ## Installation
The setup is pretty straight forward. First you need to configure the plugin: The setup is pretty straight forward. First you need to configure the plugin:
Define the file which will be used by logtail to identify it's position in the log and the path to logtail: Define the path to logtail:
$statepath = '/usr/local/var/munin/plugin-state'; # directory where logtail will save the state
$logtail = '/usr/local/bin/logtail'; $logtail = '/usr/local/bin/logtail';
Multiple logs can be used for the same project/vhost and a regular expression (regex) can be used as a filter: Multiple logs can be used for the same project/vhost and a regular expression (regex) can be used as a filter:

View file

@ -26,7 +26,7 @@ use strict;
my $server = 'Nginx'; my $server = 'Nginx';
my $statepath = '/usr/local/var/munin/plugin-state'; my $statepath = $ENV{MUNIN_PLUGSTATE};
my $logtail = '/usr/local/bin/logtail'; my $logtail = '/usr/local/bin/logtail';
my %logs = ( my %logs = (

View file

@ -32,7 +32,7 @@ use strict;
my $server = 'Nginx'; my $server = 'Nginx';
my $statepath = '/usr/local/var/munin/plugin-state'; my $statepath = $ENV{MUNIN_PLUGSTATE};
my $logtail = '/usr/local/bin/logtail'; my $logtail = '/usr/local/bin/logtail';
my %logs = ( my %logs = (

View file

@ -32,7 +32,7 @@ use strict;
my $server = 'Nginx'; my $server = 'Nginx';
my $statepath = '/usr/local/var/munin/plugin-state'; my $statepath = $ENV{MUNIN_PLUGSTATE};
my $logtail = '/usr/local/bin/logtail'; my $logtail = '/usr/local/bin/logtail';
my %logs = ( my %logs = (

View file

@ -33,7 +33,7 @@
LOGDIR=${logdir:-/var/log/nginx} LOGDIR=${logdir:-/var/log/nginx}
ACCESS_LOG=$LOGDIR/${logfile:-access.log} ACCESS_LOG=$LOGDIR/${logfile:-access.log}
LOGTAIL=${logtail:-`which logtail`} LOGTAIL=${logtail:-`which logtail`}
STATEFILE=/var/lib/munin/plugin-state/nginx_vhost_traffic.state STATEFILE=$MUNIN_PLUGSTATE/nginx_vhost_traffic.state
VHOSTS=${vhosts:-`hostname`} VHOSTS=${vhosts:-`hostname`}
AGGREGATE=${aggregate:true} AGGREGATE=${aggregate:true}

View file

@ -60,7 +60,7 @@ use Socket;
my $NTPQ = $ENV{ntpq} || "ntpq"; my $NTPQ = $ENV{ntpq} || "ntpq";
my $COMMAND = "$NTPQ -np"; my $COMMAND = "$NTPQ -np";
my $statedir = $ENV{statedir} || '/var/lib/munin/plugin-state'; my $statedir = $ENV{statedir} || $ENV{MUNIN_PLUGSTATE};
my $statefile = "$statedir/ntp_peers.state"; my $statefile = "$statedir/ntp_peers.state";
# autoconf # autoconf

View file

@ -46,7 +46,7 @@ use strict;
my $NTPQ = $ENV{ntpq} || "ntpq"; my $NTPQ = $ENV{ntpq} || "ntpq";
my $COMMAND = "$NTPQ -nc associations"; my $COMMAND = "$NTPQ -nc associations";
my $statedir = $ENV{statedir} || '/usr/local/var/munin/plugin-state'; my $statedir = $ENV{statedir} || $ENV{MUNIN_PLUGSTATE};
my $statefile = "$statedir/ntp_peers.state"; my $statefile = "$statedir/ntp_peers.state";
# autoconf # autoconf

View file

@ -10,7 +10,7 @@
#%# capabilities=autoconf #%# capabilities=autoconf
command="/etc/init.d/pdns show" command="/etc/init.d/pdns show"
state_file=/var/lib/munin/plugin-state/pdns_rel.state state_file=$MUNIN_PLUGSTATE/pdns_rel.state
if [ "$1" = "autoconf" ]; then if [ "$1" = "autoconf" ]; then
echo yes echo yes

View file

@ -25,7 +25,7 @@
# Configuration # Configuration
# #
STAT_FILE=${STAT_FILE:-/var/lib/munin/plugin-state/plugin-plcyd-spf-python.state} STAT_FILE=${STAT_FILE:-$MUNIN_PLUGSTATE/plugin-plcyd-spf-python.state}
LOGFILE=${logfile:-/var/log/mail.log} LOGFILE=${logfile:-/var/log/mail.log}
if [ "$1" = "autoconf" ]; then if [ "$1" = "autoconf" ]; then

View file

@ -39,7 +39,7 @@ fi
LOGDIR=${logdir:-/var/log/mail} LOGDIR=${logdir:-/var/log/mail}
MAIL_LOG=$LOGDIR/${logfile:-info} MAIL_LOG=$LOGDIR/${logfile:-info}
LOGTAIL=${logtail:-`which logtail`} LOGTAIL=${logtail:-`which logtail`}
STATEFILE=/var/lib/munin/plugin-state/postfix_mailfiltered.offset STATEFILE=$MUNIN_PLUGSTATE/postfix_mailfiltered.offset
if [ "$1" = "autoconf" ]; then if [ "$1" = "autoconf" ]; then
if [ -f "${MAIL_LOG}" -a -n "${LOGTAIL}" -a -x "${LOGTAIL}" ] ; then if [ -f "${MAIL_LOG}" -a -n "${LOGTAIL}" -a -x "${LOGTAIL}" ] ; then

View file

@ -35,7 +35,7 @@ export POLICY
LOGDIR=${logdir:-/var/log/mail} LOGDIR=${logdir:-/var/log/mail}
MAIL_LOG=$LOGDIR/${logfile:-info} MAIL_LOG=$LOGDIR/${logfile:-info}
LOGTAIL=${logtail:-`which logtail`} LOGTAIL=${logtail:-`which logtail`}
STATEFILE=/var/lib/munin/plugin-state/postfix_mailfiltered_test.offset STATEFILE=$MUNIN_PLUGSTATE/postfix_mailfiltered_test.offset
if [ "$1" = "autoconf" ]; then if [ "$1" = "autoconf" ]; then
if [ -f "${MAIL_LOG}" -a -n "${LOGTAIL}" -a -x "${LOGTAIL}" ] ; then if [ -f "${MAIL_LOG}" -a -n "${LOGTAIL}" -a -x "${LOGTAIL}" ] ; then

View file

@ -15,7 +15,7 @@ mktemp -t
MAIL_LOG=${logfile:-/var/log/mail.log} MAIL_LOG=${logfile:-/var/log/mail.log}
LOGTAIL=${logtail:-`which logtail`} LOGTAIL=${logtail:-`which logtail`}
STATEFILE=/var/lib/munin/plugin-state/postfix_mailfiltered.offset STATEFILE=$MUNIN_PLUGSTATE/postfix_mailfiltered.offset
if [ "$1" = "autoconf" ]; then if [ "$1" = "autoconf" ]; then
if [ -f "${MAIL_LOG}" -a -n "${LOGTAIL}" -a -x "${LOGTAIL}" ] ; then if [ -f "${MAIL_LOG}" -a -n "${LOGTAIL}" -a -x "${LOGTAIL}" ] ; then

View file

@ -14,7 +14,7 @@ mktemp -t
} }
MAIL_LOG=${logfile:-/var/log/mail.log} MAIL_LOG=${logfile:-/var/log/mail.log}
STATEFILE=/var/lib/munin/plugin-state/postgrey.offset STATEFILE=$MUNIN_PLUGSTATE/postgrey.offset
LOGTAIL=${logtail:-`which logtail`} LOGTAIL=${logtail:-`which logtail`}
if [ "$1" = "autoconf" ]; then if [ "$1" = "autoconf" ]; then

View file

@ -29,7 +29,7 @@ use strict;
use warnings; use warnings;
my $maillog= $ENV{'logfile'} || "/var/log/mail.log"; my $maillog= $ENV{'logfile'} || "/var/log/mail.log";
my $statefile= $ENV{'statefile'} || "/var/lib/munin/plugin-state/postgrey-new.state"; my $statefile= $ENV{'statefile'} || "$ENV{MUNIN_PLUGSTATE}/postgrey-new.state";
my $greylisted=0; my $greylisted=0;
my $greylisted_old=0; my $greylisted_old=0;

View file

@ -29,8 +29,7 @@
LPARCFG=/proc/ppc64/lparcfg LPARCFG=/proc/ppc64/lparcfg
# STATEFILE=/var/lib/munin/plugin-state/power5-consumed_cpu_cycles.state STATEFILE=$MUNIN_PLUGSTATE/power5-consumed_cpu_cycles.state
STATEFILE=/tmp/power5-consumed_cpu_cycles.state
# check input parameters # check input parameters
if [ "$1" = "autoconf" ]; then if [ "$1" = "autoconf" ]; then
echo yes echo yes

View file

@ -29,7 +29,7 @@ mktemp -t
MAIL_LOG=${logfile:-/var/log/mail.info} MAIL_LOG=${logfile:-/var/log/mail.info}
LOGTAIL=${logtail:-`which logtail`} LOGTAIL=${logtail:-`which logtail`}
STATEFILE=/var/lib/munin/plugin-state/spamdyke.offset STATEFILE=$MUNIN_PLUGSTATE/spamdyke.offset
if [ "$1" = "autoconf" ]; then if [ "$1" = "autoconf" ]; then
if [ -f "${MAIL_LOG}" -a -n "${LOGTAIL}" -a -x "${LOGTAIL}" ] ; then if [ -f "${MAIL_LOG}" -a -n "${LOGTAIL}" -a -x "${LOGTAIL}" ] ; then

View file

@ -49,7 +49,7 @@
#%# family=manual #%# family=manual
#%# capabilities=autoconf #%# capabilities=autoconf
CACHE_FILE=/var/lib/munin/plugin-state/FreeboxUptime.cache CACHE_FILE=$MUNIN_PLUGSTATE/FreeboxUptime.cache
CACHE_HOURS=3 CACHE_HOURS=3
NMAP=$(which nmap) NMAP=$(which nmap)
TCP_PORT=9100 TCP_PORT=9100

View file

@ -16,7 +16,7 @@ mktemp -t $1
RSYNCD_LOG=${logfile:-/var/log/rsyncd.log} RSYNCD_LOG=${logfile:-/var/log/rsyncd.log}
LOGTAIL=${logtail:-`which logtail`} LOGTAIL=${logtail:-`which logtail`}
STATEFILE=/var/lib/munin/plugin-state/rsync-bytes.offset STATEFILE=$MUNIN_PLUGSTATE/rsync-bytes.offset
if [ "$1" = "autoconf" ]; then if [ "$1" = "autoconf" ]; then
if [ -f "${RSYNCD_LOG}" -a -n "${LOGTAIL}" -a -x "${LOGTAIL}" ] ; then if [ -f "${RSYNCD_LOG}" -a -n "${LOGTAIL}" -a -x "${LOGTAIL}" ] ; then

View file

@ -16,7 +16,7 @@ mktemp -t $1
RSYNCD_LOG=${logfile:-/var/log/rsyncd.log} RSYNCD_LOG=${logfile:-/var/log/rsyncd.log}
LOGTAIL=${logtail:-`which logtail`} LOGTAIL=${logtail:-`which logtail`}
STATEFILE=/var/lib/munin/plugin-state/rsync-count.offset STATEFILE=$MUNIN_PLUGSTATE/rsync-count.offset
if [ "$1" = "autoconf" ]; then if [ "$1" = "autoconf" ]; then
if [ -f "${RSYNCD_LOG}" -a -n "${LOGTAIL}" -a -x "${LOGTAIL}" ] ; then if [ -f "${RSYNCD_LOG}" -a -n "${LOGTAIL}" -a -x "${LOGTAIL}" ] ; then

View file

@ -44,9 +44,8 @@
# ------------------------------------------------------------------------------------------------------ # ------------------------------------------------------------------------------------------------------
DENY="/etc/hosts.deny" DENY="/etc/hosts.deny"
STATEDIR="/var/lib/munin/plugin-state" # directory where plugin can keep their working files
NAME="$(basename $0)" # component of naming temporary files NAME="$(basename $0)" # component of naming temporary files
STATEFILE="$STATEDIR/$NAME.state" STATEFILE="$MUNIN_PLUGSTATE/$NAME.state"
COLOUR=(FF0000 DA0024 B60048 91006D 6D0091 4800B6 2400DA 0000FF) # hot to cold colours COLOUR=(FF0000 DA0024 B60048 91006D 6D0091 4800B6 2400DA 0000FF) # hot to cold colours
# ------------------------------------------------------------------------------------------------------ # ------------------------------------------------------------------------------------------------------

View file

@ -15,7 +15,7 @@
#%# capabilities=autoconf #%# capabilities=autoconf
# statefile: name of seen xen domains # statefile: name of seen xen domains
statefile="/var/lib/munin/plugin-state/munin-plugin-xen.state" statefile="$MUNIN_PLUGSTATE/munin-plugin-xen.state"
if [ "$1" = "autoconf" ]; then if [ "$1" = "autoconf" ]; then
if which xm > /dev/null ; then if which xm > /dev/null ; then