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

clean_fieldname

This commit is contained in:
Diver 2017-01-19 02:07:21 +03:00
parent b0123994ea
commit 6e8b2b3fea

View file

@ -82,6 +82,8 @@
export LANG=C export LANG=C
. "$MUNIN_LIBDIR/plugins/plugin.sh"
ssh_check() { ssh_check() {
ssh -q $username@$1 "/nasmcd/sbin/getreason | grep -w slot_\`/nasmcd/sbin/t2slot\` | cut -d- -f1" ssh -q $username@$1 "/nasmcd/sbin/getreason | grep -w slot_\`/nasmcd/sbin/t2slot\` | cut -d- -f1"
} }
@ -323,12 +325,12 @@ if [ "$1" = "config" ] ; then
EOF EOF
echo -n "graph_order " echo -n "graph_order "
for graph in "${graphs_array[@]}"; do for graph in "${graphs_array[@]}"; do
field=$(echo "$graph" | sed -ne 's/\./_/pg' ) field="$(clean_fieldname "$graph")"
echo -n "${server}_${field}_r ${server}_${field}_w ${server}_${field}_t ${server}_${field}_s " echo -n "${server}_${field}_r ${server}_${field}_w ${server}_${field}_t ${server}_${field}_s "
done done
echo " " echo " "
for graph in "${graphs_array[@]}"; do for graph in "${graphs_array[@]}"; do
field=$(echo "$graph" | sed -ne 's/\./_/pg' ) field="$(clean_fieldname "$graph")"
echo "${server}_${field}_r.label $server $field Read Ops/s" echo "${server}_${field}_r.label $server $field Read Ops/s"
echo "${server}_${field}_w.label $server $field Write Ops/s" echo "${server}_${field}_w.label $server $field Write Ops/s"
echo "${server}_${field}_w.draw STACK" echo "${server}_${field}_w.draw STACK"
@ -345,12 +347,12 @@ if [ "$1" = "config" ] ; then
EOF EOF
echo -n "graph_order " echo -n "graph_order "
for graph in "${graphs_array[@]}"; do for graph in "${graphs_array[@]}"; do
field=$(echo "$graph" | sed -ne 's/\./_/pg' ) field="$(clean_fieldname "$graph")"
echo -n "${server}_${field}_r ${server}_${field}_w ${server}_${field}_t " echo -n "${server}_${field}_r ${server}_${field}_w ${server}_${field}_t "
done done
echo " " echo " "
for graph in "${graphs_array[@]}"; do for graph in "${graphs_array[@]}"; do
field=$(echo "$graph" | sed -ne 's/\./_/pg' ) field="$(clean_fieldname "$graph")"
echo "${server}_${field}_r.label $server $field Read B/s" echo "${server}_${field}_r.label $server $field Read B/s"
echo "${server}_${field}_r.cdef ${server}_${field}_r,1024,*" echo "${server}_${field}_r.cdef ${server}_${field}_r,1024,*"
echo "${server}_${field}_w.label $server $field Write B/s" echo "${server}_${field}_w.label $server $field Write B/s"
@ -368,7 +370,7 @@ if [ "$1" = "config" ] ; then
graph_category nfs graph_category nfs
EOF EOF
for graph in "${graphs_array[@]}"; do for graph in "${graphs_array[@]}"; do
field=$(echo "$graph" | sed -ne 's/\./_/pg' ) field="$(clean_fieldname "$graph")"
echo "${server}_${field}.label $server $field Avg uSec/call" echo "${server}_${field}.label $server $field Avg uSec/call"
done done
fi fi
@ -484,22 +486,22 @@ member_elements=$(run_remote server_stats "$server" -count 1 -terminationsummary
element+=($graphs) element+=($graphs)
done <<< "$member_elements" done <<< "$member_elements"
for (( i=0; i<$((LINES)); i++ )); do for (( i=0; i<$((LINES)); i++ )); do
client=$( echo ${element[i*$NUMCOL]} | sed -ne 's/\./_/pg') client="$(clean_fieldname "${element[i*$NUMCOL]}")"
echo "${server}_${client}_r".value "${element[$i*$NUMCOL+2]}" echo "${server}_${client}_r".value "${element[$i*$NUMCOL+2]}"
echo "${server}_${client}_w".value "${element[$i*$NUMCOL+3]}" echo "${server}_${client}_w".value "${element[$i*$NUMCOL+3]}"
echo "${server}_${client}_t".value "${element[$i*$NUMCOL+1]}" echo "${server}_${client}_t".value "${element[$i*$NUMCOL+1]}"
echo "${server}_${client}_s".value "${element[$i*$NUMCOL+4]}" echo "${server}_${client}_s".value "${element[$i*$NUMCOL+4]}"
done done
echo -e "\nmultigraph vnx_emc_nfs_client_kib_s" echo -e "\nmultigraph vnx_emc_nfs_client_kib_s"
for (( i=0; i<$((LINES)); i++ )); do for (( i=0; i<$((LINES)); i++ )); do
client=$( echo ${element[i*$NUMCOL]} | sed -ne 's/\./_/pg') client="$(clean_fieldname "${element[i*$NUMCOL]}")"
echo "${server}_${client}_r".value "${element[$i*$NUMCOL+6]}" echo "${server}_${client}_r".value "${element[$i*$NUMCOL+6]}"
echo "${server}_${client}_w".value "${element[$i*$NUMCOL+7]}" echo "${server}_${client}_w".value "${element[$i*$NUMCOL+7]}"
echo "${server}_${client}_t".value "${element[$i*$NUMCOL+5]}" echo "${server}_${client}_t".value "${element[$i*$NUMCOL+5]}"
done done
echo -e "\nmultigraph vnx_emc_nfs_client_avg_usec" echo -e "\nmultigraph vnx_emc_nfs_client_avg_usec"
for (( i=0; i<$((LINES)); i++ )); do for (( i=0; i<$((LINES)); i++ )); do
client=$( echo ${element[i*$NUMCOL]} | sed -ne 's/\./_/pg') client="$(clean_fieldname "${element[i*$NUMCOL]}")"
echo "${server}_${client}".value "${element[$i*$NUMCOL+8]}" echo "${server}_${client}".value "${element[$i*$NUMCOL+8]}"
done done
fi fi