{"id":17982387,"url":"https://github.com/zamentur/yunomonitor","last_synced_at":"2025-03-25T19:31:03.687Z","repository":{"id":82032418,"uuid":"195076694","full_name":"zamentur/yunomonitor","owner":"zamentur","description":"Easy monitoring for YunoHost","archived":true,"fork":false,"pushed_at":"2023-01-05T18:04:14.000Z","size":316,"stargazers_count":6,"open_issues_count":5,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-02-14T18:31:04.388Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zamentur.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":"2019-07-03T15:01:15.000Z","updated_at":"2024-04-10T18:28:56.000Z","dependencies_parsed_at":null,"dependency_job_id":"1d19b03f-ad59-44e9-8605-ff3a9110235f","html_url":"https://github.com/zamentur/yunomonitor","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zamentur%2Fyunomonitor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zamentur%2Fyunomonitor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zamentur%2Fyunomonitor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zamentur%2Fyunomonitor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zamentur","download_url":"https://codeload.github.com/zamentur/yunomonitor/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245530099,"owners_count":20630495,"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":[],"created_at":"2024-10-29T18:14:08.309Z","updated_at":"2025-03-25T19:31:03.680Z","avatar_url":"https://github.com/zamentur.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# yunomonitor\nEasy monitoring for YunoHost\n\n## Features\nThis script allow you to monitor easily your servers. You can check outside the server to monitor:\n* Ping of domains you use in your servers\n* Availibility of your web app (HTTP 200 answer)\n* TLS certificate correctly renewed\n* Resolver DNS are up\n* DNS are well configured\n* All mail things are ok (SMTP, IMAP, Blacklist)\n* XMPP is working\n\nAnd inside the server to monitor:\n* DNS resolution is correctly done\n* Services are up\n* Health of your hard drive disk\n* Free space available\n* Backup are correctly done\n\nIf you are using YunoHost, all this things are configured automatically from the configuration of the YunoHost to monitor.\n\nThis script supports ipv4 and ipv6.\n\nIt is extensible to add other kind of checks plugin and other kinds of actions (alert) plugin.\n\n## Usage\nOn the server to monitor:\n```\n*/8 * * * * some_user python3 yunomonitor.py -e MONITORING_SERVER [...]\n```\n\nOn the monitoring server:\n```\n*/8 * * * * some_user python3 yunomonitor.py [SERVER_TO_MONITOR ...] [-m MAIL [MAIL ...]] [-s URL_SMS] [-c URL_CACHET]\n```\n\n## Dependencies\n\nThis script is designed to run with these dependencies:\n* python3-yaml\n* python3-dnspython\n* python3-requests-toolbelt\n* python3-spf\n* whois\n* an SMTP server running on the machine\n\nIf you want to use the autoconfiguration mechanism, you need to configure on nginx a HTTPS `.well-known/yunomonitor/` path. You need also in this case to have on monitoring server a ssh key on /etc/ssh/ssh_host_rsa_key\n\n## Checks\nHere is a list of all checks methods. Each method return a list of small messages that describe errors append.\n\n### ping\nNO_IPV4_PING: \nNO_IPV6_PING:\n\n### ip_address\nC_DOMAIN_UNCONFIGURED\nC_DOMAIN_UNCONFIGURED_IN_IPV4\nI_DOMAIN_UNCONFIGURED_IN_IPV6\n\n### tls(ip_address)\nE_CERT_RENEWED_FAILED\nC_CERT_INVALID\nC_PORT_CLOSED_OR_SERVICE_DOWN\n\n### https_200(tls)\nC_TIMEOUT, ip, msg:\nC_TOO_MANY_REDIRECTS, ip, msg:\nC_SSO_CAPTURE:\nC_UNKNOWN_ERROR, ip, msg:\nC_HTTP_XXX, msg:\n\n### domain_renewal\nI_DOMAIN_EXPIRATION_NOT_FOUND\nW_DOMAIN_WILL_EXPIRE\nE_DOMAIN_NEARLY_EXPIRE\nC_DOMAIN_EXPIRE\n\n### dns_resolver\nC_BROKEN_NAMESERVER\nC_TIMEOUT\nC_DOMAIN_UNCONFIGURED\nC_NO_ANSWER\nC_UNEXPECTED_ANSWER\n\n### smtp\nE_NO_MX_RECORD\nC_DOMAIN_UNCONFIGURED\nC_REVERSE_MISSING\nC_REVERSE_MISMATCH\nC_BLACKLISTED\nE_CERT_RENEWED_FAILED\nC_PORT_CLOSED_OR_SERVICE_DOWN\n\n### imap\n### pop\n### xmpp\n### dns_resolution(dns_resolver)\n### service_up\nC_NOT_FOUND\nC_DOWN\nC_FAILED\n\n### disk_health\nW_SMART_NOT_SUPPORTED\nE_SMART_DISABLED\nE_SMART_HALF_WORKING\nC_DISK_FAILURE\n\n### free_space\nC_FREE_SPACE\nE_FREE_SPACE\nW_FREE_SPACE\n\n### backuped\nE_NEVER_BACKUP\nE_MISSING_BACKUP\nE_BACKUP_NOT_TRIGGERED\nE_BACKUP_BROKEN\n\n### ynh_upgrade\nW_APP_NEED_UPGRADE\nW_PKG_NEED_UPGRADE\n\n## Alerts\n### Mail alerts\nThis module send one email by failures checks.\n\n### SMS alerts\nThis module send a condensate  of all failures on all servers in one sms (sms apis are rarely free).\n\n### Cachet update\nThis module update components in cachet and open incident with information that could be shown publicly.\n\n## Why this script is in one file ?\nBecause in some case, I need to deploy it quickly. An unique file is simple.\n\nI have analyzed solution like nagios and zabbix, and these tools are very powerfull, but the cost to deploy and configure it is to high for my objective to deploy YunoHost with monitoring and backup automatically.\n\n## Bypass automatic configuration tools\nYou can create a configuration file that will be used instead of the one generated by placing it in /etc/yunomonitor/DOMAIN.conf\n\n```\nping:\n    - some.domain.tld\n    - other.domain.tld\nhttps_200:\n    - wikipedia.org\n    - your.website.org\ndns_resolver:\n    # Your favorite DNS resolver which you want to check is up\n    - 11.22.33.44\n    - 66.77.88.99\nfree_dns_service:\n    # Will test that a specific resolver correctly resolves a specific domain\n    - [ 'your.resolver.org', 'some.somain.tld', '12.34.56.78' ]\ndisk_health: True\nfree_space:\n    warning: \n    danger: \n__components__:\n    - id: nextcloud__2\n      name: Nextcloud\n      label: Projet Vert\n      uris: \n          - other.domain.tld/\n      services:\n          - nginx\n    - id: borg\n      name: BorgBackup\n      label: Sauvegarde 1\n      backup: all\n      uris:\n      services:\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzamentur%2Fyunomonitor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzamentur%2Fyunomonitor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzamentur%2Fyunomonitor/lists"}