{"id":13501781,"url":"https://github.com/stdevel/check_katello_sync","last_synced_at":"2025-04-23T23:28:09.839Z","repository":{"id":79816724,"uuid":"89724681","full_name":"stdevel/check_katello_sync","owner":"stdevel","description":"A Nagios / Icinga plugin for checking product synchronization within Katello/Red Hat Satellite 6.x","archived":false,"fork":false,"pushed_at":"2023-11-13T10:42:11.000Z","size":33,"stargazers_count":7,"open_issues_count":3,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-18T07:52:13.655Z","etag":null,"topics":["foreman","icinga","icinga-plugin","icinga2","icinga2-plugin","katello","satellite","satellite6","system-information"],"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/stdevel.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-04-28T16:30:55.000Z","updated_at":"2023-11-08T14:24:48.000Z","dependencies_parsed_at":null,"dependency_job_id":"79b3cd4b-37e5-401b-8580-c7091fba9a9b","html_url":"https://github.com/stdevel/check_katello_sync","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stdevel%2Fcheck_katello_sync","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stdevel%2Fcheck_katello_sync/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stdevel%2Fcheck_katello_sync/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stdevel%2Fcheck_katello_sync/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stdevel","download_url":"https://codeload.github.com/stdevel/check_katello_sync/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250531087,"owners_count":21445924,"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":["foreman","icinga","icinga-plugin","icinga2","icinga2-plugin","katello","satellite","satellite6","system-information"],"created_at":"2024-07-31T22:01:50.126Z","updated_at":"2025-04-23T23:28:09.802Z","avatar_url":"https://github.com/stdevel.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# check_katello_sync\n`check_katello_sync` is a Nagios/Icinga plugin for checking product synchronization within Katello/Red Hat Satellite 6.x. It also supports performance data, enabling visualizing results with tools such as Grafana.\n\nThe script checks the synchronization of one or multiple product of an organization.\n\nTo gather information a valid username / password combination to your management system is required. The login credentials **are prompted** when running the script. To automate this you have two options:\n\n## Setting shell variables\nThe following shell variables are used:\n* **SATELLITE_LOGIN** - a username\n* **SATELLITE_PASSWORD** - the appropriate password\n\nYou might also want to set the HISTFILE variable (*depending on your shell*) to hide the command including the password in the history:\n```\n$ HISTFILE=\"\" SATELLITE_LOGIN=mylogin SATELLITE_PASSWORD=mypass ./check_katello_sync.py -s giertz.stankowic.loc\n```\n\n## Using an authfile\nA better possibility is to create a authfile with permisions **0600** or **0400**. Just enter the username in the first line and the password in the second line and hand the path to the script:\n```\n$ ./check_katello_sync.py -a giertz.auth -s giertz.stankowic.loc\n```\n\n# Requirements\nThe plugin requires Python 2.6 or newer - it also requires the `requests` and `simplejson` modules.\nThe plugin requires API version 2 - the script checks the API version and aborts if you are using a historic version of Foreman/Katello.\n\n# Usage\nBy default, the script checks the synchronization of all products of an particular organization. It is possible to control this behaviour by specifying additional parameters (*see below*).\nThe script also support performance data for data visualization.\n\nThe following parameters can be specified:\n\n| Parameter | Description |\n|:----------|:------------|\n| `-h` / `--help` | shows help and quits |\n| `-d` / `--debug` | enable debugging outputs (*default: no*) |\n| `-P` / `--show-perfdata` | enables performance data (*default: no*) |\n| `-a` / `--authfile` | defines an auth file to use instead of shell variables |\n| `-s` / `--server` | defines the server to use (*default: localhost*) |\n| `--insecure` | Disables SSL verification (*default: no*) |\n| `-o` / `--organization` | specifies the organization to check (*name or ID*) |\n| `-w` / `--outdated-warning` | defines outdated products warning threshold in days (*default: 2*) |\n| `-c` / `--outdated-critical` | defines outdated products critical threshold in days (*default: 5*) |\n| `-i` / `--include` | specifies particular products to check (*default: no*) |\n| `-e` / `--exclude` | specifies particular products to ignore (*default: no*) |\n\n## Examples\nThe following example checks all products of an particular organization on a Foreman/Katello server:\n```\n$ ./check_katello_sync.py -s st-katello01.stankowic.loc -o Stankowic\nSatellite Username: admin\nSatellite Password:\nCRITICAL: Products outdated more than 5 days: Stankowic_Puppet. Products outdated up to 2 days: Stankowic_Docker. Products synchronized: owncloud-el7-x86_64, katello-client-el7-x86_64, icinga2-el7-x86_64, grafana-el7-x86_64, gitlab-ci-el7-x86_64, EPEL_7_x86_64, CentOS_7_x86_64 |\n```\n\nIgnoring some products synchronized manually, authentication using authfile:\n```\n$ ./check_katello_sync.py -s st-katello01.stankowic.loc -a giertz.auth -o Stankowic -e Stankowic_Puppet -e Stankowic_Docker\nOK: Products synchronized: owncloud-el7-x86_64, katello-client-el7-x86_64, icinga2-el7-x86_64, grafana-el7-x86_64, gitlab-ci-el7-x86_64, EPEL_7_x86_64, CentOS_7_x86_64 |\n```\n\nOnly checking some particular products, enabling performance data:\n```\n$ ./check_katello_sync.py -s st-katello01.stankowic.loc -a shittyrobots.auth -o Stankowic -i gitlab-ci-el7-x86_64 -P\nOK: Products synchronized: gitlab-ci-el7-x86_64 | 'prod_total'=9;;;; 'prod_warn'=0;2;2;; 'prod_crit'=0;5;5;;\n```\n\nThe same, specifying custom thresholds:\n```\n$ ./check_katello_sync.py -s st-katello01.stankowic.loc -a pinkepank.auth -o Stankowic -i gitlab-ci-el7-x86_64 -P -w 2 -c 4\nOK: Products synchronized: gitlab-ci-el7-x86_64 | 'prod_total'=9;;;; 'prod_warn'=0;2;2;; 'prod_crit'=0;4;4;;\n```\n\n# Installation\nJust deploy the Python script on your Icinga host or node. This repository also includes a [NRPE](check_katello_sync.cfg) and [Icinga2 configuration](check_katello_sync-icinga2.conf). If you're using a RPM-based Linux distro, you can use the [RPM spec file](nagios-plugins-katello-sync.spec) to create a RPM pacakge.\n\n## Icinga2 configuration idea\nI'm using the following snippet to check the products of my Foreman/Katello servers:\n\n```\napply Service \"DIAG: Katello product synchronization\" {\n  import \"generic-service\"\n  check_command = \"check_katello_sync\"\n  vars.katello_perfdata = true\n  vars.katello_host = \"st-katello01.stankowic.loc\"\n  assign where host.vars.os == \"Linux\" \u0026\u0026 host.vars.app == \"katello\"\n  ignore where host.vars.noagent\n}\n```\n\nSystems running the Foreman/Katello application (*implemented by the vars.app tag*) will be checked. Make sure the particular host configuration contains an authfile and organization:\n```\nobject Host \"st-katello01.stankowic.loc\" {\n  import \"linux-host\"\n...\n  vars.app = \"katello\"\n  vars.katello_authfile = \"/usr/lib64/nagios/plugins/katello.auth\"\n  vars.katello_organization = \"Stankowic\"\n```\n\nThe authfile needs to have file permissions **0600** or **0400** and should be owned by the ``icinga`` user:\n```\n# chmod 0600 /usr/lib64/nagios/plugins/katello.auth\n# chown icinga: /usr/lib64/nagios/plugins/katello.auth\n```\n\nTo include or exclude products, you can utilize the **products_include** or **products_exclude** variables. When using the include variable, only defined products will be checked. Specifying the exclude variable will check all products except those mentioned in the variable.\n\nTo exclude particular products, alter your configuration like this:\n```\n  vars.products_exclude = [\"Stankowic_Docker\", \"Stankowic_Puppet\"]\n```\n\nTo only check particular products, use this one:\n```\n  vars.products_include = [\"CentOS_7_x86_64\"]\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstdevel%2Fcheck_katello_sync","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstdevel%2Fcheck_katello_sync","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstdevel%2Fcheck_katello_sync/lists"}