Hi ,
We have a few SAM templates defined where we are running Windows Script Monitor. Can someone guide me to the DB table which I can query and find out the exact contents of the Windows Script Monitor?
Thanks,
Arnab
Are you looking for the results or the definition of the Script Monitor? Because they are in two different places.
Hi,
I am looking for the actual script which we are running. Not the results.
Thanks
You can run this to get the scripts:
SELECT [Template].Name AS [Script Type]
,[Setting].[ComponentTemplateID]
,[Setting].[Key]
,[Setting].[Value]
,[Setting].[ValueType]
,[ScriptBody].Setting
FROM [APM_ComponentTemplateSetting] AS [Setting]
INNER JOIN [APM_ComponentTemplate] AS [Template]
ON [Setting].ComponentTemplateID = [Template].ID
INNER JOIN [APM_ExternalSetting] AS [ScriptBody]
ON [Setting].Value = [ScriptBody].ID
AND [Setting].ValueType = 4
WHERE [Setting].[Key] in ( 'ScriptArguments', 'ScriptBody', 'CommandLineToPass' )
And this to get the other values (parameters and such)
SELECT [Template].Name AS [Script Type]
,[Setting].[ComponentTemplateID]
,[Setting].[Key]
,[Setting].[Value]
,[Setting].[ValueType]
-- ,[ScriptBody].Setting
FROM [APM_ComponentTemplateSetting] AS [Setting]
INNER JOIN [APM_ComponentTemplate] AS [Template]
ON [Setting].ComponentTemplateID = [Template].ID
--INNER JOIN [APM_ExternalSetting] AS [ScriptBody]
-- ON [Setting].Value = [ScriptBody].ID
-- AND [Setting].ValueType = 4
WHERE [Setting].[Key] in ( 'ScriptArguments', 'ScriptBody', 'CommandLineToPass' )
There's probably a more elegant way to get this, but this is rough and tumble and should provide most of what you need.
SolarWinds solutions are rooted in our deep connection to our user base in the THWACK® online community. More than 150,000 members are here to solve problems, share technology and best practices, and directly contribute to our product development process.