Connection monitoring
=====================
Simple tool to monitor the health of SSH tunnels.
Use case
--------
Assume you have several SSH tunnels set up from your home network to a
remote server with a public IPv4, so you can easily reach back to your
private network from the internet.
This monitoring tool can periodically tests health of the SSH tunnels
and notifies you over Telegram or Email (or both) if anything changes,
e.g., tunnel is not usable (e.g., in a case of connectivity loss in your
home network or tunneled host being down / unresponsive).
Setup
-----
- pip-install this package ``pip install -U ph4-connmon``
- Configure ``config.json`` according to
`assets/config-example.json <assets/config-example.json>`__
- Configure notification channels, either
- `Telegram
bot <https://www.teleme.io/articles/create_your_own_telegram_bot?hl=en>`__
- or Email sender (e.g.,
`Gmail <https://www.lifewire.com/get-a-password-to-access-gmail-by-pop-imap-2-1171882>`__)
or both
- Run ``assets/install.sh`` to install ``ph4connmon.service`` systemd
service
- Run ``systemctl start ph4connmon.service``
Notification examples
---------------------
::
Status: nas-ssh @ 127.0.0.1:3022 - ssh over ssh, open: True (0x), app: SSH-2.0-OpenSSH_8.2, 0.12s
nas-web @ 127.0.0.1:2001 - https over ssh, open: True (0x), app: True, 0.02s
rpi-ssh @ 127.0.0.1:1022 - ssh over ssh, open: True (0x), app: SSH-2.0-OpenSSH_8.2, 0.03s, 2.19 s old
Telegram bot supports also several commands, e.g., ``/status`` and
``/full_status``, to which it responds with current state. You can
manually request status information and to check that system is
responsive.
Note that Email notifier sends only state changes, while Telegram
notifier sends also regular state updates when UPS is running on the
battery. If email user is empty, email notifier is not use. Likewise, if
bot API key is empty, telegram is not used.
Dependencies
------------
This project uses monitoring tool library
https://github.com/ph4r05/ph4-monitlib
Raw data
{
"_id": null,
"home_page": "https://github.com/ph4r05/ph4-connmon",
"name": "ph4-connmon",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "",
"author": "Dusan Klinec",
"author_email": "dusan.klinec@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/08/75/d3c97a84e59f24955eab47e1276356838b9c1c8b74f6548787fb2057e1ee/ph4-connmon-0.0.6.tar.gz",
"platform": null,
"description": "Connection monitoring\n=====================\n\nSimple tool to monitor the health of SSH tunnels.\n\nUse case\n--------\n\nAssume you have several SSH tunnels set up from your home network to a\nremote server with a public IPv4, so you can easily reach back to your\nprivate network from the internet.\n\nThis monitoring tool can periodically tests health of the SSH tunnels\nand notifies you over Telegram or Email (or both) if anything changes,\ne.g., tunnel is not usable (e.g., in a case of connectivity loss in your\nhome network or tunneled host being down / unresponsive).\n\nSetup\n-----\n\n- pip-install this package ``pip install -U ph4-connmon``\n- Configure ``config.json`` according to\n `assets/config-example.json <assets/config-example.json>`__\n- Configure notification channels, either\n\n - `Telegram\n bot <https://www.teleme.io/articles/create_your_own_telegram_bot?hl=en>`__\n - or Email sender (e.g.,\n `Gmail <https://www.lifewire.com/get-a-password-to-access-gmail-by-pop-imap-2-1171882>`__)\n or both\n\n- Run ``assets/install.sh`` to install ``ph4connmon.service`` systemd\n service\n- Run ``systemctl start ph4connmon.service``\n\nNotification examples\n---------------------\n\n::\n\n Status: nas-ssh @ 127.0.0.1:3022 - ssh over ssh, open: True (0x), app: SSH-2.0-OpenSSH_8.2, 0.12s\n nas-web @ 127.0.0.1:2001 - https over ssh, open: True (0x), app: True, 0.02s\n rpi-ssh @ 127.0.0.1:1022 - ssh over ssh, open: True (0x), app: SSH-2.0-OpenSSH_8.2, 0.03s, 2.19 s old\n\nTelegram bot supports also several commands, e.g., ``/status`` and\n``/full_status``, to which it responds with current state. You can\nmanually request status information and to check that system is\nresponsive.\n\nNote that Email notifier sends only state changes, while Telegram\nnotifier sends also regular state updates when UPS is running on the\nbattery. If email user is empty, email notifier is not use. Likewise, if\nbot API key is empty, telegram is not used.\n\nDependencies\n------------\n\nThis project uses monitoring tool library\nhttps://github.com/ph4r05/ph4-monitlib\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Network connection monitoring tool",
"version": "0.0.6",
"project_urls": {
"Homepage": "https://github.com/ph4r05/ph4-connmon"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "0875d3c97a84e59f24955eab47e1276356838b9c1c8b74f6548787fb2057e1ee",
"md5": "417ee653d49c0c0900cd053f3f94f37e",
"sha256": "51b57b9b63149f1ea2dae7d61d85701e3ca18b1bd76a359cc8d93f174adf2bdd"
},
"downloads": -1,
"filename": "ph4-connmon-0.0.6.tar.gz",
"has_sig": false,
"md5_digest": "417ee653d49c0c0900cd053f3f94f37e",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 8354,
"upload_time": "2023-09-24T07:40:53",
"upload_time_iso_8601": "2023-09-24T07:40:53.349184Z",
"url": "https://files.pythonhosted.org/packages/08/75/d3c97a84e59f24955eab47e1276356838b9c1c8b74f6548787fb2057e1ee/ph4-connmon-0.0.6.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-09-24 07:40:53",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "ph4r05",
"github_project": "ph4-connmon",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "ph4-connmon"
}