increasing maxsleep further
This commit is contained in:
@@ -1,21 +1,14 @@
|
||||
#!/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)
|
||||
[[ -x ${GMETRIC} ]] || exit 0
|
||||
|
||||
FILE="/var/lib/puppet/state/state.yaml"
|
||||
FILE="/var/log/puppet/puppetd_run.log"
|
||||
[[ -r $FILE ]] || exit 0
|
||||
## BSD and Linux have different stat commands
|
||||
if [ $(uname -s) == "Linux" ]; then
|
||||
STIME=$(stat --format="%Y" ${FILE})
|
||||
else
|
||||
STIME=$(stat -f "%m" -t "%s" ${FILE})
|
||||
fi
|
||||
VALUE=$(grep "Finished catalog run" /var/log/puppet/puppetd_run.log |tail -1 |sed 's/.*in \(.*\) seconds/\1/')
|
||||
|
||||
NOW=$(date +"%s")
|
||||
GMETRIC="${GMETRIC} --dmax=30000 --tmax=350 --units=lastrun --type=int32"
|
||||
VALUE=$[ ( ${NOW} - ${STIME} ) / 60 ]
|
||||
$GMETRIC --value=${VALUE} --name="Minutes since last Puppet run"
|
||||
GMETRIC="${GMETRIC} --dmax=30000 --tmax=350 --units=Seconds --type=float"
|
||||
$GMETRIC --value=${VALUE} --name="Puppet runtime"
|
||||
|
||||
Reference in New Issue
Block a user