This repository has been archived on 2025-03-16. You can view files and clone it, but cannot push or open issues or pull requests.
Files
puppet/files/ganglia/puppetd_runtime.sh
Udo Waechter 3856774c9f rounding down
2013-06-05 16:07:57 +02:00

16 lines
492 B
Bash

#!/usr/bin/env bash
# plot puppetd last runtime
GMETRIC=$(which gmetric)
[[ -x ${GMETRIC} ]] || exit 0
FILE="/var/log/puppet/puppetd_run.log"
[[ -r $FILE ]] || exit 0
## BSD and Linux have different stat commands
VALUE=$(grep "Finished catalog run" /var/log/puppet/puppetd_run.log |tail -1 |sed 's/.*in \(.*\) seconds/\1/')
VALUE=$(awk "BEGIN{print int($VALUE)}")
GMETRIC="${GMETRIC} --dmax=30000 --tmax=350 --units=Seconds --type=float"
$GMETRIC --value=${VALUE} --name="Puppet runtime"