Comments (14)
@bergernetch commented 27 days ago:
I still like email as a notification system.
However, for a lot of stuff I use MQTT which in turn uses my home assistant telegram integration to bring push messages to my phone..
from scrutiny.
Looking forward to Pushover implementation, would be very useful :)
from scrutiny.
Hey @tommyalatalo
I have a beta version of the notifications available via this Docker image: analogj/scrutiny:notifications
Would you be willing to test it out for me?
I updated the branch README with some additional instructions -- basically a link to the shoutrrr docs since that's what I use under the hood: https://containrrr.dev/shoutrrr/services/overview/
The notifications test endpoint will return a "success" value, and any error messages in the json body.
from scrutiny.
Hey @tommyalatalo
I have a beta version of the notifications available via this Docker image:
analogj/scrutiny:notifications
Would you be willing to test it out for me?
I updated the branch README with some additional instructions -- basically a link to the shoutrrr docs since that's what I use under the hood: https://containrrr.dev/shoutrrr/services/overview/
The notifications test endpoint will return a "success" value, and any error messages in the json body.
I tried setting the notifications beta image up and sent a POST request to /api/health/notify, the service fails with a certificate error when doing this (not sure if this was the test you wanted me to do though).
The error after the request is received by scrutiny:
time="2020-10-04T10:09:44Z" level=info msg="Sending notifications to pushover://shoutrrr:api@user/?devices=mi8se?priority=1&&title=Scrutiny"
time="2020-10-04T10:09:48Z" level=error msg="One or more errors occurred occurred while sending notifications for pushover://shoutrrr:api@user/?devices=mi8se?priority=1&&title=Scrutiny:"
time="2020-10-04T10:09:48Z" level=error msg="failed to send notifications to pushover devices: [Post \"https://api.pushover.net/1/messages.json\": x509: certificate signed by unknown authority]"
time="2020-10-04T10:09:48Z" level=error msg="One or more notifications failed to send successfully. See logs for more information."
time="2020-10-04T10:09:48Z" level=error msg="An error occurred while sending test notification failed to send notifications to pushover devices: [Post \"https://api.pushover.net/1/messages.json\": x509: certificate signed by unknown authority]"
time="2020-10-04T10:09:48Z" level=error msg="192.168.1.110 - dce78d6076e2 [04/Oct/2020:10:09:48 +0000] \"POST /api/health/notify\" 500 179 \"\" \"curl/7.72.0\" (4175ms)" clientIP=192.168.1.110 hostname=dce78d6076e2 latency=4175 method=POST path=/api/health/notify referer= respLength=179 statusCode=500 userAgent=curl/7.72.0
The tokens used for the notifications should probably be readable from environment variables such as SCRUTINY_PUSHOVER_API_TOKEN
and SCRUTINY_PUSHOVER_USER_KEY
, so that you don't have to risk committing them into git. Like put them into a .env file which you load with docker-compose along other config, and gitignore the .env file.
A completely unrelated nitpick I would like to point out is that the service only looks for "/scrutiny/config/scrutiny.yaml" with the "yaml" extension. It would make a lot of sense to look for ".yml" as well since the short version of the extension is as common, if not more so, as ".yaml".
from scrutiny.
Weird that you got a certificate error. I used pushover for testing myself, and I didn't have any issues. Though, you do have a malformed url:
pushover://shoutrrr:api@user/?devices=mi8se?priority=1&&title=Scrutiny
should probably be:
pushover://shoutrrr:api@user/?devices=mi8se&priority=1&title=Scrutiny
Regarding the environmental variables: yes, I will be supporting config from environmental variables once this notification work is complete. tracked in #52
That's a good point about /scrutiny/config/scrutiny.yaml
I'll create another issue to track that.
from scrutiny.
I removed the duplicate &
in the url, the certificate error remains though. Don't know if the problem its in your code or shoutrrr.
I send pushover notifications to my phone using the same credentials every day with a go project of my own, but I use a specific pushover library, not shoutrrr for that. I have received multiple notifications from my own app today, so it's likely not a problem with pushover itself.
from scrutiny.
hm. So I took a look at my pushover url and compared it to yours
here's mine:
- "pushover://shoutrrr:MY_API_KEY@MY_USER_KEY?priority=1&devices="
I don't provide the title, and I don't have a trailing slash after the user key.
Can you try that with your setup?
from scrutiny.
Using this line
- "pushover://shoutrrr:apitoken@userkey?priority=1?devices="
I get the error
time="2020-10-04T19:39:14Z" level=error msg="An error occurred while sending notifications pushover://shoutrrr:api@user?priority=1?devices=mi8se: error initializing router services: strconv.ParseInt: parsing \"1?devices=\": invalid syntax"
The same error occurs when setting the device to "mi8se" in my case.
If I change the order of the devices and priority fields, and then also try defining the device the error is again the x509 unknown certificate authority.
According to the shoutrrr docs there should be a slash after the user key.
from scrutiny.
double ?
are not valid in the URI. Basically ?
denotes the beginning of the query string, and all subsequent key/value pairs are joined with a &
. Can you change your config line to:
- "pushover://shoutrrr:apitoken@userkey?priority=1&devices="
I just tested it myself, and confirmed it was working.
from scrutiny.
ok I lied. I was able to replicate your issue. I've been testing with the binary directly on my dev machine. I just tried it in the container and got the certificate error. Give me a couple of minutes to figure this out.
from scrutiny.
double
?
are not valid in the URI. Basically?
denotes the beginning of the query string, and all subsequent key/value pairs are joined with a&
.
Obviously my brain is not working at full capacity. Drop a note here when you have a new build and I'll give it a go tomorrow.
from scrutiny.
Alright, I updated the latest analogj/scrutiny:notifications
image, and verified that it works for me locally.
Can you try it out when you get a chance?
from scrutiny.
I pulled the new image and tried it now, sending the notification works.
However there is still an error message logged in the output before logging "successfully sent notifications":
time="2020-10-05T06:47:29Z" level=info msg="Sending notifications to pushover://shoutrrr:api@user/?devices=mi8se&priority=1"
time="2020-10-05T06:47:34Z" level=error msg="One or more errors occurred occurred while sending notifications for pushover://shoutrrr:api@user/?devices=mi8se&priority=1:"
time="2020-10-05T06:47:34Z" level=info msg="Successfully sent notifications. Check logs for more information."
time="2020-10-05T06:47:34Z" level=info msg="192.168.1.110 - 732d352a4e15 [05/Oct/2020:06:47:34 +0000] \"POST /api/health/notify\" 200 42 \"\" \"curl/7.72.0\" (5111ms)" clientIP=192.168.1.110 hostname=732d352a4e15 latency=5111 method=POST path=/api/health/notify referer= respLength=42 statusCode=200 userAgent=curl/7.72.0
from scrutiny.
Great! that error message can be ignored. I'll fix that before I merge the branch.
from scrutiny.
Related Issues (20)
- [BUG] Error: short-name "influxdb:2.7" did not resolve to an alias and no unqualified-search registries are defined in "/etc/containers/registries.conf" HOT 2
- [BUG] HOT 2
- [FEAT] show human readable values HOT 1
- [BUG] Temperature bubble dropping outside window when drive temperature is very low
- [BUG] Deleting a device in the Scrutiny UI does not delete the influxdb data and persists the device across docker restarts HOT 4
- [FEAT] Support for VictoriaMetrics HOT 1
- [FEAT] scrutiny-collector-metrics for RPI 4 (arm) HOT 1
- [Help] InfluxDB can't run on container's restart HOT 1
- [BUG] - Cron Interval is Not Working with Custom Configuration HOT 4
- [BUG] Cannot access web service using ipv6
- [FEAT] sorry for troubling you but are issues here being deleted rather than closed? HOT 7
- Question regarding "scrutiny" value HOT 1
- Question: Is it possible to force show all disks? HOT 4
- [FEAT] Remove the temperature graph HOT 1
- [BUG] Scrutiny should be cgroup aware
- [FEAT] 2 Options: (1) disable alert in Dashboard until next data change (2) In dashboard list, show "Reallocated Sectors Count" next to POWERED ON
- [FEAT] Exclude drives HOT 1
- [FEAT] Drive Details - Show Drive Name, UUID and letter dev partch HOT 1
- [FEAT] Mark parameter in hdd as pass until to next change value HOT 1
- [BUG] runtime error: invalid memory address or nil pointer dereference HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from scrutiny.