From f50d910912b2fd79cee262807fc9711aa7261961 Mon Sep 17 00:00:00 2001 From: Udo Waechter Date: Wed, 5 Jun 2013 16:25:25 +0200 Subject: [PATCH] rounding down --- files/ganglia/puppetd_runtime.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/files/ganglia/puppetd_runtime.sh b/files/ganglia/puppetd_runtime.sh index f0c716f..b935304 100644 --- a/files/ganglia/puppetd_runtime.sh +++ b/files/ganglia/puppetd_runtime.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/usr/bin/env ruby # plot puppetd last runtime @@ -8,8 +8,7 @@ GMETRIC=$(which gmetric) 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)}") +VALUE=$(grep "Finished catalog run" ${FILE} |tail -1 |sed 's/.*in \(.*\) seconds/\1/'|awk '{print int($1)') -GMETRIC="${GMETRIC} --dmax=30000 --tmax=350 --units=Seconds --type=float" +GMETRIC="${GMETRIC} --dmax=30000 --tmax=350 --units=Seconds --type=int32" $GMETRIC --value=${VALUE} --name="Puppet runtime"