matteocorti / check_updates

check_updates is a Nagios plugin to check if RedHat or Fedora system is up-to-date
https://matteocorti.github.io/check_updates/
GNU General Public License v3.0
20 stars 18 forks source link

Use of uninitialized value $ENV{"HOME"} on Alma Linux 9 #57

Closed SMillerDev closed 1 year ago

SMillerDev commented 1 year ago

Describe the bug

Running the check through Icinga on Alma Linux 9, the output contains an issue:

Use of uninitialized value $ENV{"HOME"} in concatenation (.) or string at /usr/lib64/nagios/plugins/check_updates line 1108.
CHECK_UPDATES CRITICAL - 1 security update and 1 non-security update available 
c-ares.x86_64 (security)
telegraf.x86_64

To Reproduce

Have a user without a $HOME set and run the plugin

Expected behavior Output without the error, such as:

CHECK_UPDATES CRITICAL - 1 security update and 1 non-security update available 
c-ares.x86_64 (security)
telegraf.x86_64

System (please complete the following information):

Additional context/output

If I run the command manually this problem does not occur. It seems Icinga suppresses $HOME, which I'm not sure is needed for this plugin anyway.

SMillerDev commented 1 year ago

Wow, that is an incredibly fast response and fix. Thanks a lot @matteocorti !

matteocorti commented 1 year ago

Thanks for the report. I just released version 2.0.4.