increasing maxsleep further

This commit is contained in:
Udo Waechter
2013-06-05 15:52:09 +02:00
parent b33d9437a2
commit 44c8ba91bc
2 changed files with 12 additions and 20 deletions

View File

@@ -1,21 +1,14 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# $Id: puppetd_lastrun.sh 2810 2009-09-02 08:37:05Z uwaechte $
# plot puppetd last run # plot puppetd last runtime
GMETRIC=$(which gmetric) GMETRIC=$(which gmetric)
[[ -x ${GMETRIC} ]] || exit 0 [[ -x ${GMETRIC} ]] || exit 0
FILE="/var/lib/puppet/state/state.yaml" FILE="/var/log/puppet/puppetd_run.log"
[[ -r $FILE ]] || exit 0 [[ -r $FILE ]] || exit 0
## BSD and Linux have different stat commands ## BSD and Linux have different stat commands
if [ $(uname -s) == "Linux" ]; then VALUE=$(grep "Finished catalog run" /var/log/puppet/puppetd_run.log |tail -1 |sed 's/.*in \(.*\) seconds/\1/')
STIME=$(stat --format="%Y" ${FILE})
else
STIME=$(stat -f "%m" -t "%s" ${FILE})
fi
NOW=$(date +"%s") GMETRIC="${GMETRIC} --dmax=30000 --tmax=350 --units=Seconds --type=float"
GMETRIC="${GMETRIC} --dmax=30000 --tmax=350 --units=lastrun --type=int32" $GMETRIC --value=${VALUE} --name="Puppet runtime"
VALUE=$[ ( ${NOW} - ${STIME} ) / 60 ]
$GMETRIC --value=${VALUE} --name="Minutes since last Puppet run"

View File

@@ -7,7 +7,7 @@ class puppet (
$run_hour = '*/1', $run_hour = '*/1',
$run_minute = '10', $run_minute = '10',
$run_if_ipmatch = '', $run_if_ipmatch = '',
$maxsleep = '640' $maxsleep = '3200'
) { ) {
$puppet_service = $::kernel ? { $puppet_service = $::kernel ? {
'Darwin' => 'org.macports.puppet', 'Darwin' => 'org.macports.puppet',
@@ -115,8 +115,7 @@ class puppet (
ensure => $ensure, ensure => $ensure,
} }
ganglia::gmetric::cron { 'puppetd_lastrun.sh': runwhen => '5', } ganglia::gmetric::cron { 'puppetd_lastrun.sh': runwhen => '5'; 'puppetd_runtime.sh': runwhen => '15'; }
ganglia::gmetric::cron { 'puppetd_runtime.sh': runwhen => '15', }
} }
} }