cancel
Showing results for 
Search instead for 
Did you mean: 
Create Post
Level 8

Custom Query (Notes View with Node Names)

Hi everyone,

I needed some help with a custom query that would show Notes as well as Node Names next to one another. I haven't touched SWQL queries in a while. The Snapshot below is the query that I currently have and the output it is giving me. I would like to the Node name side by side with the Notes that I have inputted. The above blue lines are due to not every Node having Notes. 

pastedImage_1.png

Output:

pastedImage_0.png

0 Kudos
8 Replies
Level 8

Where is this "notes" field coming from ? Is that a custom property?

0 Kudos

yes

0 Kudos
Level 15

you might move away from the custom query and make a legacy report using the Report Writer app on your server.

SELECT

  Caption

  ,Notes

FROM Nodes

WHERE Notes <> '' AND Notes IS NOT NULL

ORDER BY Caption

(If you want to see all devices, including those without notes, remove the "WHERE" line)

Unless of course you are needing to parse in the ${NodeID} variable?

-ZackM

Loop1 Systems: SolarWinds Training and Professional Services

0 Kudos

So I created a new Advanced SQL report with the information given above and the preview was exactly what I needed but, I received an error upon saving the report. Message said, "Detected usage of a macro, which links to a nonexistent field in the report. Therefore WebURL, which uses this macro, will not be generated correctly. Missing filed: NodeID." I checked Orion NPM and report was not there.

0 Kudos

The error message is benign - just means there is no NodeID column in the report columns. Anyway, what is the need for an Advanced SQL report here? If you are on NPM v10.7, you can add a Custom Table resource and simply select the Caption and Notes columns. Alternatively, you can build a report from the Legacy Report writer and select the NodeID, Caption and Notes columns using the report designer and finally show that in a dashboard by adding a 'Report from Report Writer' resource.

That means that you don't have a nodeid in your data to apply to a details view option for the devices. When you're editing your table, just remove the detail summary view (I think that's what they call it) option from the caption column.

Alternatively, there was a thread a while back where someone found a little work around to still use the details view with a custom SQL report in the web report writer. Re: Node Details URL in custom SQL Report

EDIT:

If you're using the old Report Writer app on the server, then just change your report to this:

SELECT 

NodeID

,Caption 

,Notes 

FROM Nodes 

WHERE Notes <> '' AND Notes IS NOT NULL 

ORDER BY Caption

Then, on your formatting, hide the NodeID field. That should fix your error.

Thanks. I figured out the mistake I was making. I did not need to add NodeID, I just saved the Report in the wrong directory. I also was able to add the Report as a resource so that I can have it on our home page. To do so you go to Add Resource and select Report from Orion Report Writer. You edit it to only show a single Report and then add it to your desired page. Just FYI.

1.PNG

2.PNG

0 Kudos

Yup. That's it.

p.s: You may want to download Greenshot for editing screenshots.

0 Kudos