Skip to content

Commit a1763c9

Browse files
authored
Merge 4fed2e3 into a456b00
2 parents a456b00 + 4fed2e3 commit a1763c9

9 files changed

Lines changed: 199 additions & 63 deletions

File tree

NEWS.adoc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,9 @@ https://github.com/networkupstools/nut/milestone/12
120120
* Introduced `upssched -l` mode to list currently tracked timers. [#3097]
121121
* Make use of `setproctag()` and `getproctag()` to report parent/child
122122
process names. [#3084]
123+
* Introduced optional passing of `NOTIFYMSG` text (normally originating
124+
from `upsmon` which calls `upssched`) as an environment variable into
125+
the ultimately executed `CMDSCRIPT` processes. [#3105]
123126

124127
- `configure` script options:
125128
* Introduced `--with-python{,2,3}-modules-dir` to specify PyNUT(Client)

clients/upsmon.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,7 @@ static unsigned __stdcall async_notify(LPVOID param)
280280
if (notifycmd != NULL) {
281281
snprintf(exec, sizeof(exec), "%s \"%s\"", notifycmd, data->notice);
282282

283+
upsdebugx(6, "%s: Calling NOTIFYCMD: %s", __func__, exec);
283284
if (data->upsname)
284285
setenv("UPSNAME", data->upsname, 1);
285286
else

clients/upssched-cmd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
echo "`date -u`: $0: THIS IS A SAMPLE SCRIPT, PLEASE TAILOR IT FOR YOUR DEPLOYMENT OF NUT!" >&2
1818
logger -t upssched-cmd "THIS IS A SAMPLE SCRIPT, PLEASE TAILOR IT FOR YOUR DEPLOYMENT OF NUT!"
1919

20-
printf "`date -u`: UPSNAME='%s'\tNOTIFYTYPE='%s'\targs=%s\n" "$UPSNAME" "$NOTIFYTYPE" "$@" >&2
21-
printf "UPSNAME='%s' NOTIFYTYPE='%s' args=%s\n" "$UPSNAME" "$NOTIFYTYPE" "$@" | logger -t upssched-cmd-received-NOTIFYTYPE
20+
printf "`date -u`: UPSNAME='%s'\tNOTIFYTYPE='%s'\tNOTIFYMSG='%s'\targs=%s\n" "$UPSNAME" "$NOTIFYTYPE" "$NOTIFYMSG" "$*" >&2
21+
printf "UPSNAME='%s' NOTIFYTYPE='%s' NOTIFYMSG='%s' args=%s\n" "$UPSNAME" "$NOTIFYTYPE" "$NOTIFYMSG" "$*" | logger -t upssched-cmd-received-NOTIFYTYPE
2222

2323
#set
2424

0 commit comments

Comments
 (0)