Skip to content

Expired repository metadata always results in CRITICAL state #5

@danci1973

Description

@danci1973

Sometimes zypper lu comes back with a warning that metadata of a repository expired:

# zypper ref
Repository 'Main Repository (NON-OSS)' is up to date.
Repository 'Update Repository (Non-Oss)' is up to date.
Repository 'Main Repository (OSS)' is up to date.
Repository 'Main Update Repository' is up to date.
Repository 'Update repository of openSUSE Backports' is up to date.
Retrieving repository 'Update repository with updates from SUSE Linux Enterprise 15' metadata ........................................................................................................................................[done]
Building repository 'Update repository with updates from SUSE Linux Enterprise 15' cache .............................................................................................................................................[done]                                       
All repositories have been refreshed.

# zypper lu
Loading repository data...
Warning: Repository 'Main Update Repository' metadata expired since 2024-02-07 10:23:56 CET.

    Warning: Repository metadata expired: Check if 'autorefresh' is turned on (zypper lr), otherwise
    manually refresh the repository (zypper ref). If this does not solve the issue, it could be that
    you are using a broken mirror or the server has actually discontinued to support the repository.

Reading installed packages...
No updates found.

Apparently this should only be a warning as it can happen if there were no updates published in the last 30 days (or some other expiration period).

Expected behavior

At least with using '-o' option this should result in an OK or WARNING state.

Current behavior

Currently check_zypper always returns CRITICAL state:

/usr/lib/nagios/plugins/check_zypper -r -s -w security
Updates CRITICAL : Repository Main Update Repository metadata expired since 2024-02-07 10:23:56 CET.

/usr/lib/nagios/plugins/check_zypper -o -r -s -w security
Updates CRITICAL : Repository Main Update Repository metadata expired since 2024-02-07 10:23:56 CET.

Steps to reproduce

Reproducing this is a bit hit and miss as it depends on the state of enabled repositories.

check_zypper version

/usr/lib/nagios/plugins/check_zypper --version
check_zypper v1.98.10

Environment

OpenSuSE LEAP 15.5 (this has been observed on 15.4 as well)

Installed with zypper:

Name        : monitoring-plugins-zypper
Version     : 1.98.10
Release     : bp155.3.6.1
Architecture: noarch
Install Date: tor 06 feb 2024 07:57:40
Group       : System/Monitoring
Size        : 48874
License     : BSD-3-Clause
Signature   : RSA/SHA512, tor 11 jul 2023 09:21:05, Key ID 8a49eb0325db7ae0
Source RPM  : monitoring-plugins-zypper-1.98.10-bp155.3.6.1.src.rpm
Build Date  : tor 11 jul 2023 09:20:58
Build Host  : lamb76
Relocations : (not relocatable)
Packager    : http://bugs.opensuse.org
Vendor      : openSUSE
URL         : https://github.com/lrupp/monitoring-plugins-zypper
Summary     : Check for software updates via zypper

Logfile

Unfortunately as I was writing this, the repository updated and now I no longer get the same result - so log is probably irrelevant.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions