2 Replies Latest reply on Mar 16, 2016 1:40 PM by bcmchenryuscis

    Need help with SQL query

    bcmchenryuscis

      First let me say thanks in advance for any help given. I realize everyone's time is important to them. That being said, I have taken a custom query published on these forums as a way to report on outage duration. The query is attached. I would give the person who wrote it credit except I don't know who did   

       

      Report works great and I am calling it directly into a customized page on the custom summary tab of Orion. What I want to do now is to create another tab on that page and create a custom query that will give a search box that let's a user type in a node name and/or ip address, click the search icon and it return the same results as the report attached except just for that single node.

       

      So I went into customize page, created a tab and added custom query resource to the page. Went into Edit on the query and pasted in the attached query you see. Clicked the search box to enable search and re-pasted the query into that box. I tried to modify the last where statement by including an AND with the ${SEARCH_STRING} but my attempts to read up on SQL and understand it are just pitiful. Could someone take a look and see how I could add a way to do this? I thought this would be easy but not for me I just want to be able to search on a node and get returned the results of downtime durations for past 30 days on that node via a search box custom query.

       

      thanks!

       

      Brandon

        • Re: Need help with SQL query
          Craig Norborg

          I believe you have a couple things confused here.   The "Custom Query" resource on a page is for a SWQL query, not a SQL query.    If you want to do something like that you'll need to convert your query to a SWQL query, which from what I'm seeing, might be impossible or at least >very< difficult.  SWQL information can be found here.

           

          Home · solarwinds/OrionSDK Wiki · GitHub

           

          The attachment you gave I believe is for an old-style server-based Report Writer-type report, which definitely only uses SQL.   Not to mention the functions in the query are definitely SQL functions and not SWQL.   The newer web-based reports you can do either SQL or SWQL, but I don't think you can do the "Search" functionality that you would get in the "Custom Query" resource.

           

          Sorry I couldn't be of more help, just too much work to be done here.   But hopefully I got you pointed in the right direction!

            • Re: Need help with SQL query
              bcmchenryuscis

              Thank you for the reply. I had thought it was possible because we set up a search function elsewhere (well someone did who is no longer here) but could be the complexity of this versus what was done elsewhere might not be possible. That being said, will just go with the reporting function I have already.

               

              thanks!