Get stats of your node by Telegram

Hi everyone!
I just made a simple app in Python to getting stats from node API and sending to you via Telegram. You can download code from my Github and run. You’ll find all informatios on Github.

xfilokolo/storagenode-telegram

8 Likes

I am not using it but I like that SNOs/devs are coming up with new ways to monitor their nodes. Keep up the good work! :heart:

2 Likes

Thanks, it’s just something I needed. Also for learn python a little bit. Why not share this work to our community :smiley:

5 Likes

thanks for this! just tried to install and configure it, can you tell me how to request from the bot? how the notification works?
sorry for the dumb question, first time with this!

1 Like

Sure, this is how it works:

  • Python script gets data from storage node API and coinpaprika price API
  • parse data
  • and finally, push it through Telegram API to user
1 Like

:frowning:
python3 app.py
File “app.py”, line 14
with request.urlopen(f’https://api.coinpaprika.com/v1/tickers/storj-storj?quotes={currency}') as url:
^
SyntaxError: invalid syntax

Unfortunately I get the same error. If I try to “fix” all the syntac errors I get this:

    Traceback (most recent call last):
  File "app.py", line 13, in <module>
    with request.urlopen('https://api.coinpaprika.com/v1/tickers/storj-storj?quotes={currency}') as url:
  File "/volume1/@appstore/py3k/usr/local/lib/python3.5/urllib/request.py", line 162, in urlopen
    return opener.open(url, data, timeout)
  File "/volume1/@appstore/py3k/usr/local/lib/python3.5/urllib/request.py", line 471, in open
    response = meth(req, response)
  File "/volume1/@appstore/py3k/usr/local/lib/python3.5/urllib/request.py", line 581, in http_response
    'http', request, response, code, msg, hdrs)
  File "/volume1/@appstore/py3k/usr/local/lib/python3.5/urllib/request.py", line 509, in error
    return self._call_chain(*args)
  File "/volume1/@appstore/py3k/usr/local/lib/python3.5/urllib/request.py", line 443, in _call_chain
    result = func(*args)
  File "/volume1/@appstore/py3k/usr/local/lib/python3.5/urllib/request.py", line 589, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 400: Bad Request
1 Like

sure thing! I installed and everything sounds fine, but how the push works? do I have to execute a command inline with the bot? How to see those datas in telegram?

1 Like

You need to create Telegram Bot by yourself and get your own user ID from Telegram app. You need to fill this data in a specific place in code. Everything is very clearly described in README.md on Github repo.

And how it works? The whole process (get, parse and push data) is inside one python file. You just need to run this code and python get, parse and push this data to Telegram. You can use crontab to automatize this process.

It’s really useful