SUP-20798: fixes shebang, HOMEDIR grep, su shell, if -ne typo
General information
I am Checkmk employee.
The mk_db2.aix agent plugin did not work on a recent AIX 7.2
During a session with a customer we were able to make it work again.
We found and fixed around 3 problems. One of them is a typo in a if statement that was in the code since 2015.
Bug reports
- OS AIX 7.2 on power architecture
- See SUP-20798 for details
Proposed changes
Please just have a look into a side by side diff.
-
Line 1 ksh93 seems to be more current than ksh
-
Line 68 tried to extract the user home directory. The grep at the end does not make sense, it assumes that the homedir also contains the instancename/username which is not always the case. I made the first grep more specific with -w and also adding the colon : to not to match users that contain the value of $INSTANCE as substring.
-
Line 72, we added to - because this gives a completer environment, a login environ. I this case the $INSTANCE users SHELL is csh. csh is very limited and can not interpret the code in the EOT block. Therefore we let the EOT heredocument block run also in ksh93.
- Line 102 was obviously a typo
Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.
I have read the CLA Document and I hereby sign the CLA or my organization already has a signed CLA.
You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.
If accepted please also pick this into 2.3.0 and 2.2.0
This PR is stale because it has been open for 14 days with no activity and the Github Actions are not passing.
This PR was closed because it has been inactive for 14 days since being marked as stale.
@mo-ki could you please have a look at this change?