-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupsentry.conf.example
More file actions
87 lines (76 loc) · 4.12 KB
/
Copy pathupsentry.conf.example
File metadata and controls
87 lines (76 loc) · 4.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# ============================================================
# UPSentry configuration
# Copy to /etc/upsentry/upsentry.conf and edit.
# KEEP THIS FILE PRIVATE: chmod 600 /etc/upsentry/upsentry.conf
# ============================================================
# ------------------------------------------------------------
# UPS connection (your NUT master / server)
# Works with any NUT server: ASUSTOR, Synology, QNAP, TrueNAS,
# a Linux box running nut-server, Windows NUT, etc.
# ------------------------------------------------------------
UPS_NAME="ups" # UPS name as defined on the NUT master
NUT_HOST="192.168.1.50" # IP / hostname of the NUT master
NUT_USER="upsmon" # NUT username (slave/secondary account)
NUT_PASSWORD="changeme" # NUT password
# ------------------------------------------------------------
# Notifiers — space or comma separated list.
# Available: netgsm, telegram, webhook
# Leave empty to log events only.
# ------------------------------------------------------------
NOTIFIERS="netgsm"
# --- NetGSM SMS (https://www.netgsm.com.tr) -----------------
NETGSM_USERCODE="" # subscriber number / API user
NETGSM_PASSWORD="" # API password
NETGSM_HEADER="" # approved sender title (msgheader)
NETGSM_GSMNO="" # recipient, 5xxxxxxxxx (10 digits)
NETGSM_DIL="TR" # TR keeps Turkish characters
NETGSM_FILTER="0" # IYS commercial filter (0 = personal)
# --- Telegram bot --------------------------------------------
TELEGRAM_BOT_TOKEN="" # from @BotFather
TELEGRAM_CHAT_ID="" # your chat / group id
# --- Generic webhook (ntfy, Slack, Discord, Home Assistant…) -
WEBHOOK_URL="" # message is POSTed as the request body
WEBHOOK_CONTENT_TYPE="text/plain"
# ------------------------------------------------------------
# Messages.
# MSG_LANG picks a built-in preset for all defaults: en | tr
# Any MSG_* you set below overrides the preset. Placeholders:
# {date} event time (DATE_FORMAT below)
# {duration} outage length, filled on power-restore
# {ups} UPS identifier
# ------------------------------------------------------------
MSG_LANG="en"
#MSG_ONBATT="Power outage started: {date}"
#MSG_ONLINE="Power restored: {date} (outage lasted {duration})"
#MSG_LOWBATT="UPS battery LOW — systems will shut down soon ({date})"
#MSG_FSD="UPS critical — shutting down now ({date})"
DATE_FORMAT="%d.%m.%Y %H:%M:%S"
# ------------------------------------------------------------
# Terminal-session warning (optional).
# On power loss, UPSentry can type a warning into tmux/byobu
# panes that run an AI coding agent (Claude Code, aider, …) so
# the agent saves its state before a possible shutdown.
# Panes that do NOT match the pattern are never touched.
# ------------------------------------------------------------
SESSION_NOTIFY_ENABLED="no"
SESSION_USER="" # user owning the tmux server, e.g. devuser
SESSION_PROCESS_PATTERN="claude" # case-insensitive match on pane processes
SESSION_MESSAGE="Power outage! Running on UPS battery. Please save your current progress now."
# ------------------------------------------------------------
# Shutdown behaviour (when the NUT master orders a shutdown)
# ------------------------------------------------------------
SNAPSHOT_TMUX="yes" # save a tmux session map before halting
# uses SESSION_USER above; snapshot lands in that user's home
# ------------------------------------------------------------
# Custom event hooks (optional).
# Drop executable scripts into <HOOKS_DIR>/<event>/ (onbatt, online,
# lowbatt, fsd) and they run with the rendered message as $1.
# e.g. /etc/upsentry/hooks.d/onbatt/pause-downloads.sh
# Failures are logged and never block notifications.
# ------------------------------------------------------------
HOOKS_DIR="/etc/upsentry/hooks.d"
# ------------------------------------------------------------
# Logging / state
# ------------------------------------------------------------
LOG_FILE="/var/log/upsentry.log"
STATE_DIR="/var/lib/upsentry" # outage timestamps + events.csv history