{"id":18770038,"url":"https://github.com/yaroslaff/okerrupdate","last_synced_at":"2025-04-13T07:31:55.824Z","repository":{"id":57448494,"uuid":"313974050","full_name":"yaroslaff/okerrupdate","owner":"yaroslaff","description":"client for okerr monitoring (see okerr-dev project)","archived":false,"fork":false,"pushed_at":"2024-09-19T12:49:53.000Z","size":108,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-10-28T23:52:20.997Z","etag":null,"topics":["client","command-line","command-line-tool","monitoring","okerr"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yaroslaff.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-11-18T15:19:36.000Z","updated_at":"2024-09-19T12:49:57.000Z","dependencies_parsed_at":"2023-02-10T12:00:44.603Z","dependency_job_id":"8e2e634d-e89d-4f48-bd66-aecf39254552","html_url":"https://github.com/yaroslaff/okerrupdate","commit_stats":{"total_commits":95,"total_committers":1,"mean_commits":95.0,"dds":0.0,"last_synced_commit":"713ce2aae0bbb630c21157eb22f06f15099285bc"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yaroslaff%2Fokerrupdate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yaroslaff%2Fokerrupdate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yaroslaff%2Fokerrupdate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yaroslaff%2Fokerrupdate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yaroslaff","download_url":"https://codeload.github.com/yaroslaff/okerrupdate/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223573811,"owners_count":17167382,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["client","command-line","command-line-tool","monitoring","okerr"],"created_at":"2024-11-07T19:17:52.498Z","updated_at":"2024-11-07T19:17:52.977Z","avatar_url":"https://github.com/yaroslaff.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 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","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyaroslaff%2Fokerrupdate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyaroslaff%2Fokerrupdate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyaroslaff%2Fokerrupdate/lists"}