Skip to content

Commit

Permalink
change TIER beacon to JSON/REST
Browse files Browse the repository at this point in the history
  • Loading branch information
pcaskey committed Feb 24, 2017
1 parent cdcb16a commit 3ef6b6b
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions files/bin/sendtierbeacon.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,25 @@
#!/bin/bash
LOGHOST="collector.testbed.tier.internet2.edu"
LOGPORT="5000"
LOGPORT="5001"
if [ -s /opt/tier/env.bash ]; then
. /opt/tier/env.bash
fi
LOGTEXT="TIERBEACON/TIER/1.0#IM=$IMAGENAME#PV=$VERSION#TR=$TIERVERSION#MT=$MAINTAINER#"

#below for syslog, F-TICKS style
#LOGTEXT="TIERBEACON/TIER/1.0#IM=$IMAGENAME#PV=$VERSION#TR=$TIERVERSION#MT=$MAINTAINER#"

#below for JSON/REST style
LOGTEXT="{ \"msgType\" : \"TIERBEACON\", \"msgName\" : \"TIER\", \"msgVersion\" : \"1.0\", \"tbProduct\" : \"$IMAGENAME\", \"tbProductVersion\" : \"$VERSION\", \"tbTIERRelease\" : \"$TIERVERSION\", \"tbMaintainer\" : \"$MAINTAINER\" }"


if [ -z "$TIER_BEACON_OPT_OUT" ]; then
`logger -n $LOGHOST -P $LOGPORT -t TIERBEACON $LOGTEXT`
#send JSON
echo $LOGTEXT > msgjson.txt
curl -s -XPOST "${LOGHOST}:${LOGPORT}/" -H 'Content-Type: application/json' -T msgjson.txt 1>/dev/null
rm -f msgjson.txt

#below is for syslog, F-TICKS style
#`logger -n $LOGHOST -P $LOGPORT -t TIERBEACON $LOGTEXT`

echo `date`"; TIER beacon sent."
fi

0 comments on commit 3ef6b6b

Please sign in to comment.