Im trying to filter out the dashboard graphs and charts so they dint display SQL memory. I can't seem to find a working querie. Please help.
Hi ckscord if your looking for the SQL Syntax it would look something like this:
WHERE PercentMemoryUsed > '90' AND (Application NOT LIKE 'SQL' OR Application_Secondary NOT LIKE 'SQL')
If this is being used as a SQL Syntax then you would SELECT * FROM Nodes but if you are using this in the SQL Filter part of the Web UI then you might need to just type it as:
PercentMemoryUsed > '90' AND (Application NOT LIKE 'SQL' OR Application_Secondary NOT LIKE 'SQL')
Odd, it worked for me. Best thing to try is to break down the filter.
First Try to validate it in SQL with
SELECT * FROM Nodes
WHERE PercentMemoryUsed > '90' AND (Application NOT LIKE 'SQL' OR Application_Secondary NOT LIKE 'SQL')
Then if that works we know were on the right track.
I would also try editing the widget to tune down the query and make sure all 3 filters work on there own:
PercentMemoryUsed > '90'
Application NOT LIKE 'SQL'
Application_Secondary NOT LIKE 'SQL'
Then try stringing them together. Let me know.
Also might be worth trying: (PercentMemoryUsed > '90') AND (Application NOT LIKE 'SQL' OR Application_Secondary NOT LIKE 'SQL')
It may depend on where you are filling this in... your SQL wildcards will be the % (Percent) sign.
This might work - if the app name does not start with SQL then add a % before SQL...
WHERE PercentMemoryUsed > 90 AND (Application NOT LIKE 'SQL%' OR Application_Secondary NOT LIKE 'SQL%')
or Application <> 'MSSQLSERVER' if you have an exact name, or just a few add an or within the parens()
Thanks everyone for the help. I called over one of my SQL guys over and we got it working with this.
Applications <> 'Exchange - Public Folder' And Applications <> 'Exchange - Hub' And Applications <> 'SQL' And Applications <> 'Exchange - Mailbox Server' And Application_Secondary is NULL or Application_Secondary = 'Oracle' And PercentMemoryUsed > 90
Since NOT is in use, then use AND in place of the OR.
Using OR allows either test to satisfy the rule. Meaning, let's say a node has a primary application SQL and a secondary application KeyServer. The test against Application not like SQL would fail, but Application Secondary not like SQL would succeed, so the node would be accepted. But that's not what we want -- we want the node to not be accepted. The solution is one of the two following:
(PercentMemoryUsed > '90') AND (Application NOT LIKE 'SQL' AND Application_Secondary NOT LIKE 'SQL')
or
(PercentMemoryUsed > '90') AND NOT (Application LIKE 'SQL' OR Application_Secondary LIKE 'SQL')
Both of these will fail if either or both Application or Application secondary is SQL. Personally, since negative comparisons are a bit more costly, I would go with the second since it has one less NOT.
Regards, Eric
SolarWinds solutions are rooted in our deep connection to our user base in the THWACK® online community. More than 195,000 members are here to solve problems, share technology and best practices, and directly contribute to our product development process.