init
This commit is contained in:
26
generate_metrics
Executable file
26
generate_metrics
Executable file
@@ -0,0 +1,26 @@
|
||||
#!/bin/bash
|
||||
|
||||
|
||||
if [ -t 0 ]; then
|
||||
echo You need to send your metadata to stdin
|
||||
echo It should be in the syntax of {name}=\"{value}\"
|
||||
exit
|
||||
fi
|
||||
META=$(cat)
|
||||
|
||||
if [ -z "$1" ]; then
|
||||
echo Argument 1 should be name
|
||||
exit
|
||||
fi
|
||||
if [ -z "$2" ]; then
|
||||
echo Argument 2 should be value
|
||||
exit
|
||||
fi
|
||||
|
||||
NAME=$1
|
||||
VALUE=$2
|
||||
|
||||
echo "# TYPE ${NAME} guage"
|
||||
echo "${NAME}{$META} ${VALUE}"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user