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

get_answer_field

This commit is contained in:
Diver 2017-01-19 03:32:27 +03:00
parent 2e02ddc6c7
commit cc66cae131

View File

@ -359,9 +359,9 @@ if [ "$1" = "config" ] ; then
${LUN}_writereq.graph no ${LUN}_writereq.graph no
${LUN}_writereq.type COUNTER ${LUN}_writereq.type COUNTER
EOF EOF
# Queue Length SPA = ((Sum of Outstanding Requests SPA - NonZero Request Count Arrivals SPA / 2)/(Host Read Requests SPA + Host Write Requests SPA))* # Queue Length SPA = ((Sum of Outstanding Requests SPA - NonZero Request Count Arrivals SPA / 2)/(Host Read Requests SPA + Host Write Requests SPA))*
# (Busy Ticks SPA/(Busy Ticks SPA + Idle Ticks SPA) # (Busy Ticks SPA/(Busy Ticks SPA + Idle Ticks SPA)
# We count together SPA and SPB, although it is not fully corrext # We count together SPA and SPB, although it is not fully corrext
cat <<-EOF cat <<-EOF
${LUN}_ql_l_a.label ${LUN} Queue Length SPA ${LUN}_ql_l_a.label ${LUN} Queue Length SPA
${LUN}_ql_l_a.cdef ${LUN}_outstandsum,${LUN}_nonzeroreq,2,/,-,${LUN}_readreq,${LUN}_writereq,+,/,${LUN}_busyticks_spa,*,${LUN}_busyticks_spa,${LUN}_idleticks_spa,+,/ ${LUN}_ql_l_a.cdef ${LUN}_outstandsum,${LUN}_nonzeroreq,2,/,-,${LUN}_readreq,${LUN}_writereq,+,/,${LUN}_busyticks_spa,*,${LUN}_busyticks_spa,${LUN}_idleticks_spa,+,/
@ -369,7 +369,7 @@ if [ "$1" = "config" ] ; then
${LUN}_ql_l_b.cdef ${LUN}_outstandsum,${LUN}_nonzeroreq,2,/,-,${LUN}_readreq,${LUN}_writereq,+,/,${LUN}_busyticks_spb,*,${LUN}_busyticks_spb,${LUN}_idleticks_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 EOF
done <<< "$LUNLIST" done <<< "$LUNLIST"
exit 0 exit 0
fi fi
#Preparing big complex command to SP's to have most work done remotely. #Preparing big complex command to SP's to have most work done remotely.
@ -391,11 +391,18 @@ while read -r LUN ; do
s/Explicit Trespasses\:\ */${FILTERLUN}_explic_tr.value /p; s/Explicit Trespasses\:\ */${FILTERLUN}_explic_tr.value /p;
' ;") ' ;")
done <<< "$LUNLIST" done <<< "$LUNLIST"
get_answer_field() {
echo "$ANSWER" | grep -F "_${1}."
}
ANSWER="$($BIGSSHCMD)" ANSWER="$($BIGSSHCMD)"
echo "multigraph emc_vnx_block_blocks" echo "multigraph emc_vnx_block_blocks"
echo "$ANSWER" | grep "read\.\|write\." get_answer_field "read"
get_answer_field "write"
echo -e "\nmultigraph emc_vnx_block_req" echo -e "\nmultigraph emc_vnx_block_req"
echo "$ANSWER" | grep "readreq\.\|writereq\." get_answer_field "readreq"
get_answer_field "writereq"
echo -e "\nmultigraph emc_vnx_block_ticks" echo -e "\nmultigraph emc_vnx_block_ticks"
while read -r LUN ; do while read -r LUN ; do
@ -403,26 +410,29 @@ while read -r LUN ; do
echo "${LUN}_load_spa.value 0" echo "${LUN}_load_spa.value 0"
echo "${LUN}_load_spb.value 0" echo "${LUN}_load_spb.value 0"
done <<< "$LUNLIST" done <<< "$LUNLIST"
echo "$ANSWER" | grep "busyticks_spa\.\|idleticks_spa\." get_answer_field "busyticks_spa"
echo "$ANSWER" | grep "busyticks_spb\.\|idleticks_spb\." get_answer_field "idleticks_spa"
get_answer_field "busyticks_spb"
get_answer_field "idleticks_spb"
echo -e "\nmultigraph emc_vnx_block_outstanding" echo -e "\nmultigraph emc_vnx_block_outstanding"
echo "$ANSWER" | grep "outstandsum\." get_answer_field "outstandsum"
echo -e "\nmultigraph emc_vnx_block_nonzeroreq" echo -e "\nmultigraph emc_vnx_block_nonzeroreq"
echo "$ANSWER" | grep "nonzeroreq\." get_answer_field "nonzeroreq"
echo -e "\nmultigraph emc_vnx_block_trespasses" echo -e "\nmultigraph emc_vnx_block_trespasses"
echo "$ANSWER" | grep "implic_tr\.\|explic_tr\." get_answer_field "implic_tr"
get_answer_field "explic_tr"
echo -e "\nmultigraph emc_vnx_block_queue" echo -e "\nmultigraph emc_vnx_block_queue"
# Queue Length # Queue Length
echo "$ANSWER" | grep "busyticks" get_answer_field "busyticks"
echo "$ANSWER" | grep "idleticks." get_answer_field "idleticks"
echo "$ANSWER" | grep "outstandsum\." get_answer_field "outstandsum"
echo "$ANSWER" | grep "nonzeroreq\." get_answer_field "nonzeroreq"
echo "$ANSWER" | grep "readreq\." get_answer_field "readreq"
echo "$ANSWER" | grep "writereq\." get_answer_field "writereq"
while read -r LUN ; do while read -r LUN ; do
LUN="$(clean_fieldname "$LUN")" LUN="$(clean_fieldname "$LUN")"
echo "${LUN}_ql_l_a.value 0 " echo "${LUN}_ql_l_a.value 0 "