WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Improperly fails (reports OK) on RHEL Systems with Unassigned Subscriptions #426

@mfrazier

Description

@mfrazier

When running the Nagios Yum Check Plugin on RHEL systems registered with an entitlement server but without assigned subscriptions, it becomes impossible to check for potential updates. Despite this, yum/dnf will still exit with a status of 0. This issue can occasionally arise when Red Hat representatives misassign or erroneously move subscriptions within an organization.

I have addressed this issue by making a simple change to your check_returncode function and believe that others may benefit from this solution as well. Thank you for your work on this plugin; it has been incredibly useful.

Nagios Plugin for Yum updates on RedHat/CentOS systems - Version 0.12.7
Author: Hari Sekhon

setting plugin timeout to 30 seconds
running command: /usr/bin/yum --security check-update
Returncode: '0'
Output: 'Updating Subscription Management repositories.

This system is registered with an entitlement server, but is not receiving updates. You can use subscription-manager to assign subscriptions.

Last metadata expiration check: 1:48:44 ago on Mon 08 Jul 2024 04:39:59 PM UTC.
'
running command: yum updateinfo
Returncode: '0'
Output: 'Updating Subscription Management repositories.

This system is registered with an entitlement server, but is not receiving updates. You can use subscription-manager to assign subscriptions.

Last metadata expiration check: 1:48:45 ago on Mon 08 Jul 2024 04:39:59 PM UTC.
Updates Information Summary: available
    1 New Package notice(s)
'
YUM OK: 0 Security Updates Available. 0 Non-Security Updates Available | security_updates_available=0 non_security_updates_available=0 total_updates_available=0

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