okerrupdate


Nameokerrupdate JSON
Version 2.0.5 PyPI version JSON
download
home_pagehttps://github.com/yaroslaff/okerrupdate
Summaryclient-side okerr module and utilities
upload_time2024-02-12 09:45:29
maintainer
docs_urlNone
authorYaroslav Polyakov
requires_python
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # okerrupdate - client-side okerr module and utilities

## Installation 

```shell
# newer method with pipx
sudo pipx install okerrupdate

# old method with pip3, if you cannot install pipx
sudo pip3 install okerrupdate


sudo okerrmod --init # enable few basic modules, create /etc/cron.d/ job, create okerrupdate config template
sudo vim /etc/okerr/okerrupdate
```

and modify okerrupdate file:
~~~
# Stub for okerrmod            
PREFIX=braconnier:
OKERR_TEXTID=
OKERR_SECRET=
OKERR_URL=
OKERR_DIRECT=0

OKERR_MOD_AVAIL=
~~~
or provide values to `okerrmod --init` as option values (e.g. `okerrmod --init --textid MyTextid`).


## Basic usage

### okerrupdate utility

okerrupdate is small script which updates/creates indicators in okerr project. 

This will create simplest indicator 'myindicator' with all default settings (type 'heartbeat', policy 'Default').
Indicator will send alert if it will be updated to 'ERR' or if will not be updated for some time 
(Default policy period+patience).
```shell
$ okerrupdate myindicator OK
okerr updated (200 OK) myindicator@okerr = OK
```

This will create numerical indicator 'temp' with current value 36.6, and policy 'Daily'. Will send alert if not updated 
for a day or if value will be over maxlim (37).
```shell
$ okerrupdate -p Daily -m 'numerical|maxlim=37' temp 36.6
okerr updated (200 OK) temp@okerr = 36.6
```

Project TextID and secret is read from `/etc/okerr/okerrupdate` file or `OKERR_TEXTID` and `OKERR_SECRET` environment 
variables.


### okerrmod utility
okerrmod is script to perform different local checks (such as free disk space, mysql running, load average, etc.). After initial `okerrmod --init`, few basic check modules 
are enabled.

List all available check modules (`+` - module enabled, `-` - module disabled ):
```shell
$ okerrmod --list
+ backups 0.1 Check freshness for backup files
+ df 0.1 Free disk space
...
```

To run enabled checks just run `okerrmod` without any other commands:
```shell
xenon@braconnier:~$ sudo okerrmod 
okerr updated (200 OK) braconnier:maxfilesz@okerr = 9077814
okerr updated (200 OK) braconnier:apache@okerr = 0
okerr updated (200 OK) braconnier:nonempty@okerr = 0
okerr updated (200 OK) braconnier:empty@okerr = 0
...
```

To run just one check:
```shell
$ sudo okerrmod --run ok
okerr updated (200 OK) braconnier:ok@okerr = OK
```

To enable new check:
```shell
$ sudo okerrmod --enable runstatus
2020/01/17 16:12:30 enable /usr/local/lib/python3.7/dist-packages/okerrupdate/mods-available/runstatus
2020/01/17 16:12:30 make default config file: /etc/okerr/mods-env/runstatus

```

After this, you may want to edit default configuration for this check
```shell
sudo vim /etc/okerr/mods-env/runstatus
```

After this, `okerrmod` will run this check.

To create your own very basic check 'my' create dir `/etc/okerr/mods-available/my` and edit `/etc/okerr/mods-available/my/check`:
```shell
#!/usr/bin/python3
print("STATUS: OK")
```
or if you prefer shell (check is any executable file):
```shell
#!/bin/sh
echo STATUS: OK
```

Now you can run it manually `okerrmod --run my`, enable `okerrmod --enable my`, make/edit config file for it 
`/etc/okerr/mods-env/my`.

## Using okerrupdate python library
Simplest case:
```python
#!/usr/bin/python
import okerrupdate

op = okerrupdate.OkerrProject('MyTextID', secret='MySecret')
i = op.indicator('temp', method='numerical|maxlim=37', policy='Daily')
i.update('36.6')
```

## Documentation 
More info in [okerrupdate documentation](https://okerrupdate.readthedocs.io/).

# Other okerr resources
- [Okerr main website](https://okerr.com/)
- [Okerr-server source code repository](https://github.com/yaroslaff/okerr-dev/) 
- [Okerr client (okerrupdate) repositoty](https://github.com/yaroslaff/okerrupdate) and [okerrupdate documentation](https://okerrupdate.readthedocs.io/)
- [Okerrbench network server benchmark](https://github.com/yaroslaff/okerrbench)
- [Okerr custom status page](https://github.com/yaroslaff/okerr-status)
- [Okerr JS-powered static status page](https://github.com/yaroslaff/okerrstatusjs)
- [Okerr network sensor](https://github.com/yaroslaff/sensor)


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/yaroslaff/okerrupdate",
    "name": "okerrupdate",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "",
    "author": "Yaroslav Polyakov",
    "author_email": "yaroslaff@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/64/62/8ae8594e5e3ca8a1f1beff3d1f583be518e179beb1fb02d96354cdbf27ed/okerrupdate-2.0.5.tar.gz",
    "platform": null,
    "description": "# okerrupdate - client-side okerr module and utilities\n\n## Installation \n\n```shell\n# newer method with pipx\nsudo pipx install okerrupdate\n\n# old method with pip3, if you cannot install pipx\nsudo pip3 install okerrupdate\n\n\nsudo okerrmod --init # enable few basic modules, create /etc/cron.d/ job, create okerrupdate config template\nsudo vim /etc/okerr/okerrupdate\n```\n\nand modify okerrupdate file:\n~~~\n# Stub for okerrmod            \nPREFIX=braconnier:\nOKERR_TEXTID=\nOKERR_SECRET=\nOKERR_URL=\nOKERR_DIRECT=0\n\nOKERR_MOD_AVAIL=\n~~~\nor provide values to `okerrmod --init` as option values (e.g. `okerrmod --init --textid MyTextid`).\n\n\n## Basic usage\n\n### okerrupdate utility\n\nokerrupdate is small script which updates/creates indicators in okerr project. \n\nThis will create simplest indicator 'myindicator' with all default settings (type 'heartbeat', policy 'Default').\nIndicator will send alert if it will be updated to 'ERR' or if will not be updated for some time \n(Default policy period+patience).\n```shell\n$ okerrupdate myindicator OK\nokerr updated (200 OK) myindicator@okerr = OK\n```\n\nThis will create numerical indicator 'temp' with current value 36.6, and policy 'Daily'. Will send alert if not updated \nfor a day or if value will be over maxlim (37).\n```shell\n$ okerrupdate -p Daily -m 'numerical|maxlim=37' temp 36.6\nokerr updated (200 OK) temp@okerr = 36.6\n```\n\nProject TextID and secret is read from `/etc/okerr/okerrupdate` file or `OKERR_TEXTID` and `OKERR_SECRET` environment \nvariables.\n\n\n### okerrmod utility\nokerrmod is script to perform different local checks (such as free disk space, mysql running, load average, etc.). After initial `okerrmod --init`, few basic check modules \nare enabled.\n\nList all available check modules (`+` - module enabled, `-` - module disabled ):\n```shell\n$ okerrmod --list\n+ backups 0.1 Check freshness for backup files\n+ df 0.1 Free disk space\n...\n```\n\nTo run enabled checks just run `okerrmod` without any other commands:\n```shell\nxenon@braconnier:~$ sudo okerrmod \nokerr updated (200 OK) braconnier:maxfilesz@okerr = 9077814\nokerr updated (200 OK) braconnier:apache@okerr = 0\nokerr updated (200 OK) braconnier:nonempty@okerr = 0\nokerr updated (200 OK) braconnier:empty@okerr = 0\n...\n```\n\nTo run just one check:\n```shell\n$ sudo okerrmod --run ok\nokerr updated (200 OK) braconnier:ok@okerr = OK\n```\n\nTo enable new check:\n```shell\n$ sudo okerrmod --enable runstatus\n2020/01/17 16:12:30 enable /usr/local/lib/python3.7/dist-packages/okerrupdate/mods-available/runstatus\n2020/01/17 16:12:30 make default config file: /etc/okerr/mods-env/runstatus\n\n```\n\nAfter this, you may want to edit default configuration for this check\n```shell\nsudo vim /etc/okerr/mods-env/runstatus\n```\n\nAfter this, `okerrmod` will run this check.\n\nTo create your own very basic check 'my' create dir `/etc/okerr/mods-available/my` and edit `/etc/okerr/mods-available/my/check`:\n```shell\n#!/usr/bin/python3\nprint(\"STATUS: OK\")\n```\nor if you prefer shell (check is any executable file):\n```shell\n#!/bin/sh\necho STATUS: OK\n```\n\nNow you can run it manually `okerrmod --run my`, enable `okerrmod --enable my`, make/edit config file for it \n`/etc/okerr/mods-env/my`.\n\n## Using okerrupdate python library\nSimplest case:\n```python\n#!/usr/bin/python\nimport okerrupdate\n\nop = okerrupdate.OkerrProject('MyTextID', secret='MySecret')\ni = op.indicator('temp', method='numerical|maxlim=37', policy='Daily')\ni.update('36.6')\n```\n\n## Documentation \nMore info in [okerrupdate documentation](https://okerrupdate.readthedocs.io/).\n\n# Other okerr resources\n- [Okerr main website](https://okerr.com/)\n- [Okerr-server source code repository](https://github.com/yaroslaff/okerr-dev/) \n- [Okerr client (okerrupdate) repositoty](https://github.com/yaroslaff/okerrupdate) and [okerrupdate documentation](https://okerrupdate.readthedocs.io/)\n- [Okerrbench network server benchmark](https://github.com/yaroslaff/okerrbench)\n- [Okerr custom status page](https://github.com/yaroslaff/okerr-status)\n- [Okerr JS-powered static status page](https://github.com/yaroslaff/okerrstatusjs)\n- [Okerr network sensor](https://github.com/yaroslaff/sensor)\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "client-side okerr module and utilities",
    "version": "2.0.5",
    "project_urls": {
        "Homepage": "https://github.com/yaroslaff/okerrupdate"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "55c9769ce11d8c63fb43881ff63c24aefaa427c6fcd3a8e68589dc78e1eed6c9",
                "md5": "448b334bb1f70f30f763d9b00011e2fa",
                "sha256": "dfd2fa4da034ed337ca62b7995461fff65a324d7c16e296dc18b41edea23a45e"
            },
            "downloads": -1,
            "filename": "okerrupdate-2.0.5-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "448b334bb1f70f30f763d9b00011e2fa",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 42832,
            "upload_time": "2024-02-12T09:45:26",
            "upload_time_iso_8601": "2024-02-12T09:45:26.956269Z",
            "url": "https://files.pythonhosted.org/packages/55/c9/769ce11d8c63fb43881ff63c24aefaa427c6fcd3a8e68589dc78e1eed6c9/okerrupdate-2.0.5-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "64628ae8594e5e3ca8a1f1beff3d1f583be518e179beb1fb02d96354cdbf27ed",
                "md5": "02805cf17745e0e840cf972bef2bcb4c",
                "sha256": "ba9754ccbbcb7f3730bf1ad04307f26291e7ad2c5786874b21742fc91057dfee"
            },
            "downloads": -1,
            "filename": "okerrupdate-2.0.5.tar.gz",
            "has_sig": false,
            "md5_digest": "02805cf17745e0e840cf972bef2bcb4c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 27625,
            "upload_time": "2024-02-12T09:45:29",
            "upload_time_iso_8601": "2024-02-12T09:45:29.437254Z",
            "url": "https://files.pythonhosted.org/packages/64/62/8ae8594e5e3ca8a1f1beff3d1f583be518e179beb1fb02d96354cdbf27ed/okerrupdate-2.0.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-12 09:45:29",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "yaroslaff",
    "github_project": "okerrupdate",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "okerrupdate"
}
        
Elapsed time: 0.19811s