This discussion has been locked. The information referenced herein may be inaccurate due to age, software updates, or external references.
You can no longer post new replies to this discussion. If you have a similar question you can start a new discussion in this forum.

Need Help Creating Report

Management is asking for a report with the following items.  I am able to get each item at a point in time, but I need an automated process to allow me to trend over time and pull historical data.

TotalServers - (I get this out of Orion by doing a count(distinct caption) on Nodes

New Servers - (I get this out of Orion by using the following query:

          count(n.Caption)  [NodeName]

          FROM  dbo.Nodes  n

          INNER JOIN   dbo.Events e

          INNER JOIN   dbo.EventTypes  et

          ON e.EventType = et.EventType

          ON n.NodeID = e.NetworkNode


          et.Name = 'node added' AND

          e.EventTime >= DATEADD(MONTH,datediff(MONTH,0,getdate())-1,0)        AND

          e.EventTime < DATEADD(MONTH,datediff(MONTH,0,getdate()),0)

DecomServers (This is done by using the following formula:

     (LastMonthTotal + LastMonthNew – ThisMonthTotal) = Decoms

So, I'm looking for suggestions / help on how I should get this done.

1.  I'm thinking a new table with a stored proc to calculate the data and put it in the 1st of each month.  To avoid possibly breaking SLA, I have a new blank database created that I can put the table in.  But I don't know where to begin for the stored proc.  (I am not a SQL guy.  Just a server admin trying to make management happy)

2.  If anyone has a better solution on how to do this, I would be greatly appreciative.

Ultimately, what I want is, the 1st of each month

- Tell me how many TotalServers.  Add it to a row for the current month

- Calculate the new servers for the previous month.  Add it to last month's row

- Calculate the decoms for the previous month.  Add it to last month's row

  • If you have SAM, you could do 3 SQL queries in the same app giving you these three results and would track them historically for you.

  • I have two of the monitors set up as the data is directly from the database.  The last query has to use the data from the first two.  Any idea how to make this happen?

  • Just realized I was doing this the hard way.  Instead of doing the math, I can just key off of Node Removed events.

    Thanks for the help.

    On another note, any way to rename the SQL Server User Experience monitor so I can tell them apart by name?

  • Sure, edit application, select the one to rename and click rename per image below...

    note - if greyed out, you'll need to do it at the template level or in the DB directly.

    sql rename.PNG

  • Thanks.  I was trying it at the wrong level.  Had to go back to the template.

  • Any idea what table the data is stored in?  Trying to create a report, but if I use the GUI, I only get the option of rolling it up to 7 days, whereas management wants a monthly report.  I found the component_currentstatus table that has the most recent entries.  I also found the detail table that has the availability and the timestamps of each collection, but I can't find the data for each collection.

  • not sure where you are trying to go with it...

    what historical info are you looking for?  for the SQL checks you set up above, probably?

    depending on your data retention settings, the data could be in one of several tables; for any given type of object (node,app,component,volume,int,etc.)

    then you've got the status (up/down) vs. statistical data returned which is going to be different for each type of check (powershell,sql,perl,dns,etc.)

    this is a great opportunity to learn the DB and it can be overwhelming.   I think the query results will be in APM_DynamicEvidence* tables (hourly,detail,daily,etc.)

    Truly, your best bet is to figure out how to do it in GUI report section.  Can you post screenshot of where you are being limited to 7 days?  and/or upload the report?

  • I can't upload the report due to security blocking uploads, but below is what I was referring to.  The sample interval stops at 7 days.  There is no monthly option.

    pastedImage_0.png

  • That looks like the data sample interval.  set it to every hour and see what you get.

  • I want to go the other way with it though.  I only want data points at 1 month.  Data shows up when I use 7 days, but I can't provide a monthly report.  Which is why I was trying to find the raw data and build my own SQL query to give me the data per month.