Révision cdb9a445
Plugin xfs_frag: fix shellcheck issues
| plugins/disk/xfs_frag | ||
|---|---|---|
| 32 | 32 |
|
| 33 | 33 |
=cut |
| 34 | 34 |
|
| 35 |
declare -a ARRY
|
|
| 35 |
declare -a TOKENS
|
|
| 36 | 36 |
shopt -s nocasematch |
| 37 | 37 |
|
| 38 | 38 |
case $1 in |
| ... | ... | |
| 42 | 42 |
graph_vlabel Percent |
| 43 | 43 |
graph_category disk |
| 44 | 44 |
EOF |
| 45 |
cat /etc/mtab | awk '{print $2 " " $3}' | while read LINE
|
|
| 46 |
do
|
|
| 47 |
ARRY=($LINE)
|
|
| 48 |
if [[ ${ARRY[1]} =~ xfs ]]; then
|
|
| 49 |
FIELDNAME=$(echo ${ARRY[0]} | sed 's/^[^A-Za-z_]/_/; s/[^A-Za-z0-9_]/_/g')
|
|
| 50 |
echo "$FIELDNAME.label ${ARRY[0]}"
|
|
| 45 |
awk '{print $2 " " $3}' </etc/mtab | while read -r LINE; do
|
|
| 46 |
# shellcheck disable=SC2206
|
|
| 47 |
TOKENS=($LINE)
|
|
| 48 |
if [[ ${TOKENS[1]} =~ xfs ]]; then
|
|
| 49 |
FIELDNAME=$(echo "${TOKENS[0]}" | sed 's/^[^A-Za-z_]/_/; s/[^A-Za-z0-9_]/_/g')
|
|
| 50 |
echo "$FIELDNAME.label ${TOKENS[0]}"
|
|
| 51 | 51 |
echo "$FIELDNAME.type GAUGE" |
| 52 | 52 |
fi |
| 53 | 53 |
done |
| ... | ... | |
| 55 | 55 |
;; |
| 56 | 56 |
esac |
| 57 | 57 |
|
| 58 |
cat /etc/mtab | awk '{print $2 " " $3 " " $1}' | while read LINE
|
|
| 59 |
do
|
|
| 60 |
ARRY=($LINE)
|
|
| 61 |
if [[ ${ARRY[1]} =~ xfs ]]; then
|
|
| 62 |
FIELDNAME=$(echo ${ARRY[0]} | sed 's/^[^A-Za-z_]/_/; s/[^A-Za-z0-9_]/_/g')
|
|
| 63 |
FRAG=$(xfs_db -c frag -r ${ARRY[2]} | sed 's/.*fragmentation factor \(.*\)%.*/\1/')
|
|
| 64 |
echo $FIELDNAME.value $FRAG
|
|
| 58 |
awk '{print $2 " " $3 " " $1}' </etc/mtab | while read -r LINE; do
|
|
| 59 |
# shellcheck disable=SC2206
|
|
| 60 |
TOKENS=($LINE)
|
|
| 61 |
if [[ ${TOKENS[1]} =~ xfs ]]; then
|
|
| 62 |
FIELDNAME=$(echo "${TOKENS[0]}" | sed 's/^[^A-Za-z_]/_/; s/[^A-Za-z0-9_]/_/g')
|
|
| 63 |
FRAG=$(xfs_db -c frag -r "${TOKENS[2]}" | sed 's/.*fragmentation factor \(.*\)%.*/\1/')
|
|
| 64 |
echo "$FIELDNAME.value $FRAG"
|
|
| 65 | 65 |
fi |
| 66 | 66 |
done |
| 67 |
|
|
| t/test-exception-wrapper.expected-failures | ||
|---|---|---|
| 85 | 85 |
plugins/disk/scsi_queue |
| 86 | 86 |
plugins/disk/snmp__areca_ |
| 87 | 87 |
plugins/disk/useddisk |
| 88 |
plugins/disk/xfs_frag |
|
| 89 | 88 |
plugins/dkim/dkimproxy_mails |
| 90 | 89 |
plugins/dovecot/dovecot |
| 91 | 90 |
plugins/dovecot/dovecot_stats_ |
Formats disponibles : Unified diff