Giter VIP home page Giter VIP logo

madevice's Issues

PR24 for UTC Support Causing Issues

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.
debug

Recurring Alerts sent to webhooks are bounced (2000 char limit)

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.

ModuleNotFoundError: No module named 'requests'

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'

Need option to tag a role or user id when device fails to communicate

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.

Issues in the checker tread exception

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

Timezone issues across the code

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

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

dockerfile
Dockerfile
  • python 3.7
pip_requirements
requirements.txt
  • discord.py ==1.4.1

  • Check this box to trigger a request for Renovate to run again on this repository

Would it be possible to split alerts over different discord severs/channels

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.

Issues in the checker tread exception was: 'origin'

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.

Clearing old notifications

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.

Display area name with the device that has lost communication

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.

Remove double entrys in server.json.(example)

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.

exception was: Expecting ',' delimiter: line 9 column 41 (char 350)

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```

Error on startup.

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?

Discord BOT goes offline

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.