Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions NEWS.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,11 @@ several `FSD` notifications into one executed action. [PR #3097]

- `upsc` has now optional JSON output [issue #3172, PR #3178]

- `upscmd` and `upsrw` clients would now report that the "OK" response only
means that the server accepted the query, if wait mode ("TRACKING") was
not specified, and what users could do about it (e.g. use the `-w` option
or `export NUT_QUIET_OK_NOTRACKING=true` to hide the warning). [issue #3383]

- `upsset` CGI tool should now recognize `RANGE NUMBER` and `NUMBER` types.
[#3164]

Expand Down
17 changes: 14 additions & 3 deletions clients/upscmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -211,11 +211,22 @@ static void do_cmd(char **argv, const int argc)
/* sanity check on the size: "OK TRACKING " + UUID4_LEN */
strlen(buf) != (UUID4_LEN - 1 + strlen("OK TRACKING "))
) {
char *e = getenv("NUT_QUIET_OK_NOTRACKING");
int lvl = 0; /* Visible by default */

if (e && !strcmp(e, "true"))
lvl = 1; /* Hide into debuging if asked to */

/* reply as usual */
fprintf(stderr, "%s\n", buf);
upsdebugx(1, "%s: 'OK' only means the NUT data server accepted the request as valid, "
"but as we did not wait for result, we do not know if it was handled in fact.",
__func__);
upsdebugx(lvl, "%s: 'OK' only means the NUT data server accepted\n"
"the request as valid, but as we did not wait for result,\n"
"we do not know if it was handled in fact.%s",
lvl ? __func__ : "WARNING",
lvl ? "" :
"\nYou can export NUT_QUIET_OK_NOTRACKING=true to hide this message,\n"
"or use -w [-t SEC] option(s) to track the actual outcome."
);
return;
}

Expand Down
17 changes: 14 additions & 3 deletions clients/upsrw.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,22 @@ static void do_set(const char *varname, const char *newval)
/* sanity check on the size: "OK TRACKING " + UUID4_LEN */
strlen(buf) != (UUID4_LEN - 1 + strlen("OK TRACKING "))
) {
char *e = getenv("NUT_QUIET_OK_NOTRACKING");
int lvl = 0; /* Visible by default */

if (e && !strcmp(e, "true"))
lvl = 1; /* Hide into debuging if asked to */

/* reply as usual */
fprintf(stderr, "%s\n", buf);
upsdebugx(1, "%s: 'OK' only means the NUT data server accepted the request as valid, "
"but as we did not wait for result, we do not know if it was handled in fact.",
__func__);
upsdebugx(lvl, "%s: 'OK' only means the NUT data server accepted\n"
"the request as valid, but as we did not wait for result,\n"
"we do not know if it was handled in fact.%s",
lvl ? __func__ : "WARNING",
lvl ? "" :
"\nYou can export NUT_QUIET_OK_NOTRACKING=true to hide this message,\n"
"or use -w [-t SEC] option(s) to track the actual outcome."
);
return;
}

Expand Down
3 changes: 2 additions & 1 deletion docs/nut.dict
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
personal_ws-1.1 en 3727 utf-8
personal_ws-1.1 en 3728 utf-8
AAC
AAS
ABI
Expand Down Expand Up @@ -835,6 +835,7 @@ NOTIFYMSG
NOTOFF
NOTOTHER
NOTOVER
NOTRACKING
NOTTRIM
NQA
NTFS
Expand Down
Loading