Skip to content

Commit

Permalink
Merge pull request #80 from swampdogmash/patch-10
Browse files Browse the repository at this point in the history
Incorrect logic assessment of security updates
  • Loading branch information
HenriWahl authored Jul 21, 2024
2 parents 9cf5b4c + 1d42aab commit 7d7feba
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions lib/python3/cmk/base/plugins/agent_based/yum.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,14 +149,10 @@ def check_yum(params: Dict[str, int], section: Section):
yield Result(state=State.OK, summary=f"{section.packages} updates available")
yield Metric(name="normal_updates", value=section.packages)


# Check the status of the returned number of updates that are
# security updates including error condition and if there are no
# updates or the security updates check is not possible

# First check if ANY updates were flagged as security updates
# and report the metric
if section.security_packages >= 0:
# Check the status of the returned number of updates that are security updates including
# error condition and if there are no updates or the security updates check is not possible
# First check if ANY updates were flagged as security updates and report the metric
if section.security_packages > 0:
yield Result(state=State(params.get("security", 0)), summary=f"{section.security_packages} security updates available")
yield Metric(name="security_updates", value=section.security_packages)
# If there are no updates available, report this
Expand Down

0 comments on commit 7d7feba

Please sign in to comment.