From 5d5651ca0940af39fcd422e502db915f5e4567ac Mon Sep 17 00:00:00 2001 From: Pierre-Alain TORET Date: Sat, 24 Mar 2018 18:43:32 +0100 Subject: [PATCH] Change variables names to more readable ones in syncthing_ Signed-off-by: Pierre-Alain TORET --- plugins/syncthing/syncthing_ | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/plugins/syncthing/syncthing_ b/plugins/syncthing/syncthing_ index 8b41cad1..b71bb48b 100755 --- a/plugins/syncthing/syncthing_ +++ b/plugins/syncthing/syncthing_ @@ -22,10 +22,10 @@ To make the plugin connect to the Syncthing server one has to use this type of configuration [syncthing_*] -env.ST_APIKEY myapikey0123456789 -env.ST_HOST 127.0.0.1 -env.ST_PORT 8384 -env.ST_PROTO http +env.syncthing_apikey myapikey0123456789 +env.syncthing_host 127.0.0.1 +env.syncthing_port 8384 +env.syncthing_proto http =head1 AUTHOR Pierre-Alain TORET @@ -47,7 +47,7 @@ EOM exit 0;; *) printf "syncthing_cpu.value " - $CURL -s -X GET -H "X-API-Key: $ST_APIKEY" $ST_PROTO://$ST_HOST:$ST_PORT/rest/system/status | $JQ '.cpuPercent' + $CURL -s -X GET -H "X-API-Key: $syncthing_apikey" $syncthing_proto://$syncthing_host:$syncthing_port/rest/system/status | $JQ '.cpuPercent' esac } @@ -67,8 +67,8 @@ syncthing_mem_sys.cdef syncthing_mem_sys,8,* EOM exit 0;; *) - ALL=$($CURL -s -X GET -H "X-API-Key: $ST_APIKEY" $ST_PROTO://$ST_HOST:$ST_PORT/rest/system/status | $JQ '.alloc') - SYS=$($CURL -s -X GET -H "X-API-Key: $ST_APIKEY" $ST_PROTO://$ST_HOST:$ST_PORT/rest/system/status | $JQ '.sys') + ALL=$($CURL -s -X GET -H "X-API-Key: $syncthing_apikey" $syncthing_proto://$syncthing_host:$syncthing_port/rest/system/status | $JQ '.alloc') + SYS=$($CURL -s -X GET -H "X-API-Key: $syncthing_apikey" $syncthing_proto://$syncthing_host:$syncthing_port/rest/system/status | $JQ '.sys') printf "syncthing_mem_all.value $ALL\nsyncthing_mem_sys.value $SYS\n" esac } @@ -85,7 +85,7 @@ EOM exit 0;; *) printf "syncthing_uptime.value " - $CURL -s -X GET -H "X-API-Key: $ST_APIKEY" $ST_PROTO://$ST_HOST:$ST_PORT/rest/system/status | $JQ '.uptime' + $CURL -s -X GET -H "X-API-Key: $syncthing_apikey" $syncthing_proto://$syncthing_host:$syncthing_port/rest/system/status | $JQ '.uptime' esac } @@ -101,7 +101,7 @@ EOM exit 0;; *) printf "syncthing_goroutine.value " - $CURL -s -X GET -H "X-API-Key: $ST_APIKEY" $ST_PROTO://$ST_HOST:$ST_PORT/rest/system/status | $JQ '.goroutines' + $CURL -s -X GET -H "X-API-Key: $syncthing_apikey" $syncthing_proto://$syncthing_host:$syncthing_port/rest/system/status | $JQ '.goroutines' esac } @@ -125,8 +125,8 @@ syncthing_transfer_up.cdef syncthing_transfer_up,8,* EOM exit 0;; *) - IBT=$($CURL -s -X GET -H "X-API-Key: $ST_APIKEY" $ST_PROTO://$ST_HOST:$ST_PORT/rest/system/connections | $JQ '.total | .inBytesTotal') - OBT=$($CURL -s -X GET -H "X-API-Key: $ST_APIKEY" $ST_PROTO://$ST_HOST:$ST_PORT/rest/system/connections | $JQ '.total | .outBytesTotal') + IBT=$($CURL -s -X GET -H "X-API-Key: $syncthing_apikey" $syncthing_proto://$syncthing_host:$syncthing_port/rest/system/connections | $JQ '.total | .inBytesTotal') + OBT=$($CURL -s -X GET -H "X-API-Key: $syncthing_apikey" $syncthing_proto://$syncthing_host:$syncthing_port/rest/system/connections | $JQ '.total | .outBytesTotal') printf "syncthing_transfer_up.value $IBT\nsyncthing_transfer_down.value $OBT\n" esac }