mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-21 18:41:03 +00:00
Fix multiple shellcheck issues
This commit is contained in:
parent
5b1099fb83
commit
7fed3b9765
18 changed files with 59 additions and 50 deletions
|
@ -57,10 +57,10 @@ EOM
|
|||
NC=$(echo "$STATUS" | $JQ '.numConnections ')
|
||||
NK=$(echo "$STATUS" | $JQ '.numPendingSessionKeys ')
|
||||
NP=$(echo "$STATUS" | $JQ '.numProxies ')
|
||||
printf "strelaysrv_num_sessions.value %s\n" "$NS"
|
||||
printf "strelaysrv_num_connections.value %s\n" "$NC"
|
||||
printf "strelaysrv_num_pending.value %s\n" "$NK"
|
||||
printf "strelaysrv_num_proxies.value %s\n" "$NP"
|
||||
printf 'strelaysrv_num_sessions.value %s\n' "$NS"
|
||||
printf 'strelaysrv_num_connections.value %s\n' "$NC"
|
||||
printf 'strelaysrv_num_pending.value %s\n' "$NK"
|
||||
printf 'strelaysrv_num_proxies.value %s\n' "$NP"
|
||||
esac
|
||||
}
|
||||
|
||||
|
@ -77,7 +77,7 @@ EOM
|
|||
*)
|
||||
STATUS=$(getstatus)
|
||||
UPTIME=$(echo "$STATUS" | "$JQ" '.uptimeSeconds')
|
||||
printf "strelaysrv_uptime.value %s\n" "$UPTIME"
|
||||
printf 'strelaysrv_uptime.value %s\n' "$UPTIME"
|
||||
esac
|
||||
}
|
||||
|
||||
|
@ -94,7 +94,7 @@ EOM
|
|||
*)
|
||||
STATUS=$(getstatus)
|
||||
GOROUTINE=$(echo "$STATUS" | "$JQ" '.goNumRoutine')
|
||||
printf "strelaysrv_goroutine.value %s\n" "$GOROUTINE"
|
||||
printf 'strelaysrv_goroutine.value %s\n' "$GOROUTINE"
|
||||
esac
|
||||
}
|
||||
|
||||
|
@ -113,7 +113,7 @@ EOM
|
|||
*)
|
||||
STATUS=$(getstatus)
|
||||
BP=$(echo "$STATUS" | "$JQ" '.bytesProxied ')
|
||||
printf "strelaysrv_proxied.value %s\n" "$BP"
|
||||
printf 'strelaysrv_proxied.value %s\n' "$BP"
|
||||
esac
|
||||
}
|
||||
|
||||
|
@ -132,7 +132,7 @@ EOM
|
|||
*)
|
||||
STATUS=$(getstatus)
|
||||
TRANSFER=$(echo "$STATUS" | "$JQ" '.kbps10s1m5m15m30m60m[2] ')
|
||||
printf "strelaysrv_transfer.value %s\n" "$TRANSFER"
|
||||
printf 'strelaysrv_transfer.value %s\n' "$TRANSFER"
|
||||
esac
|
||||
}
|
||||
|
||||
|
|
|
@ -57,7 +57,7 @@ EOM
|
|||
*)
|
||||
STATUS=$(getstatus)
|
||||
CPU=$(echo "$STATUS" | "$JQ" '.cpuPercent')
|
||||
printf "syncthing_cpu.value %s\n" "$CPU"
|
||||
printf 'syncthing_cpu.value %s\n' "$CPU"
|
||||
esac
|
||||
}
|
||||
|
||||
|
@ -80,8 +80,8 @@ EOM
|
|||
STATUS=$(getstatus)
|
||||
ALL=$(echo "$STATUS" | "$JQ" '.alloc')
|
||||
SYS=$(echo "$STATUS" | "$JQ" '.sys')
|
||||
printf "syncthing_mem_all.value %s\n" "$ALL"
|
||||
printf "syncthing_mem_sys.value %s\n" "$SYS"
|
||||
printf 'syncthing_mem_all.value %s\n' "$ALL"
|
||||
printf 'syncthing_mem_sys.value %s\n' "$SYS"
|
||||
esac
|
||||
}
|
||||
|
||||
|
@ -98,7 +98,7 @@ EOM
|
|||
*)
|
||||
STATUS=$(getstatus)
|
||||
UPTIME=$(echo "$STATUS" | "$JQ" '.uptime')
|
||||
printf "syncthing_uptime.value %s\n" "$UPTIME"
|
||||
printf 'syncthing_uptime.value %s\n' "$UPTIME"
|
||||
esac
|
||||
}
|
||||
|
||||
|
@ -115,7 +115,7 @@ EOM
|
|||
*)
|
||||
STATUS=$(getstatus)
|
||||
GOROUTINES=$(echo "$STATUS" | "$JQ" '.goroutines')
|
||||
printf "syncthing_goroutine.value %s\n" "$GOROUTINES"
|
||||
printf 'syncthing_goroutine.value %s\n' "$GOROUTINES"
|
||||
esac
|
||||
}
|
||||
|
||||
|
@ -142,8 +142,8 @@ EOM
|
|||
CONNECTIONS=$("$CURL" -s -X GET -H "X-API-Key: $syncthing_apikey" "$syncthing_proto://$syncthing_host:$syncthing_port/rest/system/connections")
|
||||
IBT=$(echo "$CONNECTIONS" | "$JQ" '.total | .inBytesTotal')
|
||||
OBT=$(echo "$CONNECTIONS" | "$JQ" '.total | .outBytesTotal')
|
||||
printf "syncthing_transfer_up.value %s\n" "$IBT"
|
||||
printf "syncthing_transfer_down.value %s\n" "$OBT"
|
||||
printf 'syncthing_transfer_up.value %s\n' "$IBT"
|
||||
printf 'syncthing_transfer_down.value %s\n' "$OBT"
|
||||
esac
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue