{"id":19044523,"url":"https://github.com/stdevel/check_repodata","last_synced_at":"2025-04-23T23:27:55.992Z","repository":{"id":21282546,"uuid":"24598507","full_name":"stdevel/check_repodata","owner":"stdevel","description":"A Nagios / Icinga plugin for checking sync states of repositories managed by Spacewalk, Red Hat Satellite 5.x or SUSE Manager","archived":false,"fork":false,"pushed_at":"2017-03-13T07:06:35.000Z","size":82,"stargazers_count":5,"open_issues_count":4,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-18T08:39:31.281Z","etag":null,"topics":["icinga","icinga-plugin","nagios","spacewalk","suse-manager","uyuni"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.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}},"created_at":"2014-09-29T14:28:14.000Z","updated_at":"2019-10-01T13:32:02.000Z","dependencies_parsed_at":"2022-07-27T02:02:09.167Z","dependency_job_id":null,"html_url":"https://github.com/stdevel/check_repodata","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stdevel%2Fcheck_repodata","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stdevel%2Fcheck_repodata/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stdevel%2Fcheck_repodata/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stdevel%2Fcheck_repodata/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stdevel","download_url":"https://codeload.github.com/stdevel/check_repodata/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250531047,"owners_count":21445914,"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":["icinga","icinga-plugin","nagios","spacewalk","suse-manager","uyuni"],"created_at":"2024-11-08T22:46:32.676Z","updated_at":"2025-04-23T23:27:55.974Z","avatar_url":"https://github.com/stdevel.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"check_repodata\n==============\n\n![Example Icinga screenshot](https://raw.githubusercontent.com/stdevel/check_repodata/master/Icinga_Screenshot.png \"Example Icinga screenshot\")\n\n``check_repodata.py`` is a Nagios / Icinga plugin for checking sync states of repositories managed by Spacewalk, Red Hat Satellite 5.x or SUSE Manager. It can assist you detecting outdates repositories and ``taskomaticd`` issues. The script checks file system timestamps and - optionally - YUM repo sync states that are queried using the Spacewalk API. If using this features (*which is the default*) a valid username / password combination to your Spacewalk, Red Hat Satellite or SUSE Manager system is required. The login credentials **are prompted** when running the script. To automate this you have two options:\n\n**1.Setting two shell variables:**\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_repodata.py -l centos6-x86_64\n```\n\n**2.Using an authfile**\n\nA better possibility is to create a authfile with permisions **0600**. 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_repodata.py -a myauthfile -l centos6-x86_64\n```\n\n\n\nParameters\n==========\n\n```\n$ ./check_repodata.py -h\nUsage: check_repodata.py [options]\n\ncheck_repodata.py is used to check repo sync states of content synchronized\nwith Spacewalk, Red Hat Satellite and SUSE Manager. Login credentials are\nassigned using the following shell variables:\nSATELLITE_LOGIN username\nSATELLITE_PASSWORD password\nIt is also possible to create an authfile (permissions 0600) for usage with this\nscript. The first line needs to contain the username, the second line should\nconsist of the appropriate password. If you're not defining variables or an\nauthfile you will be prompted to enter your login information.\nCheckout the GitHub page for updates:\nhttps://github.com/stdevel/check_repodata\n\nOptions:\n  --version             show program's version number and exit\n  -h, --help            show this help message and exit\n  -a FILE, --authfile=FILE\n                        defines an auth file to use instead of shell variables\n  -s SERVER, --server=SERVER\n                        defines the server to use\n  -d, --debug           enable debugging outputs\n  -r, --repodata-only   only checks repodata on file system, skipping Yum sync\n                        state inside Spacewalk\n  -l CHANNELS, --channels=CHANNELS\n                        defines one or more channels that should be checked\n  -e, --all-channels    checks all channels served by Spacewalk, Red Hat\n                        Satellite or SUSE Manager\n  -x CHANNELS, --exclude-channels=CHANNELS\n                        defines channels that should be ignored (in\n                        combination with -e / --all-channels)\n  -w THRESHOLD, --warning-threshold=THRESHOLD\n                        warning threshold in hours (default: 24)\n  -c THRESHOLD, --critical-threshold=THRESHOLD\n                        critical threshold in hours (default: 48)\n  -f, --full-output     displays the names of successfully synchronized\n                        channels\n  -p POSFILTER, --positive-filter=POSFILTER\n                        only channels containing POSFILTER are checked.\n                        POSFILTER is evaluated before NEGFILTER\n                        (in combination with -e / --all-channels)\n  -n NEGFILTER, --negative-filter=NEGFILTER\n                        channels containing NEGFILTER are ignored.\n                        NEGFILTER is evaluated after POSFILTER\n                        (in combination with -e / --all-channels)\n```\n\n\n\nExamples\n========\nCheck sync status for two repositories with default threshold (*warning: 24 hours, critical: 48 hours*). Login information are provided by an authfile ``myauthfile``:\n```\n$ ./check_repodata.py -l centos6-x86_64 -l epel-el6-x86_64 -a myauthfile\nOK: Specified channels (2) are synchronized\n```\n\nCheck sync status for two repositories (*alternative notation*) with custom thresholds, Spacewalk API checks are disabled:\n```\n$ ./check_repodata.py -l \"centos6-x86_64,epel-el6-x86_64\" -r -w 12 -c 24\nWARNING: 1 channel(s) is still syncing or outdated: 'centos6-x86_64'\n```\n\nCheck sync status for all repositories found on the filesystem, full output is enabled displaying all the checked channel names:\n```\n$ ./check_repodata.py -erf\nOK: Specified channels (4) are synchronized: 'centos6-x86_64', 'epel-el6-x86_64', 'centos7-x86_64', 'epel-el7-x86_64'\n```\n\nCheck sync status for all repositories found on the server (*using authfile*) and filesystem, excluding two channels:\n```\n$ ./check_repodata.py -e -a myauthfile -x \"centos7-x86_64,epel-el7-x86_64\"\nOK: Specified channels (2) are synchronized\n```\n\nCheck sync status for all repositories found on the server (*using authfile*) and filesystem, but only centos, and excluding channels containing the string 'test':\n```\n$ ./check_repodata.py -e -a myauthfile -p centos -n test\nOK: Specified channels (4) are synchronized\n```\n\nDebugging repo sync state checks, full output is enabled:\n```\n$ ./check_repodata.py -l epel-el6-x86_64 -df\nOPTIONS: {'authfile': '', 'warningThres': 24, 'criticalThres': 48, 'server': 'localhost', 'channels': ['epel-el6-x86_64'], 'repodataOnly': False, 'debug': True}\nARGUMENTS: []\nDEBUG:  ['epel-el6-x86_64']\nDEBUG: prompting for login credentials\nUsername: admin\nPassword:\n...\nDEBUG: Yum sync difference for channel 'epel-el6-x86_64' is 12 hours\nDEBUG: Difference for /var/cache/rhn/repodata/epel-el6-x86_64/repomd.xml is 12 hours\nERRORS: []\nOK: Specified channels (1) are synchronized: 'epel-el6-x86_64'\n```\n\n\n\nSELinux\n=======\nYou might be receiving ``Unable to read output`` errors by NRPE. Make sure that you're placing the script in the correct Nagios plugins directory and reset the SELinux file context:\n```\n# mv check_repodata.py /usr/lib64/nagios/plugins/check_repodata\n# restorecon -v /usr/lib64/nagios/plugins/check_repodata\nrestorecon reset /usr/lib64/nagios/plugins/check_repodata context unconfined_u:object_r:lib_t:s0-\u003eunconfined_u:object_r:nagios_unconfined_plugin_exec_t:s0\nnagios $ ./check_nrpe -H server -c check_repodata\nOK: Specified channels (2) are synchronized: 'centos6-x86_64', 'epel-el6-x86_64'\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstdevel%2Fcheck_repodata","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstdevel%2Fcheck_repodata","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstdevel%2Fcheck_repodata/lists"}