mirror of
https://github.com/pstadler/metrics.sh.git
synced 2025-02-28 05:49:12 -05:00
Logentries.com reporter
This commit is contained in:
parent
5c0962e12b
commit
215e50ecea
19
reporters/logentries.com.sh
Normal file
19
reporters/logentries.com.sh
Normal file
@ -0,0 +1,19 @@
|
||||
#!/bin/sh
|
||||
|
||||
start () {
|
||||
if [ -z $LOGENTRIES_TOKEN ]; then
|
||||
echo "Error: logentries.com requires \$LOGENTRIES_TOKEN to be specified"
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
report () {
|
||||
local metric=$1 # the name of the metric, e.g. "cpu", "cpu_alias", "cpu.foo"
|
||||
local value=$2 # int or float
|
||||
echo "$LOGENTRIES_TOKEN $metric=$value" | nc data.logentries.com 10000
|
||||
}
|
||||
|
||||
docs () {
|
||||
echo "Send data to Logentries.com using token TCP (https://docs.logentries.com/docs/input-token)"
|
||||
echo "LOGENTRIES_TOKEN=$LOGENTRIES_TOKEN"
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user