From 2b13f1745127990cffceb504bc7d78fe5614ad4c Mon Sep 17 00:00:00 2001 From: retr0h Date: Wed, 13 Jul 2011 23:34:11 -0700 Subject: [PATCH] Add the ability to pass additional tags with `startstop'. It may be necessary to pass additional tags when running tcollector. In our case we are monitoring host level OpenStack systems, and want to roll up into availability zones and hypervisor type. ./startstop start -t az=paloalto0 hv=kvm Change-Id: Id48e4442dd984cd670d4677bbd5f393368501621 Signed-off-by: Benoit Sigoure --- startstop | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/startstop b/startstop index a04a59f8..7e52d8a2 100755 --- a/startstop +++ b/startstop @@ -13,7 +13,10 @@ HOSTNAME=$(hostname) PIDFILE=${PIDFILE-'/var/run/tcollector.pid'} PROG=$TCOLLECTOR_PATH/tcollector.py LOG=${LOG-'/var/log/tcollector.log'} +COMMAND=$1 +shift ARGS="-c $TCOLLECTOR_PATH/collectors -H $TSD_HOST -t host=$HOSTNAME -P $PIDFILE" +ARGS="$ARGS $@" # Sanity checks. test -d "$TCOLLECTOR_PATH" || { @@ -84,7 +87,7 @@ forcerestart () { start } -case $1 in +case $COMMAND in start) status || start ;; force-restart) @@ -113,7 +116,7 @@ case $1 in status) status exit $? ;; - *) echo >&2 "usage: $0 " + *) echo >&2 "usage: $0 " exit 1 ;; esac