Why does the SQL server agent use XPCommandShell for monitoring the server?
Why would Foglight be using XPCommandShell for monitoring the server?
The SQL Server agent uses xp_cmdshell for two collections:
For the cluster summary, the rule seems to check the status of the cluster For the Config Suggestions, it seems to use the command to look for services that aren't essential for SQL Server, like Clip Book, Computer Browser, Messenger, Network DDE, Task Scheduler, and Schedule Service.
Cluster data can be collected only if the xp_cmdshell parameter is configured.
To configure this parameter, run the following commands:
EXEC sp_configure ‘show advanced options’,1
--To update the currently configured value for advanced options.
—- To enable the feature.
EXEC sp_configure ‘xp_cmdshell’, 1
—- To update the currently configured value for this feature.
Users can disable the DBSS_Cluster_Summary collection to prevent xp_cmdshell from being used. Details on disabling a collection can be found in KB 120521 located here.
The DBSS_Config_Suggestions sql that is the other source of the xp_cmdshell is of an RMI type, meaning that it runs only by demand – when the user enters the Configuration screen explicitly. RMI type collections is not controllable by the user.