community.sap_operations icon indicating copy to clipboard operation
community.sap_operations copied to clipboard

check_sapstartsrv of sap_facts.sh could return wrong results

Open RonnyFiebigDVTS opened this issue 1 year ago • 0 comments

Background

If an instancenumber is any given number below 60 and the sapstartsrv is restarted in the last hour the function check_sapstartsrv could return wrong values because part of the grep command could address the runtime instead of the instancenumber of the SAP SID

Problem in file sap_facts.sh in function check_sapstartsrv on line 289

Solution

Change:

SAPSTARTSRV=$(ps -ef | grep $2 | grep $3 | grep sapstartsrv | wc -l)

To:

SAPSTARTSRV=$(ps -eo cmd | grep $2 | grep $3 | grep sapstartsrv | wc -l)

RonnyFiebigDVTS avatar Nov 08 '23 09:11 RonnyFiebigDVTS