2
0
mirror of https://github.com/munin-monitoring/contrib.git synced 2018-11-08 00:59:34 +01:00

Change variables names to more readable ones in syncthing_

Signed-off-by: Pierre-Alain TORET <pierre-alain.toret@protonmail.com>
This commit is contained in:
Pierre-Alain TORET 2018-03-24 18:43:32 +01:00
parent 99123efbb8
commit 5d5651ca09

View File

@ -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 <pierre-alain.toret@protonmail.com>
@ -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
}