{"id":20509624,"url":"https://github.com/lukeshirnia/monit","last_synced_at":"2026-04-18T00:31:07.507Z","repository":{"id":98842106,"uuid":"85731730","full_name":"LukeShirnia/monit","owner":"LukeShirnia","description":"A basic python script used to check the responsiveness of a local application/website. Executing the python script using monit","archived":false,"fork":false,"pushed_at":"2017-04-06T12:42:02.000Z","size":35,"stargazers_count":2,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-05T22:28:55.516Z","etag":null,"topics":["linux","mmonit","monit","monitoring","python"],"latest_commit_sha":null,"homepage":null,"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/LukeShirnia.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":"2017-03-21T17:16:00.000Z","updated_at":"2019-12-24T11:05:03.000Z","dependencies_parsed_at":"2023-03-27T16:02:18.160Z","dependency_job_id":null,"html_url":"https://github.com/LukeShirnia/monit","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/LukeShirnia/monit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LukeShirnia%2Fmonit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LukeShirnia%2Fmonit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LukeShirnia%2Fmonit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LukeShirnia%2Fmonit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LukeShirnia","download_url":"https://codeload.github.com/LukeShirnia/monit/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LukeShirnia%2Fmonit/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31951217,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-17T17:29:20.459Z","status":"ssl_error","status_checked_at":"2026-04-17T17:28:47.801Z","response_time":62,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["linux","mmonit","monit","monitoring","python"],"created_at":"2024-11-15T20:25:45.060Z","updated_at":"2026-04-18T00:31:07.488Z","avatar_url":"https://github.com/LukeShirnia.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# monit\n\n`Note:` ONLY WORKS WITH CENTOS AND RHEL\n\n\n\nBasic Monit configuration along with a python script used to check the responsiveness of a local application/website. \n\u003cbr /\u003e\n\nThis uses a combination of monit and python to prevent a continuous loop of restarting the service in the case of an application issue producing a bad error response code\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\n### Example Monit Configuration:\nApply the following configuration to `/etc/monit.d/filename`\n```\ncheck host localhost with address localhost every 2 cycles\n   if failed\n       port 443 protocol https\n       with http headers [Host: test.lazyluke.xyz, Cache-Control: no-cache]\n       and request /\n    then exec \"/home/python/monit_service_check.py\"\n```\n \u003cbr /\u003e\n \n\u003cbr /\u003e\n \n\n## monit_service_check Python Script\n Now use the python script located in this repository as the \"exec\" part of the monit logic.\n\u003cbr /\u003e\n\n### Replace\n##### Replace Part 1 )\nThe python script will attempt to write to `/var/log/monit/service.log`. Find and replace all instance of this path in the file (EXCEPT `open(\"/var/log/messages\")`) with a filename of your choosing and make sure the directory and file exist. \n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\n##### Replace Part 2 )\nThe python script runs a bash curl command (yes, its not ideal to run a bash command). \n\u003cbr /\u003e\n\n\nReplace `https://localhost -H 'Host: test.lazyluke.xyz'` in the following curl command in the python script with the application/website you wish to monitor\n\u003cbr /\u003e\n\n\n \n```\ncurl_response = subprocess.call([\"curl --output /dev/null --silent --head --fail -k --connect-timeout 30 https://localhost -H 'Host: test.lazyluke.xyz'\"], shell=True)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flukeshirnia%2Fmonit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flukeshirnia%2Fmonit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flukeshirnia%2Fmonit/lists"}