{"id":34766116,"url":"https://github.com/madrisan/pyxymon","last_synced_at":"2025-12-25T07:14:06.665Z","repository":{"id":150844234,"uuid":"84585261","full_name":"madrisan/pyxymon","owner":"madrisan","description":"A simple Python module for writing xymon external scripts","archived":false,"fork":false,"pushed_at":"2025-01-26T10:11:39.000Z","size":48,"stargazers_count":7,"open_issues_count":2,"forks_count":5,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-01-26T11:19:19.505Z","etag":null,"topics":["monitoring-plugins","python-wrapper","xymon"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/madrisan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2017-03-10T17:38:35.000Z","updated_at":"2025-01-26T10:07:44.000Z","dependencies_parsed_at":"2023-04-08T05:02:06.895Z","dependency_job_id":null,"html_url":"https://github.com/madrisan/pyxymon","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/madrisan/pyxymon","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/madrisan%2Fpyxymon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/madrisan%2Fpyxymon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/madrisan%2Fpyxymon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/madrisan%2Fpyxymon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/madrisan","download_url":"https://codeload.github.com/madrisan/pyxymon/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/madrisan%2Fpyxymon/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28022985,"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","status":"online","status_checked_at":"2025-12-25T02:00:05.988Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["monitoring-plugins","python-wrapper","xymon"],"created_at":"2025-12-25T07:14:06.025Z","updated_at":"2025-12-25T07:14:06.656Z","avatar_url":"https://github.com/madrisan.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Codacy Badge](https://api.codacy.com/project/badge/Grade/3df5f854b1e44e65a1c3fc5331d4043f)](https://www.codacy.com/app/madrisan/pyxymon?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=madrisan/pyxymon\u0026amp;utm_campaign=Badge_Grade)\n[![Code Climate](https://codeclimate.com/github/madrisan/pyxymon/badges/gpa.svg)](https://codeclimate.com/github/madrisan/pyxymon)\n[![License](https://img.shields.io/badge/License-GPL--3.0-blue.svg)](https://spdx.org/licenses/GPL-3.0.html)\n\n# PyXymon\n\nPyXymon is a simple Python module that can help you write Xymon external scripts in Python.\nPyXymon provides some methods for rendering the messages you want to display in the Xymon web page and for sending them to the Xymon server.\nPyXymon reads the required informations from the Xymon environment variables, so you do not need to add any extra configuration file.\n\n## Installation\n\nJust copy the file [`pyxymon.py`](https://raw.githubusercontent.com/madrisan/pyxymon/master/pyxymon.py)\nin the xymon `ext` directory.\n\n## Usage\n\nCreate a script `yourcheck.py` using the following schema:\n\n```\n#!/usr/bin/python\n\nimport os\nimport sys\nimport pyxymon as pymon\n\nCHECK_NAME = 'yourcheck'\nCHECK_VERSION = 1\n\ndef run_check():\n    \"\"\"Check the status of whatever you want...\"\"\"\n    xymon = pymon.XymonClient(CHECK_NAME)\n    check_script = os.path.basename(__file__)\n    # do your logic...\n    # you can set the criticity of the final xymon message by using:\n    #    xymon.color = pymon.STATUS_WARNING\n    # or\n    #    xymon.color = pymon.STATUS_CRITICAL\n    # The default criticity is set to 'pymon.STATUS_OK' \n    # Optionally you can set the LIFETIME (in minutes) using:\n    #    xymon.lifetime = 15\n    xymon.title('Title in the xymon check page')\n    xymon.section('Section Title',\n                  'Text containing the lines you want to display')\n    # You can add here other sections, if required.\n    xymon.footer(check_script, CHECK_VERSION)\n    xymon.send()\n\ndef main():\n    run_check()\n\nif __name__ == '__main__':\n    main()\n    sys.exit(0)\n```\n\nConfigure your extension module in the file `$XYMONCLIENTHOME/etc/xymonclient.cfg`.\n\n```\n[yourcheck]\n        ENVFILE $XYMONCLIENTHOME/etc/xymonclient.cfg\n        CMD $XYMONCLIENTHOME/ext/yourcheck.py\n        LOGFILE $XYMONCLIENTLOGS/yourcheck.log\n        INTERVAL 10m\n```\n\nYou can find a full example [here](example/check_pacemaker.py).\n\n\u003e [!TIP]\n\u003e\n\u003e If you need to run your Python check with root privileges, just prefix the `CMD` directive in `xymonclient.cfg`\n\u003e with the `sudo` command:\n\u003e\n\u003e         CMD sudo $XYMONCLIENTHOME/ext/yourcheck.py\n\u003e\n\u003e By default *sudo* does not preserve the environment variables exported by Xymon.\n\u003e To preserve the variables required by *PyXymon*, add the following lines to the *sudo* configuration:\n\u003e\n\u003e ```\n\u003e  Defaults env_keep:xymon += \"XYMSRV\"\n\u003e  Defaults env_keep:xymon += \"XYMONDPORT\"\n\u003e  Defaults env_keep:xymon += \"MACHINE\"\n\u003e ```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmadrisan%2Fpyxymon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmadrisan%2Fpyxymon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmadrisan%2Fpyxymon/lists"}