mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-23 02:44:41 +03:00
Allow to limit zed's syslog chattiness
Some usage patterns like send/recv of replication streams can produce a large number of events. In such a case, the current all-syslog.sh zedlet will hold up to its name, and flood the logs with mostly redundant information. Two mitigate this situation, this changeset introduces to new variables ZED_SYSLOG_SUBCLASS_INCLUDE and ZED_SYSLOG_SUBCLASS_EXCLUDE to zed.rc that give more control over which event classes end up in the syslog. Reviewed-by: loli10K <ezomori.nozomu@gmail.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov> Signed-off-by: Tony Hutter <hutter2@llnl.gov> Signed-off-by: Daniel Kobras <d.kobras@science-computing.de> Closes #6886 Closes #7260
This commit is contained in:
@@ -3398,6 +3398,21 @@ function wait_scrubbed
|
||||
return 1
|
||||
}
|
||||
|
||||
# Backup the zed.rc in our test directory so that we can edit it for our test.
|
||||
#
|
||||
# Returns: Backup file name. You will need to pass this to zed_rc_restore().
|
||||
function zed_rc_backup
|
||||
{
|
||||
zedrc_backup="$(mktemp)"
|
||||
cp $ZEDLET_DIR/zed.rc $zedrc_backup
|
||||
echo $zedrc_backup
|
||||
}
|
||||
|
||||
function zed_rc_restore
|
||||
{
|
||||
mv $1 $ZEDLET_DIR/zed.rc
|
||||
}
|
||||
|
||||
#
|
||||
# Setup custom environment for the ZED.
|
||||
#
|
||||
@@ -3536,6 +3551,23 @@ function zed_events_drain
|
||||
done
|
||||
}
|
||||
|
||||
# Set a variable in zed.rc to something, un-commenting it in the process.
|
||||
#
|
||||
# $1 variable
|
||||
# $2 value
|
||||
function zed_rc_set
|
||||
{
|
||||
var="$1"
|
||||
val="$2"
|
||||
# Remove the line
|
||||
cmd="'/$var/d'"
|
||||
eval sed -i $cmd $ZEDLET_DIR/zed.rc
|
||||
|
||||
# Add it at the end
|
||||
echo "$var=$val" >> $ZEDLET_DIR/zed.rc
|
||||
}
|
||||
|
||||
|
||||
#
|
||||
# Check is provided device is being active used as a swap device.
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user