Permalink
Browse files

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 <tsunanet@gmail.com>
  • Loading branch information...
1 parent 8501fc6 commit 2b13f1745127990cffceb504bc7d78fe5614ad4c @retr0h retr0h committed with tsuna Jul 14, 2011
Showing with 5 additions and 2 deletions.
  1. +5 −2 startstop
View
@@ -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 <start|stop|restart|status|force-restart>"
+ *) echo >&2 "usage: $0 <start [args]|stop|restart|status|force-restart>"
exit 1
;;
esac

0 comments on commit 2b13f17

Please sign in to comment.