[Starlingx-discuss] Script to check mirror health

Cordoba Malibran, Erich erich.cordoba.malibran at intel.com
Wed Jul 25 19:40:58 UTC 2018


Hi all,

I create a script to help with the mirror monitoring. Currently we need
to download the entire mirror to know if something has failed, in 
particular if a package has been updated in the CentOS repositories.

However, it is possible to know if something has changed using the
yum cache, in specific the primary_db files with all the package
information. So, this script iterates over all the content of the
'rpms_from_centos_repos.lst' and uses repoquery to retrieve the
information of that specific package and version. If results are not
found, then it tries to get the information only using the package
name. 

For example, doing :

repoquery --qf '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}' epel-rpm-macros-7-18.noarch

returns no output, however: 

repoquery --qf '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}' epel-rpm-macros

returns:
epel-rpm-macros-7-19.noarch

In this case, epel-rpm-macros needs to be upgraded.

So, for today's execution, this script shows: 

... list of packages...
2018-07-25 19-20-29 ==> INFO: Checking zlib-1.2.7-17.el7.x86_64... OK
2018-07-25 19-20-30 ==> INFO: Checking zlib-devel-1.2.7-7.el7.x86_64...  OK
2018-07-25 19-20-30 ==> INFO: Checking zziplib-0.13.62-5.el7.x86_64... OK
2018-07-25 19-20-31 ==> ERROR: Failures found, error log:
2018-07-25 19-20-31 ==> ERROR: ==========================
Package epel-rpm-macros-7-18.noarch not found, available epel-rpm-macros-7-19.noarch
Package python2-rpm-macros-3-18.el7.noarch not found, available python2-rpm-macros-3-21.el7.noarch
Package python-rpm-macros-3-18.el7.noarch not found, available python-rpm-macros-3-21.el7.noarch
Package python-srpm-macros-3-18.el7.noarch not found, available python-srpm-macros-3-21.el7.noarch


I send a review with this script, please let me know any feedback or comments.

Review: https://review.openstack.org/#/c/585858/

Thanks

-Erich


More information about the Starlingx-discuss mailing list