HenriWahl / checkmk-agent-plugin-yum

Checks for updates on RPM-based distributions via yum.
GNU General Public License v2.0
23 stars 22 forks source link

Improve efficiency of code around the yum security updates by only calling the list once and parsing it #68

Open swampdogmash opened 4 months ago

swampdogmash commented 4 months ago

Currently the security update check could take up to 50 seconds to complete, as it runs once to find out if the security update check is possible, then again to capture the info. This also prevents us from checking if any of the lines of output from the security update check as invalid (have seen instances where repos are broken and result in the counting of 2000+ error lines stating the security update is not available). By running the command once and caching the output in a file (or in a variable - paying attention to possible size of such variable and any limits)., it would be more efficient to execute the command once, and check for an error, but capture any non-error output for further assessment. This would be potentially twice as quick, and also permit error checking of the data returned.