I recently encountered a situation where an otherwise functioning SCOM agent on a Linux server would not execute shell scripts to run discoveries or monitors. The problem turned out to be an incorrect configuration in /etc/opt/microsoft/scx/conf/scxrunas.conf, which controls the execution of the following extrinsic methods:
SCX_OperatingSystem.ExecuteCommand()SCX_OperatingSystem.ExecuteShellCommand()SCX_OperatingSystem.ExecuteScript()
In my situation, the configuration file contained the following, which was preventing the above methods from running with elevated privileges:
AllowRoot=false
Clearing this file and restarting the agent resolved the problem.