Subject: iostat warnings in security report
To: None <current-users@netbsd.org>
From: Alex Plotnick <shrike@netaxs.com>
List: current-users
Date: 09/08/2005 13:28:35
After upgrading to a recent -CURRENT, I noticed that my usually suppressed
security reports contained a spurious warning:
iostat: No tape drives attached.
This is not tremendously useful information, and hardly seems worthy of
daily report. This change in behaviour seems to have been introduced by
the recent changes to iostat(8) and vmstat(1) to report tape drive
statistics. I therefore suggest modifying /etc/security to suppress
errors from iostat (patch follows).
Thanks,
-- Alex Plotnick
--- etc/security.orig 2005-09-08 13:14:19.000000000 -0400
+++ etc/security 2005-09-08 13:14:25.000000000 -0400
@@ -808,14 +808,16 @@
xargs rm < $LABELS
# generate disklabels of all disks excluding: cd fd md
- disks=`iostat -x | awk 'NR > 1 && $1 !~ /^[cfm]d/ { print $1; }'`
+ disks=`iostat -x 2>/dev/null \
+ | awk 'NR > 1 && $1 !~ /^[cfm]d/ { print $1; }'`
for i in $disks; do
disklabel $i > "$work_dir/disklabel.$i" 2>/dev/null
done
# if fdisk is available, generate fdisks for: ed ld sd wd
if [ -x /sbin/fdisk ]; then
- disks=`iostat -x| awk 'NR > 1 && $1 ~ /^[elsw]d/ { print $1; }'`
+ disks=`iostat -x 2>/dev/null \
+ | awk 'NR > 1 && $1 ~ /^[elsw]d/ { print $1; }'`
for i in $disks; do
/sbin/fdisk $i > "$work_dir/fdisk.$i" 2>/dev/null
done