xref: /freebsd/sys/contrib/openzfs/cmd/zed/zed.d/zed.rc (revision aca928a50a42f00f344df934005b09dbcb4e2f77)
1eda14cbcSMatt Macy##
2716fd348SMartin Matuska# zed.rc – ZEDLET configuration.
3eda14cbcSMatt Macy##
4e92ffd9bSMartin Matuska# shellcheck disable=SC2034
5eda14cbcSMatt Macy
6eda14cbcSMatt Macy##
7eda14cbcSMatt Macy# Absolute path to the debug output file.
8eda14cbcSMatt Macy#
9eda14cbcSMatt Macy#ZED_DEBUG_LOG="/tmp/zed.debug.log"
10eda14cbcSMatt Macy
11eda14cbcSMatt Macy##
12eda14cbcSMatt Macy# Email address of the zpool administrator for receipt of notifications;
13eda14cbcSMatt Macy#   multiple addresses can be specified if they are delimited by whitespace.
14eda14cbcSMatt Macy# Email will only be sent if ZED_EMAIL_ADDR is defined.
15e92ffd9bSMartin Matuska# Enabled by default; comment to disable.
16eda14cbcSMatt Macy#
17e92ffd9bSMartin MatuskaZED_EMAIL_ADDR="root"
18eda14cbcSMatt Macy
19eda14cbcSMatt Macy##
20eda14cbcSMatt Macy# Name or path of executable responsible for sending notifications via email;
21eda14cbcSMatt Macy#   the mail program must be capable of reading a message body from stdin.
22eda14cbcSMatt Macy# Email will only be sent if ZED_EMAIL_ADDR is defined.
23eda14cbcSMatt Macy#
24eda14cbcSMatt Macy#ZED_EMAIL_PROG="mail"
25eda14cbcSMatt Macy
26eda14cbcSMatt Macy##
27eda14cbcSMatt Macy# Command-line options for ZED_EMAIL_PROG.
28eda14cbcSMatt Macy# The string @ADDRESS@ will be replaced with the recipient email address(es).
29eda14cbcSMatt Macy# The string @SUBJECT@ will be replaced with the notification subject;
30eda14cbcSMatt Macy#   this should be protected with quotes to prevent word-splitting.
31eda14cbcSMatt Macy# Email will only be sent if ZED_EMAIL_ADDR is defined.
32e3aa18adSMartin Matuska# If @SUBJECT@ was omited here, a "Subject: ..." header will be added to notification
33eda14cbcSMatt Macy#
34eda14cbcSMatt Macy#ZED_EMAIL_OPTS="-s '@SUBJECT@' @ADDRESS@"
35eda14cbcSMatt Macy
36eda14cbcSMatt Macy##
37eda14cbcSMatt Macy# Default directory for zed lock files.
38eda14cbcSMatt Macy#
39eda14cbcSMatt Macy#ZED_LOCKDIR="/var/lock"
40eda14cbcSMatt Macy
41eda14cbcSMatt Macy##
42eda14cbcSMatt Macy# Minimum number of seconds between notifications for a similar event.
43eda14cbcSMatt Macy#
44eda14cbcSMatt Macy#ZED_NOTIFY_INTERVAL_SECS=3600
45eda14cbcSMatt Macy
46eda14cbcSMatt Macy##
47eda14cbcSMatt Macy# Notification verbosity.
48eda14cbcSMatt Macy#   If set to 0, suppress notification if the pool is healthy.
49eda14cbcSMatt Macy#   If set to 1, send notification regardless of pool health.
50eda14cbcSMatt Macy#
51eda14cbcSMatt Macy#ZED_NOTIFY_VERBOSE=0
52eda14cbcSMatt Macy
53eda14cbcSMatt Macy##
54eda14cbcSMatt Macy# Send notifications for 'ereport.fs.zfs.data' events.
55eda14cbcSMatt Macy# Disabled by default, any non-empty value will enable the feature.
56eda14cbcSMatt Macy#
57eda14cbcSMatt Macy#ZED_NOTIFY_DATA=
58eda14cbcSMatt Macy
59eda14cbcSMatt Macy##
60eda14cbcSMatt Macy# Pushbullet access token.
61eda14cbcSMatt Macy# This grants full access to your account -- protect it accordingly!
62eda14cbcSMatt Macy#   <https://www.pushbullet.com/get-started>
63eda14cbcSMatt Macy#   <https://www.pushbullet.com/account>
64eda14cbcSMatt Macy# Disabled by default; uncomment to enable.
65eda14cbcSMatt Macy#
66eda14cbcSMatt Macy#ZED_PUSHBULLET_ACCESS_TOKEN=""
67eda14cbcSMatt Macy
68eda14cbcSMatt Macy##
69eda14cbcSMatt Macy# Pushbullet channel tag for push notification feeds that can be subscribed to.
70eda14cbcSMatt Macy#   <https://www.pushbullet.com/my-channel>
71eda14cbcSMatt Macy# If not defined, push notifications will instead be sent to all devices
72eda14cbcSMatt Macy#   associated with the account specified by the access token.
73eda14cbcSMatt Macy# Disabled by default; uncomment to enable.
74eda14cbcSMatt Macy#
75eda14cbcSMatt Macy#ZED_PUSHBULLET_CHANNEL_TAG=""
76eda14cbcSMatt Macy
77eda14cbcSMatt Macy##
78eda14cbcSMatt Macy# Slack Webhook URL.
79eda14cbcSMatt Macy# This allows posting to the given channel and includes an access token.
80eda14cbcSMatt Macy#   <https://api.slack.com/incoming-webhooks>
81eda14cbcSMatt Macy# Disabled by default; uncomment to enable.
82eda14cbcSMatt Macy#
83eda14cbcSMatt Macy#ZED_SLACK_WEBHOOK_URL=""
84eda14cbcSMatt Macy
85eda14cbcSMatt Macy##
8616038816SMartin Matuska# Pushover token.
8716038816SMartin Matuska# This defines the application from which the notification will be sent.
8816038816SMartin Matuska#   <https://pushover.net/api#registration>
8916038816SMartin Matuska# Disabled by default; uncomment to enable.
9016038816SMartin Matuska# ZED_PUSHOVER_USER, below, must also be configured.
9116038816SMartin Matuska#
9216038816SMartin Matuska#ZED_PUSHOVER_TOKEN=""
9316038816SMartin Matuska
9416038816SMartin Matuska##
9516038816SMartin Matuska# Pushover user key.
9616038816SMartin Matuska# This defines which user or group will receive Pushover notifications.
9716038816SMartin Matuska#  <https://pushover.net/api#identifiers>
9816038816SMartin Matuska# Disabled by default; uncomment to enable.
9916038816SMartin Matuska# ZED_PUSHOVER_TOKEN, above, must also be configured.
10016038816SMartin Matuska#ZED_PUSHOVER_USER=""
10116038816SMartin Matuska
10216038816SMartin Matuska##
103eda14cbcSMatt Macy# Default directory for zed state files.
104eda14cbcSMatt Macy#
105eda14cbcSMatt Macy#ZED_RUNDIR="/var/run"
106eda14cbcSMatt Macy
107eda14cbcSMatt Macy##
108eda14cbcSMatt Macy# Turn on/off enclosure LEDs when drives get DEGRADED/FAULTED.  This works for
10981b22a98SMartin Matuska# device mapper and multipath devices as well.  This works with JBOD enclosures
11081b22a98SMartin Matuska# and NVMe PCI drives (assuming they're supported by Linux in sysfs).
111eda14cbcSMatt Macy#
112eda14cbcSMatt MacyZED_USE_ENCLOSURE_LEDS=1
113eda14cbcSMatt Macy
114eda14cbcSMatt Macy##
115eda14cbcSMatt Macy# Run a scrub after every resilver
116eda14cbcSMatt Macy# Disabled by default, 1 to enable and 0 to disable.
117eda14cbcSMatt Macy#ZED_SCRUB_AFTER_RESILVER=0
118eda14cbcSMatt Macy
119eda14cbcSMatt Macy##
120eda14cbcSMatt Macy# The syslog priority (e.g., specified as a "facility.level" pair).
121eda14cbcSMatt Macy#
122eda14cbcSMatt Macy#ZED_SYSLOG_PRIORITY="daemon.notice"
123eda14cbcSMatt Macy
124eda14cbcSMatt Macy##
125eda14cbcSMatt Macy# The syslog tag for marking zed events.
126eda14cbcSMatt Macy#
127eda14cbcSMatt Macy#ZED_SYSLOG_TAG="zed"
128eda14cbcSMatt Macy
129eda14cbcSMatt Macy##
130eda14cbcSMatt Macy# Which set of event subclasses to log
131eda14cbcSMatt Macy# By default, events from all subclasses are logged.
132eda14cbcSMatt Macy# If ZED_SYSLOG_SUBCLASS_INCLUDE is set, only subclasses
133eda14cbcSMatt Macy# matching the pattern are logged. Use the pipe symbol (|)
134eda14cbcSMatt Macy# or shell wildcards (*, ?) to match multiple subclasses.
135eda14cbcSMatt Macy# Otherwise, if ZED_SYSLOG_SUBCLASS_EXCLUDE is set, the
136eda14cbcSMatt Macy# matching subclasses are excluded from logging.
137eda14cbcSMatt Macy#ZED_SYSLOG_SUBCLASS_INCLUDE="checksum|scrub_*|vdev.*"
1387877fdebSMatt MacyZED_SYSLOG_SUBCLASS_EXCLUDE="history_event"
1397877fdebSMatt Macy
1407877fdebSMatt Macy##
1417877fdebSMatt Macy# Use GUIDs instead of names when logging pool and vdevs
1427877fdebSMatt Macy# Disabled by default, 1 to enable and 0 to disable.
1437877fdebSMatt Macy#ZED_SYSLOG_DISPLAY_GUIDS=1
144eda14cbcSMatt Macy
145315ee00fSMartin Matuska##
146315ee00fSMartin Matuska# Power off the drive's slot in the enclosure if it becomes FAULTED.  This can
147315ee00fSMartin Matuska# help silence misbehaving drives.  This assumes your drive enclosure fully
148315ee00fSMartin Matuska# supports slot power control via sysfs.
1495fb307d2SMartin Matuska#ZED_POWER_OFF_ENCLOSURE_SLOT_ON_FAULT=1
1503494f7c0SMartin Matuska
1513494f7c0SMartin Matuska##
152*aca928a5SMartin Matuska# Power off the drive's slot in the enclosure if there is a hung I/O which
153*aca928a5SMartin Matuska# exceeds the deadman timeout.  This can help prevent a single misbehaving
154*aca928a5SMartin Matuska# drive from rendering a redundant pool unavailable.  This assumes your drive
155*aca928a5SMartin Matuska# enclosure fully supports slot power control via sysfs.
156*aca928a5SMartin Matuska#ZED_POWER_OFF_ENCLOSURE_SLOT_ON_DEADMAN=1
157*aca928a5SMartin Matuska
158*aca928a5SMartin Matuska##
1593494f7c0SMartin Matuska# Ntfy topic
1603494f7c0SMartin Matuska# This defines which topic will receive the ntfy notification.
1613494f7c0SMartin Matuska#  <https://docs.ntfy.sh/publish/>
1623494f7c0SMartin Matuska# Disabled by default; uncomment to enable.
1633494f7c0SMartin Matuska#ZED_NTFY_TOPIC=""
1643494f7c0SMartin Matuska
1653494f7c0SMartin Matuska##
1663494f7c0SMartin Matuska# Ntfy access token (optional for public topics)
1673494f7c0SMartin Matuska# This defines an access token which can be used
1683494f7c0SMartin Matuska# to allow you to authenticate when sending to topics
1693494f7c0SMartin Matuska# <https://docs.ntfy.sh/publish/#access-tokens>
1703494f7c0SMartin Matuska# Disabled by default; uncomment to enable.
1713494f7c0SMartin Matuska#ZED_NTFY_ACCESS_TOKEN=""
1723494f7c0SMartin Matuska
1733494f7c0SMartin Matuska##
1743494f7c0SMartin Matuska# Ntfy Service URL
1753494f7c0SMartin Matuska# This defines which service the ntfy call will be directed toward
1763494f7c0SMartin Matuska#  <https://docs.ntfy.sh/install/>
1773494f7c0SMartin Matuska# https://ntfy.sh by default; uncomment to enable an alternative service url.
1783494f7c0SMartin Matuska#ZED_NTFY_URL="https://ntfy.sh"
179f552d7adSMartin Matuska
180f552d7adSMartin Matuska##
181f552d7adSMartin Matuska# Gotify server URL
182f552d7adSMartin Matuska# This defines a URL that the Gotify call will be directed toward.
183f552d7adSMartin Matuska# <https://gotify.net/docs/index>
184f552d7adSMartin Matuska# Disabled by default; uncomment to enable.
185f552d7adSMartin Matuska#ZED_GOTIFY_URL=""
186f552d7adSMartin Matuska
187f552d7adSMartin Matuska##
188f552d7adSMartin Matuska# Gotify application token
189f552d7adSMartin Matuska# This defines a Gotify application token which a message is associated with.
190f552d7adSMartin Matuska# This token is generated when an application is created on the Gotify server.
191f552d7adSMartin Matuska# Disabled by default; uncomment to enable.
192f552d7adSMartin Matuska#ZED_GOTIFY_APPTOKEN=""
193f552d7adSMartin Matuska
194f552d7adSMartin Matuska##
195f552d7adSMartin Matuska# Gotify priority (optional)
196f552d7adSMartin Matuska# If defined, this overrides the default priority of the
197f552d7adSMartin Matuska# Gotify application associated with ZED_GOTIFY_APPTOKEN.
198f552d7adSMartin Matuska# Value is an integer 0 and up.
199f552d7adSMartin Matuska#ZED_GOTIFY_PRIORITY=""
200