Add two plugins to monitor stats on Chelsio NICs
This commit is contained in:
parent
52bf78868b
commit
f6262327d6
101
chelsio_framesize_
Executable file
101
chelsio_framesize_
Executable file
@ -0,0 +1,101 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright 2018, Babak Farrokhi. All rights reserved
|
||||
#
|
||||
# vim: sta:et:sw=4:ts=4:sts=4
|
||||
# -*- coding: utf-8 -*-
|
||||
#
|
||||
# Wildcard-plugin to monitor inbound and outbound distribution of frames by size range on Chelsio cxl NICs.
|
||||
#
|
||||
# ln -s /usr/share/munin/node/plugins-auto/chelsio_framesize_ /etc/munin/node.d/chelsio_framesize_cxl0
|
||||
#
|
||||
# ...will monitor cxl0.
|
||||
#
|
||||
# Magic markers (optional - used by munin-config and some installation
|
||||
# scripts):
|
||||
#
|
||||
#%# family=auto
|
||||
#%# capabilities=autoconf suggest
|
||||
|
||||
INTERFACE=${0##*chelsio_framesize_}
|
||||
|
||||
init_vars()
|
||||
{
|
||||
if [ -z ${INTERFACE} ]; then
|
||||
echo "Please use symlinked script (e.g. chelsio_framesize_cxl0)"
|
||||
exit 1
|
||||
fi
|
||||
IFINDEX=`echo ${INTERFACE} | egrep -o '[0-9]+'`
|
||||
SIZE_LIST="64 65_127 128_255 256_511 512_1023 1024_1518 1519_max"
|
||||
}
|
||||
|
||||
|
||||
case $1 in
|
||||
autoconf)
|
||||
if [ -x /sbin/sysctl ]; then ## FIXME: check if any cxl interface exist
|
||||
echo yes
|
||||
exit 0
|
||||
else
|
||||
echo "no (no cxl interface is present)"
|
||||
exit 0
|
||||
fi
|
||||
;;
|
||||
|
||||
suggest)
|
||||
if [ -x /sbin/ifconfig ]; then
|
||||
ifconfig -l | xargs -n 1 echo | grep ^cxl
|
||||
exit 0
|
||||
else
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
|
||||
config)
|
||||
init_vars
|
||||
echo "graph_title Interface ${INTERFACE} TX and RX Frame Size Distribution"
|
||||
echo "graph_args --base 1000"
|
||||
echo "graph_vlabel Frames by size"
|
||||
echo "graph_category network"
|
||||
echo "graph_info This graph shows the number of frams transmitted or received on ${INTERFACE} interface separated by size"
|
||||
for dir in tx rx; do
|
||||
for size in ${SIZE_LIST}; do
|
||||
echo "${dir}_${size}.label ${size} bytes frames ${dir}ed on ${INTERFACE}"
|
||||
echo "${dir}_${size}.type DERIVE"
|
||||
echo "${dir}_${size}.min 0"
|
||||
done
|
||||
done
|
||||
exit 0
|
||||
;;
|
||||
|
||||
*)
|
||||
init_vars
|
||||
|
||||
v_names=`mktemp`
|
||||
v_values=`mktemp`
|
||||
|
||||
## TX and RX Frame Size Information
|
||||
TUNABLE=""
|
||||
for dir in tx rx; do
|
||||
for size in ${SIZE_LIST}; do
|
||||
TUNABLE="${TUNABLE} dev.cxl.${IFINDEX}.stats.${dir}_frames_${size}"
|
||||
done
|
||||
done
|
||||
|
||||
# build left side of output
|
||||
for dir in tx rx; do
|
||||
for size in ${SIZE_LIST}; do
|
||||
echo "${dir}_${size}.value" >> ${v_names}
|
||||
done
|
||||
done
|
||||
|
||||
# build right side of output
|
||||
VALUES=`/sbin/sysctl -n ${TUNABLE}`
|
||||
echo $VALUES | xargs -n1 echo > ${v_values}
|
||||
|
||||
# merge left and right
|
||||
paste -d" " ${v_names} ${v_values}
|
||||
|
||||
rm ${v_names} ${v_values}
|
||||
;;
|
||||
esac
|
||||
|
107
chelsio_queues_
Executable file
107
chelsio_queues_
Executable file
@ -0,0 +1,107 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright 2018, Babak Farrokhi. All rights reserved
|
||||
#
|
||||
# vim: sta:et:sw=4:ts=4:sts=4
|
||||
# -*- coding: utf-8 -*-
|
||||
#
|
||||
# Wildcard-plugin to monitor queue usage on Chelsio (cxl) NICs
|
||||
#
|
||||
# ln -s /usr/share/munin/node/plugins-auto/chelsio_queues_ /etc/munin/node.d/chelsio_queues_cxl0
|
||||
#
|
||||
# ...will monitor queues on cxl0.
|
||||
#
|
||||
# Magic markers (optional - used by munin-config and some installation
|
||||
# scripts):
|
||||
#
|
||||
#%# family=auto
|
||||
#%# capabilities=autoconf suggest
|
||||
|
||||
INTERFACE=${0##*chelsio_queues_}
|
||||
|
||||
init_vars()
|
||||
{
|
||||
if [ -z ${INTERFACE} ]; then
|
||||
echo "Please use symlinked script (e.g. chelsio_queues_cxl0)"
|
||||
exit 1
|
||||
fi
|
||||
IFINDEX=`echo ${INTERFACE} | egrep -o '[0-9]+'`
|
||||
TXQ=`/sbin/sysctl -n dev.cxl.${IFINDEX}.ntxq`
|
||||
RXQ=`/sbin/sysctl -n dev.cxl.${IFINDEX}.nrxq`
|
||||
LAST_TXQ=`expr ${TXQ} - 1`
|
||||
LAST_RXQ=`expr ${RXQ} - 1`
|
||||
}
|
||||
|
||||
|
||||
case $1 in
|
||||
autoconf)
|
||||
if [ -x /sbin/sysctl ]; then ## FIXME: check if any cxl interface exist
|
||||
echo yes
|
||||
exit 0
|
||||
else
|
||||
echo "no (no cxl interface is present)"
|
||||
exit 0
|
||||
fi
|
||||
;;
|
||||
|
||||
suggest)
|
||||
if [ -x /sbin/ifconfig ]; then
|
||||
ifconfig -l | xargs -n 1 echo | grep ^cxl
|
||||
exit 0
|
||||
else
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
|
||||
config)
|
||||
init_vars
|
||||
echo "graph_title Interface ${INTERFACE} TX and RX Frames per Queue"
|
||||
echo "graph_args --base 1000"
|
||||
echo "graph_vlabel Frames"
|
||||
echo "graph_category network"
|
||||
echo "graph_info This graph shows the number of frames transmitted or received on ${INTERFACE} interface"
|
||||
for i in `seq 0 ${LAST_TXQ}`; do
|
||||
echo "tx_${i}.label TX Frames on Queue ${i}"
|
||||
echo "tx_${i}.type DERIVE"
|
||||
echo "tx_${i}.min 0"
|
||||
done
|
||||
for i in `seq 0 ${LAST_RXQ}`; do
|
||||
echo "rx_${i}.label RX Frames on Queue ${i}"
|
||||
echo "rx_${i}.type DERIVE"
|
||||
echo "rx_${i}.min 0"
|
||||
done
|
||||
exit 0
|
||||
;;
|
||||
|
||||
*)
|
||||
init_vars
|
||||
|
||||
## TX Queues Information
|
||||
TUNABLE=""
|
||||
for i in `seq 0 ${LAST_TXQ}`; do
|
||||
TUNABLE="${TUNABLE} dev.cxl.${IFINDEX}.txq.${i}.r_enqueues"
|
||||
done
|
||||
|
||||
VALUES=`/sbin/sysctl -n ${TUNABLE}`
|
||||
CNT=0
|
||||
for v in ${VALUES}; do
|
||||
echo "tx_${CNT}.value ${v}"
|
||||
CNT=$(($CNT+1))
|
||||
done
|
||||
|
||||
## RX Queues Information
|
||||
TUNABLE=""
|
||||
for i in `seq 0 ${LAST_RXQ}`; do
|
||||
TUNABLE="${TUNABLE} dev.cxl.${IFINDEX}.rxq.${i}.rxcsum"
|
||||
done
|
||||
|
||||
VALUES=`/sbin/sysctl -n ${TUNABLE}`
|
||||
CNT=0
|
||||
for v in ${VALUES}; do
|
||||
echo "rx_${CNT}.value ${v}"
|
||||
CNT=$(($CNT+1))
|
||||
done
|
||||
|
||||
;;
|
||||
esac
|
||||
|
Loading…
x
Reference in New Issue
Block a user