community.sap_operations
community.sap_operations copied to clipboard
check_sapstartsrv of sap_facts.sh could return wrong results
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)