Skip to content

Commit

Permalink
Merge pull request #59 from decoit/master
Browse files Browse the repository at this point in the history
This commit handles two Error Messages, that can occur
  • Loading branch information
HenriWahl authored Sep 20, 2023
2 parents 8efc30d + dc277c8 commit 1899736
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion agents/plugins/yum
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ LAST_UPDATE_TIMESTAMP=-1


# get current yum state - use cache directory contents as fingerprint
YUM_CURRENT="$(ls -lR /var/cache/{yum,dnf}/)"
YUM_CURRENT="$(ls -lR /var/cache/{yum,dnf}/ 2>/dev/null)"

# check if cached listing of /var/cache/yum already exists - create empty one otherwise
if [ ! -e $CACHE_YUM_UPDATE ]
Expand Down
8 changes: 7 additions & 1 deletion checks/yum
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,15 @@ def check_yum(_no_item, params, info):
security_packages = -1
perfdata = []

# Handle error message on blocking process
# "Tried to run yum for 30 secs but another yum instance was running"
if len(info) == 1 \
and "Tried to run yum for 30 secs but another yum instance was running" == " ".join(info[0]):
yield 3, "Tried to run yum for 30 secs but another yum instance was running"

# Parse the agent output
if len(info) > 0:
reboot_req = info[0][0]
reboot_req = info[0][0]
if not reboot_req in ('yes', 'no'):
reboot_req = ''

Expand Down

0 comments on commit 1899736

Please sign in to comment.