Skip to content

Commit 1899736

Browse files
authored
Merge pull request #59 from decoit/master
This commit handles two Error Messages, that can occur
2 parents 8efc30d + dc277c8 commit 1899736

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

agents/plugins/yum

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ LAST_UPDATE_TIMESTAMP=-1
1515

1616

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

2020
# check if cached listing of /var/cache/yum already exists - create empty one otherwise
2121
if [ ! -e $CACHE_YUM_UPDATE ]

checks/yum

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,15 @@ def check_yum(_no_item, params, info):
5959
security_packages = -1
6060
perfdata = []
6161

62+
# Handle error message on blocking process
63+
# "Tried to run yum for 30 secs but another yum instance was running"
64+
if len(info) == 1 \
65+
and "Tried to run yum for 30 secs but another yum instance was running" == " ".join(info[0]):
66+
yield 3, "Tried to run yum for 30 secs but another yum instance was running"
67+
6268
# Parse the agent output
6369
if len(info) > 0:
64-
reboot_req = info[0][0]
70+
reboot_req = info[0][0]
6571
if not reboot_req in ('yes', 'no'):
6672
reboot_req = ''
6773

0 commit comments

Comments
 (0)