georgeherby / madevice Goto Github PK
View Code? Open in Web Editor NEWProvides a way to monitor devices being used in MAD.
Provides a way to monitor devices being used in MAD.
It seems that PR24, which converted "datetime.now()" to "datetime.utcnow()" has broken this script for Madmin instances which are storing Last Update time using a different timezone. I've attached an image with the appropriate debug information. Please let me know if you need anything else to help resolve this issue.
MADevice throws a constant error for each webhook sent, with only the following info:
4|MADevice | [03-17 21:03:36] [ ScanChecker] [ alert:96] [ ERROR] Post to Discord webhook returned an error 400, the response is:
4|MADevice | {"embeds": ["0"]}
Pasting a webhook sent into lew.la shows the following error: Error: {"content": ["Must be 2000 or fewer in length."]} This was confirmed by reducing the number of scanners down to 8 or so and the webhooks began working again.
Hi there,
Running a Docker-container, and I'm getting the following issue. Never changed anything in alert.py, and if I run the script locally; it works as expected. Is there anything I'm missing?
Traceback (most recent call last):
import requests
File "/usr/src/app/alert.py", line 7, in <module>
from alert import alert_thread
File "/usr/src/app/./main.py", line 7, in <module>
ModuleNotFoundError: No module named 'requests'
The alerts on communication failures are great, however if your server is over 2500 users, you can not get mobile push notification for that channel. In this case, it would be helpful to had the bot automagically tag an admin or a role to let them know that something is wrong.
I cloned the repo and follwed the steps. (Master branch)
After starting the main.py within the venv I got the following error:
[09-25 20:46:49] [ ScanChecker] [ alert:96] [ ERROR] Issues in the checker tread exception was: Expecting ',' delimiter: line 9 column 41 (char 337)
I'm using python3.7 on Debian
Update: same for develop branch:
~/MADevice# py3/bin/python3.7 main.py
[09-25 20:51:36] [ ScanChecker] [ alert:33] [ INFO] Starting Device Checker Script
Traceback (most recent call last):
File "/root/MADevice/alert.py", line 36, in alert_thread
servers_config_json = json.load(servers_json)
File "/usr/lib/python3.7/json/__init__.py", line 296, in load
parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw)
File "/usr/lib/python3.7/json/__init__.py", line 348, in loads
return _default_decoder.decode(s)
File "/usr/lib/python3.7/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python3.7/json/decoder.py", line 353, in raw_decode
obj, end = self.scan_once(s, idx)
json.decoder.JSONDecodeError: Expecting ',' delimiter: line 9 column 41 (char 337)
[09-25 20:51:36] [ ScanChecker] [ alert:101] [ ERROR] Issues in the checker tread exception was: Expecting ',' delimiter: line 9 column 41 (char 337)
[09-25 20:51:41] [ MainThread] [ bot:22] [ INFO] Logged in. Username: BotStatus. User ID:xxxxxxxxxx
Timezones work great in the UK but not in other countries such as the Netherlands that is 2 hours ahead of UTC. The date in my DB is UTC and not BST. So the code currently handles this and converts. But this is not handling counties that are outside of that... damn timezones. Why do all clocks not just abide by epoch...
Issues faced by @dkmur
This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.
These updates have all been created already. Click a checkbox below to force a retry/rebase of any.
Dockerfile
python 3.7
requirements.txt
discord.py ==1.4.1
Would be nice if it did! Thanks for the great tool!
currently scanning 3 town’s within one MAD instance, forwarding all device alarms to 3 discord severs, devices spread around over the 3 different communities. Not really a nice solution.
Would it be possible, something like:
In config file the option to define area’s with origins assigned to that area, i.e. (‘Town1’,’Device1’).
For each area the possibility to report to different discord server/channel i.e. (‘Town1’,’Channel1’)
For !status to be limited to origins depending from which discord channel the command is given.
When I launch MADevice after config, and adding to my server I get an error. Can you help me troubleshoot it?
[01-25 00:12:57] [ ScanChecker] [ alert:32] [ INFO] Starting Device Checker Script
[01-25 00:12:57] [ ScanChecker] [ alert:40] [ INFO] Starting check on 192.168.1.100:9000
[01-25 00:12:57] [ ScanChecker] [ connector:11] [ DEBUG] MADmin auth used
[01-25 00:12:57] [ ScanChecker] [ alert:96] [ ERROR] Issues in the checker tread exception was: 'origin'
[01-25 00:12:59] [ MainThread] [ bot:22] [ INFO] Logged in. Username: MADevice.
Is it possible to delete old notifications in case a new Notification has been send? Because the newest notification have all infos, the old one is obsolete.
hello, is it possible to list the devices in ascending order?
Currently when a device loses communication, and the alert is sent... it only sends the name of the device and time it last communicated.
It would be very helpful if it had the AREA that was assigned to, in that notification as well. If you have all your devices named generically (device1, device2 etc), its hard to tell which area is down.
When MAD is off or crash, madevice is crashed and needed to restart. It will be great to avoid it and send notification when its not possible to connect server
Hi,
while trying to get this working i got some errors.
These came from the double entry made with "alert_role_id" inside the json.
Would be nice for some more ppl, if you remove this i guess.
Discord is nice, but close to everything of MAD is working with Telegram. It would be absolutely fantastic to manage everything via one Platform.
Thx in advance
Upon starting it, i have the below error. Any help would be great
[07-06 06:45:46] [ ScanChecker] [ alert:96] [ ERROR] Issues in the checker tread exception was: Expecting ',' delimiter: line 9 column 41 (char 350)
[07-06 06:45:51] [ MainThread] [ bot:22] [ INFO] Logged in. Username: MY SERVER. User ID:567321074841xxxxxx```
With the current status of MAD and MADevice i only get: Server is not available to get status
could you please fix this :)
Starting Device Checker Script
Starting check on 192.168.0.46:5000
General error Expecting value: line 1 column 1 (char 0)
Issues in the checker tread exception was: 'NoneType' object is not iterable
Logged in. Username: xxxx. User ID:xxxx
Status request received for Server
on !status call in discord general error is given again. any suggestions?
I'm running MADevice on 3 different VPS. Each one uses the same Discord Bot and same webhook but from time to time Discord Bot simply goes offline so !status
doesn't work at all. Webhook obviously works so I'm still getting new updates if something doesn't work properly. Also there is no error in logs. The only way to fix this issue is to restart MADevice on each VPS
I'm not the only one having that issue
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.