Cannot get third-party notifications to work

    • OMV 4.x
    • Resolved

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • Cannot get third-party notifications to work

      New

      Hello,

      I've checked the forums and I can't seem to find an answer to my problem. I'm trying to get pushover notifications on my phone for my server but all the environment variables are blank when executing the script.

      Here is the script for pushover which is in /usr/share/openmediavault/notification/sink.d/push_notification:

      Shell-Script

      1. #!/bin/bash
      2. curl -s \
      3. -F "token=<app_token>" \
      4. -F "user=<user_token>" \
      5. -F "title=${OMV_NOTIFICATION_SUBJECT}" \
      6. -F "message=${cat ${OMV_NOTIFICATION_MESSAGE_FILE})" \
      7. -F "url=https://<url>" \
      8. -F "url_title=Go to dashboard for more info" \
      9. -F "priority=1" \
      10. https://api.pushover.net/1/messages.json

      When sending a test email, nothing will show up but I'll receive the email. When I manually execute the script, it will just hang and will not send a request. I thought it was because cat is reading for a file that doesn't exist but I've created another script that checks the environment variables passed in by /usr/share/openmediavault/notification/postfix-runner.sh:

      Shell-Script

      1. #!/bin/bash
      2. cat ${OMV_NOTIFICATION_SUBJECT} > /tmp/testmessage.txt
      3. cat ${OMV_NOTIFICATION_MESSAGE_FILE} >> /tmp/testmessage.txt
      All I get is This is an automatically generated mail message from the system notification service running on ServerHDD. There was no subject line. I'm not for sure if it's because of the test email doesn't have a subject line. As you can see, it executes the script and passes in the (at least one) variables but it doesn't seem to work with my other script.

      If anyone could help, that would be great!
    • New

      Solved it myself...

      Not for sure how run-parts work but it DOES require a number in front of the script name so /usr/share/openmediavault/notification/push_notification must be called /usr/share/openmediavault/notification/<##>pushnotification.

      Edit: also cannot have an underscore...