mirror of
https://github.com/munin-monitoring/contrib.git
synced 2018-11-08 00:59:34 +01:00
Shellcheck
This commit is contained in:
parent
9c2aabf4d6
commit
210ebae0a0
@ -180,7 +180,7 @@ if [ "$1" = "config" ] ; then
|
||||
${LUN}_write.min 0
|
||||
${LUN}_write.draw STACK
|
||||
EOF
|
||||
done <<< $LUNLIST
|
||||
done <<< "$LUNLIST"
|
||||
|
||||
cat <<-EOF
|
||||
|
||||
@ -202,7 +202,7 @@ if [ "$1" = "config" ] ; then
|
||||
${LUN}_writereq.type COUNTER
|
||||
${LUN}_writereq.min 0
|
||||
EOF
|
||||
done <<< $LUNLIST
|
||||
done <<< "$LUNLIST"
|
||||
|
||||
cat <<-EOF
|
||||
|
||||
@ -215,7 +215,7 @@ if [ "$1" = "config" ] ; then
|
||||
echo -n "graph_order "
|
||||
while read -r LUN ; do
|
||||
echo -n "${LUN}_busyticks ${LUN}_idleticks ${LUN}_bta=${LUN}_busyticks_spa ${LUN}_idleticks_spa ${LUN}_btb=${LUN}_busyticks_spb ${LUN}_idleticks_spb "
|
||||
done <<< $LUNLIST
|
||||
done <<< "$LUNLIST"
|
||||
echo ""
|
||||
while read -r LUN ; do
|
||||
cat <<-EOF
|
||||
@ -242,7 +242,7 @@ if [ "$1" = "config" ] ; then
|
||||
${LUN}_load_spa.cdef 100,${LUN}_bta,${LUN}_busyticks_spa,${LUN}_idleticks_spa,+,/,*
|
||||
${LUN}_load_spb.cdef 100,${LUN}_btb,${LUN}_busyticks_spa,${LUN}_idleticks_spa,+,/,*
|
||||
EOF
|
||||
done <<< $LUNLIST
|
||||
done <<< "$LUNLIST"
|
||||
|
||||
cat <<-EOF
|
||||
|
||||
@ -257,7 +257,7 @@ if [ "$1" = "config" ] ; then
|
||||
${LUN}_outstandsum.label $LUN
|
||||
${LUN}_outstandsum.type COUNTER
|
||||
EOF
|
||||
done <<< $LUNLIST
|
||||
done <<< "$LUNLIST"
|
||||
|
||||
cat <<-EOF
|
||||
|
||||
@ -272,7 +272,7 @@ if [ "$1" = "config" ] ; then
|
||||
${LUN}_nonzeroreq.label $LUN
|
||||
${LUN}_nonzeroreq.type COUNTER
|
||||
EOF
|
||||
done <<< $LUNLIST
|
||||
done <<< "$LUNLIST"
|
||||
|
||||
cat <<-EOF
|
||||
|
||||
@ -286,7 +286,7 @@ if [ "$1" = "config" ] ; then
|
||||
${LUN}_implic_tr.label ${LUN} Implicit Trespasses
|
||||
${LUN}_explic_tr.label ${LUN} Explicit Trespasses
|
||||
EOF
|
||||
done <<< $LUNLIST
|
||||
done <<< "$LUNLIST"
|
||||
|
||||
cat <<-EOF
|
||||
|
||||
@ -331,7 +331,7 @@ if [ "$1" = "config" ] ; then
|
||||
${LUN}_ql_l_b.label ${LUN} Queue Length SPB
|
||||
${LUN}_ql_l_b.cdef ${LUN}_outstandsum,${LUN}_nonzeroreq,2,/,-,${LUN}_readreq,${LUN}_writereq,+,/,${LUN}_busyticks_spb,*,${LUN}_busyticks_spb,${LUN}_idleticks_spb,+,/
|
||||
EOF
|
||||
done <<< $LUNLIST
|
||||
done <<< "$LUNLIST"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
@ -352,7 +352,7 @@ while read -r LUN ; do
|
||||
s/Implicit Trespasses\:\ */${LUN}_implic_tr.value /p;
|
||||
s/Explicit Trespasses\:\ */${LUN}_explic_tr.value /p;
|
||||
' ;"
|
||||
done <<< $LUNLIST
|
||||
done <<< "$LUNLIST"
|
||||
ANSWER="$($BIGSSHCMD)"
|
||||
echo "multigraph emc_vnx_block_blocks"
|
||||
echo "$ANSWER" | grep "read\.\|write\."
|
||||
@ -363,7 +363,7 @@ echo -e "\nmultigraph emc_vnx_block_ticks"
|
||||
while read -r LUN ; do
|
||||
echo "${LUN}_load_spa.value 0"
|
||||
echo "${LUN}_load_spb.value 0"
|
||||
done <<< $LUNLIST
|
||||
done <<< "$LUNLIST"
|
||||
echo "$ANSWER" | grep "busyticks_spa\.\|idleticks_spa\."
|
||||
echo "$ANSWER" | grep "busyticks_spb\.\|idleticks_spb\."
|
||||
|
||||
@ -387,5 +387,5 @@ echo -e "\nmultigraph emc_vnx_block_queue"
|
||||
while read -r LUN ; do
|
||||
echo "${LUN}_ql_l_a.value 0 "
|
||||
echo "${LUN}_ql_l_b.value 0 "
|
||||
done <<< $LUNLIST
|
||||
done <<< "$LUNLIST"
|
||||
exit 0
|
||||
|
@ -129,8 +129,8 @@ if [ "$1" = "suggest" ]; then
|
||||
fi
|
||||
|
||||
STATSTYPE=$(echo "${0##*/}" | cut -d _ -f 1-5)
|
||||
if [ $STATSTYPE = "emc_vnx_file_nfs_stats" ]; then STATSTYPE=NFS;
|
||||
elif [ $STATSTYPE = "emc_vnx_file_basicdm_stats" ]; then STATSTYPE=BASICDM;
|
||||
if [ "$STATSTYPE" = "emc_vnx_file_nfs_stats" ]; then STATSTYPE=NFS;
|
||||
elif [ "$STATSTYPE" = "emc_vnx_file_basicdm_stats" ]; then STATSTYPE=BASICDM;
|
||||
else echo "Do not know what to do. Name the plugin as 'emc_vnx_file_nfs_stats_<HOSTNAME>' or 'emc_vnx_file_basicdm_stats_<HOSTNAME>'"; exit 1; fi
|
||||
# echo $STATSTYPE
|
||||
|
||||
@ -233,7 +233,7 @@ if [ "$1" = "config" ] ; then
|
||||
if [ $STATSTYPE = "NFS" ] ; then
|
||||
#nfs.v3.op data
|
||||
member_elements=$($SSH server_stats $server -info nfs.v3.op | grep member_elements | sed -ne 's/^.*= //p')
|
||||
IFS=',' read -ra graphs <<< $member_elements
|
||||
IFS=',' read -ra graphs <<< "$member_elements"
|
||||
cat <<-EOF
|
||||
multigraph vnx_emc_v3_calls_s
|
||||
graph_title EMC VNX 5300 NFSv3 Calls per second
|
||||
@ -274,7 +274,7 @@ if [ "$1" = "config" ] ; then
|
||||
graphs=()
|
||||
#nfs.v4.op data
|
||||
member_elements=$($SSH server_stats $server -info nfs.v4.op | grep member_elements | sed -ne 's/^.*= //p')
|
||||
IFS=',' read -ra graphs <<< $member_elements
|
||||
IFS=',' read -ra graphs <<< "$member_elements"
|
||||
cat <<-EOF
|
||||
multigraph vnx_emc_v4_calls_s
|
||||
graph_title EMC VNX 5300 NFSv4 Calls per second
|
||||
@ -317,7 +317,7 @@ if [ "$1" = "config" ] ; then
|
||||
# Total Read Write Suspicious Total Read Write Avg
|
||||
# Ops/s Ops/s Ops/s Ops diff KiB/s KiB/s KiB/s uSec/call
|
||||
member_elements=$($SSH server_stats server_2 -monitor nfs.client -count 1 -terminationsummary no -titles never | sed -ne 's/^.*id=//p' | cut -d' ' -f1)
|
||||
readarray graphs2 <<< $member_elements
|
||||
readarray graphs2 <<< "$member_elements"
|
||||
cat <<-EOF
|
||||
|
||||
multigraph vnx_emc_nfs_client_ops_s
|
||||
@ -391,7 +391,7 @@ for server in $nas_servers; do
|
||||
if [ $STATSTYPE = "BASICDM" ] ; then
|
||||
member_elements=$($SSH server_stats $server -count 1 -terminationsummary no -titles never | grep '^[^[:space:]]')
|
||||
# NUMCOL=5
|
||||
IFS=$' ' read -ra graphs <<< $member_elements
|
||||
IFS=$' ' read -ra graphs <<< "$member_elements"
|
||||
|
||||
echo "multigraph emc_vnx_cpu_percent"
|
||||
echo "${server}_cpuutil.value ${graphs[1]}"
|
||||
@ -405,7 +405,7 @@ member_elements=$($SSH server_stats $server -count 1 -terminationsummary no -tit
|
||||
echo "${server}_stor_write.value ${graphs[5]}"
|
||||
|
||||
member_elements=$($SSH server_stats $server -monitor kernel.memory -count 1 -terminationsummary no -titles never | grep '^[^[:space:]]')
|
||||
IFS=$' ' read -ra graphs <<< $member_elements
|
||||
IFS=$' ' read -ra graphs <<< "$member_elements"
|
||||
|
||||
echo -e "\nmultigraph emc_vnx_memory"
|
||||
echo "${server}_total.value ${graphs[14]}"
|
||||
@ -432,10 +432,10 @@ member_elements=$($SSH server_stats $server -count 1 -terminationsummary no -tit
|
||||
#nfs.v3.op data
|
||||
member_elements=$($SSH server_stats $server -monitor nfs.v3.op -count 1 -terminationsummary no -titles never | sed -ne 's/^.*v3/v3/p')
|
||||
NUMCOL=5
|
||||
LINES=$(wc -l <<< $member_elements)
|
||||
LINES=$(wc -l <<< "$member_elements")
|
||||
while IFS=$'\n' read -ra graphs ; do
|
||||
element+=( $graphs )
|
||||
done <<< $member_elements
|
||||
done <<< "$member_elements"
|
||||
|
||||
echo "multigraph vnx_emc_v3_calls_s"
|
||||
for ((i=0; i<$((LINES)); i++ )); do
|
||||
@ -457,10 +457,10 @@ member_elements=$($SSH server_stats $server -count 1 -terminationsummary no -tit
|
||||
#nfs.v4.op data
|
||||
member_elements=$($SSH server_stats $server -monitor nfs.v4.op -count 1 -terminationsummary no -titles never | sed -ne 's/^.*v4/v4/p')
|
||||
NUMCOL=5
|
||||
LINES=$(wc -l <<< $member_elements)
|
||||
LINES=$(wc -l <<< "$member_elements")
|
||||
while IFS=$'\n' read -ra graphs ; do
|
||||
element+=( $graphs )
|
||||
done <<< $member_elements
|
||||
done <<< "$member_elements"
|
||||
|
||||
echo -e "\nmultigraph vnx_emc_v4_calls_s"
|
||||
for ((i=0; i<$((LINES)); i++ )); do
|
||||
@ -483,10 +483,10 @@ member_elements=$($SSH server_stats $server -count 1 -terminationsummary no -tit
|
||||
echo -e "\nmultigraph vnx_emc_nfs_client_ops_s"
|
||||
member_elements=$($SSH server_stats server_2 -monitor nfs.client -count 1 -terminationsummary no -titles never | sed -ne 's/^.*id=//p')
|
||||
NUMCOL=9
|
||||
LINES=$(wc -l <<< $member_elements)
|
||||
LINES=$(wc -l <<< "$member_elements")
|
||||
while IFS=$'\n' read -ra graphs; do
|
||||
element+=($graphs)
|
||||
done <<< $member_elements
|
||||
done <<< "$member_elements"
|
||||
for (( i=0; i<$((LINES)); i++ )); do
|
||||
client=$( echo ${element[i*$NUMCOL]} | sed -ne 's/\./_/pg')
|
||||
echo "${server}_${client}_r".value "${element[$i*$NUMCOL+2]}"
|
||||
|
Loading…
Reference in New Issue
Block a user