guardian


Nameguardian JSON
Version 0.2.2 PyPI version JSON
download
home_pagehttps://sr.ht/~cedric/guardian
SummaryMonitor the status of a set of services.
upload_time2023-01-11 07:33:20
maintainer
docs_urlNone
authorCédric Bonhomme
requires_python>=3.8,<4.0
licenseAGPL-3.0-or-later
keywords monitoring system notification report
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Guardian

[![PyPi version](https://img.shields.io/pypi/v/guardian.svg?style=flat-square)](https://pypi.org/project/guardian)

Monitor the status of a set of services. Characteristics:

- definition of the services to monitor with a YAML file;
- tests performed by custom scripts (Shell scripts, Python scripts, etc.);
- no database and serverless;
- generation of HTML status page;
- email notifications;
- IRC notifications.


## Installation

```bash
$ pipx install guardian
  installed package guardian 0.2.1, Python 3.9.2
  These apps are now globally available
    - guardian
done! ✨ 🌟 ✨
```

You can now use Guardian from anywhere on your system.


## Usage

```bash
$ guardian --help
usage: guardian [-h] -c CONFIG_FILE [--email] [--irc] [--html]

optional arguments:
  -h, --help            show this help message and exit
  -c CONFIG_FILE, --config CONFIG_FILE
                        Configuration file (YAML).
  --email               Send notification of failed test(s) via email.
  --irc                 Send notification of failed test(s) via IRC.
  --html                Generate a HTML status page.
```


In order to use notification via IRC you need to install
[irker](http://www.catb.org/~esr/irker/). irker is very easy to install and
to run, no configuration is needed. Once executed, irker will wait for JSON
formatted messages on the port 6659. irker will automatically join the channel
you have specified in the
[Guardian configuration file](guardian/config/conf.cfg.sample#L2).
irker will maintain connection state for multiple channels, avoiding obnoxious
join/leave spam.

Configurations related to the sending of emails are in the
[same file](guardian/config/conf.cfg.sample#L5).


## Examples

The goal of the INI configuration file is to set global variables (IRC channel, SMTP
server, etc.). If you do not create your own configuration file, the default one will
be used automatically.

The services to monitor must be described in one (or several) YAML file(s).


```bash
$ cp guardian/config/config.cfg.sample guardian/config/config.cfg
$ cp guardian/config/services.yaml.example guardian/config/services.yaml


$ guardian -c guardian/config/services.yaml
+ Service Newspipe
 - Test about page
     ✅
+ Service MOSP
 - Test main page
     ✅
 - Test search with API v2
     ✅
 - Test API v1
     ✅
+ Freshermeat
 - Test main page
     ✅
Execution time: 0.47015 seconds.
✨ 🌟 ✨ All 5 tests are successful.
```


With email notification:

```bash
$ guardian -c guardian/config/google-services.yaml --email
+ Google services
 - Test GMail
     ✅
 - Test Web search
     ❌
 - Test Google Drive
     ✅
1 error occurred.
Execution time: 0:00:00.793011
Sending email notification...
```

You can combine email notifications, IRC notifications and HTML reporting.


## Contributing

Patches and questions? Send to my [public
inbox](https://lists.sr.ht/~cedric/public-inbox):
[`~cedric/public-inbox@lists.sr.ht`](mailto:~cedric/public-inbox@lists.sr.ht).
Thanks!


## License

[Guardian](https://sr.ht/~cedric/guardian) is licensed under
[GNU Affero General Public License version 3](https://www.gnu.org/licenses/agpl-3.0.html).

Copyright (C) 2021-2023 [Cédric Bonhomme](https://www.cedricbonhomme.org)

            

Raw data

            {
    "_id": null,
    "home_page": "https://sr.ht/~cedric/guardian",
    "name": "guardian",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8,<4.0",
    "maintainer_email": "",
    "keywords": "monitoring,system,notification,report",
    "author": "C\u00e9dric Bonhomme",
    "author_email": "cedric@cedricbonhomme.org",
    "download_url": "https://files.pythonhosted.org/packages/22/63/13d1c942d3114d40fcfa5d27de2d94a3914e91cdd189bad6d35c04efb0a4/guardian-0.2.2.tar.gz",
    "platform": null,
    "description": "# Guardian\n\n[![PyPi version](https://img.shields.io/pypi/v/guardian.svg?style=flat-square)](https://pypi.org/project/guardian)\n\nMonitor the status of a set of services. Characteristics:\n\n- definition of the services to monitor with a YAML file;\n- tests performed by custom scripts (Shell scripts, Python scripts, etc.);\n- no database and serverless;\n- generation of HTML status page;\n- email notifications;\n- IRC notifications.\n\n\n## Installation\n\n```bash\n$ pipx install guardian\n  installed package guardian 0.2.1, Python 3.9.2\n  These apps are now globally available\n    - guardian\ndone! \u2728 \ud83c\udf1f \u2728\n```\n\nYou can now use Guardian from anywhere on your system.\n\n\n## Usage\n\n```bash\n$ guardian --help\nusage: guardian [-h] -c CONFIG_FILE [--email] [--irc] [--html]\n\noptional arguments:\n  -h, --help            show this help message and exit\n  -c CONFIG_FILE, --config CONFIG_FILE\n                        Configuration file (YAML).\n  --email               Send notification of failed test(s) via email.\n  --irc                 Send notification of failed test(s) via IRC.\n  --html                Generate a HTML status page.\n```\n\n\nIn order to use notification via IRC you need to install\n[irker](http://www.catb.org/~esr/irker/). irker is very easy to install and\nto run, no configuration is needed. Once executed, irker will wait for JSON\nformatted messages on the port 6659. irker will automatically join the channel\nyou have specified in the\n[Guardian configuration file](guardian/config/conf.cfg.sample#L2).\nirker will maintain connection state for multiple channels, avoiding obnoxious\njoin/leave spam.\n\nConfigurations related to the sending of emails are in the\n[same file](guardian/config/conf.cfg.sample#L5).\n\n\n## Examples\n\nThe goal of the INI configuration file is to set global variables (IRC channel, SMTP\nserver, etc.). If you do not create your own configuration file, the default one will\nbe used automatically.\n\nThe services to monitor must be described in one (or several) YAML file(s).\n\n\n```bash\n$ cp guardian/config/config.cfg.sample guardian/config/config.cfg\n$ cp guardian/config/services.yaml.example guardian/config/services.yaml\n\n\n$ guardian -c guardian/config/services.yaml\n+ Service Newspipe\n - Test about page\n     \u2705\n+ Service MOSP\n - Test main page\n     \u2705\n - Test search with API v2\n     \u2705\n - Test API v1\n     \u2705\n+ Freshermeat\n - Test main page\n     \u2705\nExecution time: 0.47015 seconds.\n\u2728 \ud83c\udf1f \u2728 All 5 tests are successful.\n```\n\n\nWith email notification:\n\n```bash\n$ guardian -c guardian/config/google-services.yaml --email\n+ Google services\n - Test GMail\n     \u2705\n - Test Web search\n     \u274c\n - Test Google Drive\n     \u2705\n1 error occurred.\nExecution time: 0:00:00.793011\nSending email notification...\n```\n\nYou can combine email notifications, IRC notifications and HTML reporting.\n\n\n## Contributing\n\nPatches and questions? Send to my [public\ninbox](https://lists.sr.ht/~cedric/public-inbox):\n[`~cedric/public-inbox@lists.sr.ht`](mailto:~cedric/public-inbox@lists.sr.ht).\nThanks!\n\n\n## License\n\n[Guardian](https://sr.ht/~cedric/guardian) is licensed under\n[GNU Affero General Public License version 3](https://www.gnu.org/licenses/agpl-3.0.html).\n\nCopyright (C) 2021-2023 [C\u00e9dric Bonhomme](https://www.cedricbonhomme.org)\n",
    "bugtrack_url": null,
    "license": "AGPL-3.0-or-later",
    "summary": "Monitor the status of a set of services.",
    "version": "0.2.2",
    "split_keywords": [
        "monitoring",
        "system",
        "notification",
        "report"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "39f82dc6ccc5800aa4c10ed7a9c3ef6cb58a052c950b343b861419bf94b7293b",
                "md5": "0089f16fe0a560ce87b891c1e4499635",
                "sha256": "6cb6ce4cdc827e27dcd18d81c587331f00fc44c92e8b2547c9da02f18938c38b"
            },
            "downloads": -1,
            "filename": "guardian-0.2.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "0089f16fe0a560ce87b891c1e4499635",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8,<4.0",
            "size": 33806,
            "upload_time": "2023-01-11T07:33:18",
            "upload_time_iso_8601": "2023-01-11T07:33:18.861939Z",
            "url": "https://files.pythonhosted.org/packages/39/f8/2dc6ccc5800aa4c10ed7a9c3ef6cb58a052c950b343b861419bf94b7293b/guardian-0.2.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "226313d1c942d3114d40fcfa5d27de2d94a3914e91cdd189bad6d35c04efb0a4",
                "md5": "4b4acfc53a8fc4180ab673283baddc5e",
                "sha256": "658229b3e4caf22136f6bffdd231ea666cc3490cdebc080cef4f814bbef02170"
            },
            "downloads": -1,
            "filename": "guardian-0.2.2.tar.gz",
            "has_sig": false,
            "md5_digest": "4b4acfc53a8fc4180ab673283baddc5e",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8,<4.0",
            "size": 21456,
            "upload_time": "2023-01-11T07:33:20",
            "upload_time_iso_8601": "2023-01-11T07:33:20.297275Z",
            "url": "https://files.pythonhosted.org/packages/22/63/13d1c942d3114d40fcfa5d27de2d94a3914e91cdd189bad6d35c04efb0a4/guardian-0.2.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-01-11 07:33:20",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "lcname": "guardian"
}
        
Elapsed time: 0.08686s