-
Re: Retrieving NodeID from the URL to match in a Custom Table's SQL Statement
njoylifAug 20, 2014 1:43 PM (in response to nhess80)
try NodeID=${NodeID}
-
Re: Retrieving NodeID from the URL to match in a Custom Table's SQL Statement
nhess80 Aug 20, 2014 1:47 PM (in response to njoylif)Already tried that... Keeps giving me query not valid.... Seems like this should be simple to do but cannot figure it out
-
Re: Retrieving NodeID from the URL to match in a Custom Table's SQL Statement
HolyGuacamole Aug 21, 2014 4:17 AM (in response to nhess80)From the admin guide
Note: Web-based reports do not allow the use of variables that are created by preceding a property or database column name with a dollar sign ($) and an open brace ({) and then following it with a close brace (}), as in ${Node.LastBoot}.
So, you will not be able to reference macros in a Custom Table.
You can add a 'Custom Query' resource to a Node Details View, where you should be able to display this information using SWQL (SolarWinds Query Language). SWQL is slightly different from SQL
SELECT Caption FROM Nodes
in SQL
would be
SELECT Caption FROM Orion.Nodes
in SWQL
To show this information just for the node in the node details view, the SWQL would be
SELECT Caption FROM Orion.Nodes WHERE NodeID='${NodeID}'
-
Re: Retrieving NodeID from the URL to match in a Custom Table's SQL Statement
nhess80 Aug 21, 2014 10:45 AM (in response to HolyGuacamole)Thank you for the response. I was confused about the SQL vs SWQL. I tried what you said and just used the query you provided but it just returns all nodes. If I am viewing the details page of Node #1 I don't want it to display anything but Node #1. The query that I ran below displays all nodes no matter which node I am viewing.. Hope that makes sense.. You have definitely helped me take a step in the right direction
SELECT Caption
FROM Orion.Nodes
WHERE NodeID=${NodeID}
-
Re: Retrieving NodeID from the URL to match in a Custom Table's SQL Statement
HolyGuacamole Aug 21, 2014 10:58 AM (in response to nhess80)Are you sure you added that test Custom Query object in a Node Details view? Anyway, I thought you are trying to show the data for a specific custom interface poller in a node details view. If you are happy to see data for all the interface pollers for any given node, there shouldn't be a need to use SQL / SWQL. Simply add a Custom Table resource to your Node Details view. The default selection for the data source is the node you would be looking at (i.e.,NodeID filter will be applied automatically). Simply choose the columns you need to see from the Custom Interface Pollers category of column names.
-
Re: Retrieving NodeID from the URL to match in a Custom Table's SQL Statement
nhess80 Aug 21, 2014 11:12 AM (in response to HolyGuacamole)1 of 1 people found this helpfulI was using a custom table and writing the query in there.. But you are correct, when I added a custom query to the details page it worked as it should.. Do you know why it would work differently with the custom table vs custom query? Thanks again.. now I just need to rewrite my statement a bit so much appreciated
-
Re: Retrieving NodeID from the URL to match in a Custom Table's SQL Statement
nhess80 Aug 21, 2014 12:18 PM (in response to HolyGuacamole)Is there a reason that I am only able to query the Nodes Table or am I wrong. Why does the first query work but the second does not? Thanks
SELECT NodeID
FROM Orion.Nodes
SELECT CustomPollerAssignmentID
FROM Orion.CustomPollerAssignment
-
Re: Retrieving NodeID from the URL to match in a Custom Table's SQL Statement
njoylifAug 21, 2014 3:59 PM (in response to nhess80)
1 of 1 people found this helpfulyou have to look at the SWQL schema docs to figure out how to query correctly....I think...
i.e.:
CustomPollerAssignmentOnNode Orion.NPM.CustomPollerAssignmentOnNode Defined by relationship Orion.NodesHostsCustomPollerAssignmentOnNode (System.Hosting)
-
-
-
-
-
-