Closed m3rlinux closed 3 years ago
Hi, thanks for contributing.
I tested but i am not sure if it works as expected. I just replaced the agent yum file on a CentOS7 host which instead of the former
<<<yum>>>
no
0
gives this output, which leads to UNKNOWN:
<<<yum>>>
/var/cache/yum/:
total 0
drwxr-xr-x. 3 root root 14 Nov 4 2015 x86_64
/var/cache/yum/x86_64:
total 4
drwxr-xr-x. 14 root root 4096 Jul 6 03:45 7
/var/cache/yum/x86_64/7:
total 36
drwxr-xr-x. 4 root root 31 May 18 2016 base
....
Could you try to remove cache files and run the script again?
rm -f /var/lib/check_mkagent/cache/yum*
EDIT: The problem is due the fact that you store yum information instead of check results in yum_state.cache file Unfortunately if there isn't updates the script don't update this file so you have to delete it manually.
Could you try to remove cache files and run the script again?
rm -f /var/lib/check_mkagent/cache/yum*
This works, yes.
EDIT: The problem is due the fact that you store yum information instead of check results in yum_state.cache file Unfortunately if there isn't updates the script don't update this file so you have to delete it manually.
Well, this information was used as a kind of hash to find if there was anything new available. So if there where new updates there was no need to do anything.
The resulting state is UNKNOWN anyway - do I need to update the server side too?
Edit: I see there is no server side change.
Edit 2: The agent output contains the file listing again:
<<<yum>>>
/var/cache/yum/:
total 0
drwxr-xr-x. 3 root root 14 Nov 4 2015 x86_64
/var/cache/yum/x86_64:
total 4
drwxr-xr-x. 14 root root 4096 Jul 6 03:45 7
/var/cache/yum/x86_64/7:
total 36
drwxr-xr-x. 4 root root 31 May 18 2016 base
drwxr-xr-x. 4 root root 4096 Jul 6 03:45 epel
...
The first attempt works, but the second gives the file listing again.
Maybe it is a good idea to store the results of your improved version in some other files to avoid this mess when upgrading from the old to the new version?
Maybe it is a good idea to store the results of your improved version in some other files to avoid this mess when upgrading from the old to the new version?
Maybe yes! I pushed a new commit with a refactoring of variable and file
Way better:
<<<yum>>>
no
0
0
<<<yum:cached(1625580465,600)>>>
no
0
invalid check cache file
Looks very good at all, no more UNKNOWN states! :+1:
Resolve #40