Skip to content

How do I get the NOTIFYMSG into the upssched-cmd script from the upsmon.conf #3105

@markuswells

Description

@markuswells

In my upsmon.conf I have:

NOTIFYCMD /usr/sbin/upssched
NOTIFYMSG ONLINE        "UPS %s on - line power"
NOTIFYMSG ONBATT        "UPS %s on - battery"

NOTIFYFLAG ONLINE       SYSLOG+WALL+EXEC
NOTIFYFLAG ONBATT       SYSLOG+WALL+EXEC

Then in upssched.conf :

CMDSCRIPT /usr/local/bin/upssched-cmd

# Command pipe and lock-file
PIPEFN /run/nut/upssched.pipe
LOCKFN /run/nut/upssched.lock
# Send alerts immediately on change in line power
AT ONBATT * EXECUTE onbatt

I can print, but MSG does not pass forward. Its in the log from upssched, but I want the message to post in the email.

#!/bin/sh

case $1 in
  onbatt)
    printf "1:$UPSNAME 2:"$@" 3:$NOTIFYTYPE" >&2
    ;;
esac

I do not see the pre-defined message being passed through. If it not, can you consider adjusting the code?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementimpacts-release-2.8.4Issues reported against NUT release 2.8.4 (maybe vanilla or with minor packaging tweaks)upsmonupsschedQuestions and issues about upssched (timer helper for upsmon)

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions