Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
#!/bin/bash
LOGHOST="collector.testbed.tier.internet2.edu"
LOGPORT="5001"
if [ -s /opt/tier/env.bash ]; then
. /opt/tier/env.bash
fi
#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
#send JSON
echo $LOGTEXT > msgjson.txt
curl -s -XPOST "${LOGHOST}:${LOGPORT}/" -H 'Content-Type: application/json' -T msgjson.txt 1>/dev/null
if [ $? -eq 0 ]; then
echo "tier_beacon;none;$ENV;$USERTOKEN;"`date`"; TIER beacon sent"
else
echo "tier_beacon;none;$ENV;$USERTOKEN;"`date`"; Failed to send TIER beacon"
fi
rm -f msgjson.txt
#below is for syslog, F-TICKS style
#`logger -n $LOGHOST -P $LOGPORT -t TIERBEACON $LOGTEXT`
fi