mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-08-03 22:58:20 +00:00
move api check
This commit is contained in:
parent
35f8104175
commit
3426abebf2
2 changed files with 6 additions and 6 deletions
|
@ -63,9 +63,6 @@ export SLRM_DATA_REQUEST_BODY=$(jq --null-input --arg deviceSn "${SLRM_DEVICE_SN
|
|||
## get panel data
|
||||
export SLRM_DATA=$(curl --silent --request POST --url "https://api.solarmanpv.com/device/v1.0/currentData?appId=${SLRM_APPID}&language=en&=" --header "Authorization: bearer ${SLRM_BEARER_TOKEN}" --header 'Content-Type: application/json' --data "${SLRM_DATA_REQUEST_BODY}")
|
||||
|
||||
# sometimes the api can not find the requested device, exit here
|
||||
echo $SLRM_DATA | grep "device not found" && exit 1
|
||||
|
||||
# wenn parameter = ...
|
||||
if [ "$1" = "autoconf" ]; then
|
||||
echo yes
|
||||
|
@ -119,6 +116,9 @@ if [ "$1" = "config" ]; then
|
|||
exit 0
|
||||
fi
|
||||
|
||||
# sometimes the api can not find the requested device, exit here
|
||||
echo $SLRM_DATA | grep "device not found" && exit 1
|
||||
|
||||
echo "multigraph production_total"
|
||||
echo total_inverter.value "$(echo "$SLRM_DATA" | jq -r '.dataList[]|select(.key|IN("Et_ge0"))|.value')"
|
||||
echo total_panel1.value "$(echo "$SLRM_DATA" | jq -r '.dataList[]|select(.key|IN("Et_ge1"))|.value')"
|
||||
|
|
|
@ -63,9 +63,6 @@ export SLRM_DATA_REQUEST_BODY=$(jq --null-input --arg deviceSn "${SLRM_DEVICE_SN
|
|||
## get panel data
|
||||
export SLRM_DATA=$(curl --silent --request POST --url "https://api.solarmanpv.com/device/v1.0/currentData?appId=${SLRM_APPID}&language=en&=" --header "Authorization: bearer ${SLRM_BEARER_TOKEN}" --header 'Content-Type: application/json' --data "${SLRM_DATA_REQUEST_BODY}")
|
||||
|
||||
# sometimes the api can not find the requested device, exit here
|
||||
echo $SLRM_DATA | grep "device not found" && exit 1
|
||||
|
||||
# wenn parameter = ...
|
||||
if [ "$1" = "autoconf" ]; then
|
||||
echo yes
|
||||
|
@ -96,6 +93,9 @@ if [ "$1" = "config" ]; then
|
|||
exit 0
|
||||
fi
|
||||
|
||||
# sometimes the api can not find the requested device, exit here
|
||||
echo $SLRM_DATA | grep "device not found" && exit 1
|
||||
|
||||
echo multigraph voltage_current_input
|
||||
echo voltage.value "$(echo "$SLRM_DATA" | jq -r '.dataList[]|select(.key|IN("DV1"))|.value')"
|
||||
echo current.value "$(echo "$SLRM_DATA" | jq -r '.dataList[]|select(.key|IN("DC1"))|.value')"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue