cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Schedule DMI Report Hourly

prufe
Contributor

There is a DMI-Report I would like to run every hour and save to a physical drive (no email).  How can this be done?

28 REPLIES 28

Would using Procmail be an option to to process hourly emails with reports as attachments? There is a way to extract attachments and save the to desired location. http://blog.lundscape.com/2009/10/extract-email-attachments-with-procmail-and-munpack/

I know you wrote "no email" but there does not seem to be other option at the moment. 

adam_piotrowicz
Dynatrace Pro
Dynatrace Pro

Patrick,

There is no problem doing that.

Just create tasks-110-reprots.xml file in C:\Program File\Compuware\CAS\config directory and fill it with:

tasks-110-reports.xml



adlex.delta.scheduler.command.ReportCommand
http://CAS_IP/LSSaveAs?lsAction=Saveas&format=txt&lsEntryName=My-Report-1
C:\Reports\My-Report-1.txt




adlex.delta.scheduler.command.ReportCommand
http://CAS_IP/LSSaveAs?lsAction=Saveas&format=pdf&lsEntryId=254
C:\Reports\My-Report-2.pdf


This task consists of two commands, each of commands generates and saves to HD different DMI reprot.

You need to change:

offsetTime - how many minutes after full hour the report will be executed,

CAS_IP - IP or hostname of the CAS,

format - the format of the report output: txt, pdf or mht,

lsEntryName or lsEntryId - the name or ID of the reprot saved in DMI.

The last param sets the location and name of saved report.

I am going to give the tasks-110-reports.xml a try.  

 

Is there a way that I can save each dmi report using a timestamp as the report name?  Basically, we don't want to delete the previous report and we want the timestamp as the name.  

Hi Patrick

Why do you need a file every hour?

If the driver behind this is a need to feed some other tool then there are better options.

Hi Ulf,

For this use case, I was able to create the report I needed.  I am curious what you mean by there are better options for feeding other tools.  Could you please explain more?

Patrick,

If you're on latest 12.1 or 12.2 you then you should be able to use [timestamp] and [datetime] tags in local file name.

If you not I will provide you with bat script that will do it as another command in the task.

If we want to run the report 5 minutes after the hour, would it look like 05:00 or 00:05?

Also, could you give me an example to add the timestamp or datetime tags to the local file name?  Would it get added to the following param?     <param>C:\Reports\report.txt</param>  

Use 00:05 and:

C:\Reports\report[timestamp].txt
 

Adam,

The task is now scheduled and runs at every hour as it should.  The problem is, no data is being returned in the reports.  Below is what the report comes out as.

Patrick,

Could you verify is adding formatDiscover=direct to the URL changes this behavior:

http://CAS_IP/LSSaveAs?lsAction=Saveas&format=txt&formatDiscover=direct&lsEntryName=My-Report-1

If not please change the format parameter and file extension to pdf or mht to see if only txt format is impacted?

Data is now showing in the reports once I added that.

I really appreciate your help! Thanks!

 

Thank you Adam!  I will give it a try!

Ulf, the driver behind this is not to feed it to another tool.  There is a specific use case for a report every hour.  

I am currently using the parameters below to run an hourly report and save it to the D drive.  If I wanted to run a report daily at 02:00 each morning, what would I need to change?  

<tasks>
<task ID="GenerateDmiReports1" name="DMI Hourly Report Task" periodType="HOUR" period="1" timeLine="SERVER" offsetTime="00:05" timeout="00:00" threadFromCmd="">
<command ID="0">
<class>adlex.delta.scheduler.command.SaveReportCommand</class>
<param>/LSSaveAs?lsAction=Saveas&amp;format=txt&amp;lsEntryName=REPORT</param>
<param>D:\Reports\REPORT.txt</param>
</command>
</task>
</tasks>

Hi Patrick,

You would need to change the PeriodType to DAY, the offsetTime to 02:00 and the timeout to 00:05 to make the task last for no longer than 5 minutes, as shown below

<tasks>

<task ID="GenerateDmiReportsat2AM" name="DMI Hourly Report Task" periodType="DAY" period="1" timeLine="SERVER" offsetTime="02:00" timeout="00:05" threadFromCmd="">

<command ID="0">

<class>adlex.delta.scheduler.command.SaveReportCommand</class>

<param>/LSSaveAs?lsAction=Saveas&amp;format=txt&amp;lsEntryName=REPORT</param>

<param>D:\Reports\REPORT.txt</param>

</command>

</task>

</tasks>

That is what I figured.  Thank you for the quick response!

ulf_thorn222
Inactive

Hi Patrick

If you need the data to be retrieved from some other tool for correlation or whatever, then there is a web services interface you can query.

DMI Web Services

You can create the needed data in a DMI report, save that report and then pull that from the "outside"

Is there any sample .NET code that can call a report and then pull out the data?  The documentation on this isn't very clear. 

If you decide to use REST/JSON type of our WebServices I would come up with: http://msdn.microsoft.com/en-us/library/hh674188.aspx only.

sooryaprabha_mo
Inactive

Hi,

I am trying the automation of DRUM Reports for TimeRange 00:00 to 24:00 everyday.I tried the XML file which is mentioned in the previous comments.

But I need some clarification in the XML file.

1)In  CAS, DMI Reports section I have a report as Synthetic - Transaction List (REPORT NAME).I want to take this report for TimeRange 00:00 to 24:00.In XML ,where I have to mention this REPORT NAME.

2)StartTime is 00:00 and EndTime is 24:00.Where I have to mention this in XML.

3)Everyday it will execute at 00:05 for the previous day(Example)19th July 2015 at 00:05 it will execute to fetch report for 18th July 2015 00:00 to 24:00 time period.How to do this

4)I want the Report to be in CSV format.Is it possible to fetch as CSV

5)I am using CAS 12.3.2.40, this version supports the [TimeStamp] as the generated Report_name.

 

Can you please help me to do the DCRUM Report Automation.

 

And also,I want to fetch report for past 15 minutes from the current time.Where to change in XML file to do this.

Creating the XML file itself enough to fetch the report in particular path.or as like curl we have to run bat to fetch report or any other steps there after creating the XML file in the specified path.

Thanks,

Soorya

prufe
Contributor

<tasks>
<task ID="GenerateDmiReports" name="DMI Daily Report Task" periodType="DAY" period="1" timeLine="SERVER" offsetTime="00:05" timeout="00:20" threadFromCmd="">
<command ID="0">
<class>adlex.delta.scheduler.command.SaveReportCommand</class>
<param>/LSSaveAs?lsAction=Saveas&amp;format=txt&amp;lsEntryName=THIS_IS_REPORT_NAME</param>
<param>D:\Reports\REPORT_TEXT_FILE_NAME.txt</param>
</command>
</task>
</tasks>

____________________________________________________________

Key Points:
periodType="DAY"                                                This is 24 hours of previous day.
offsetTime="00:05"                                              This will run 5 minutes after the previous day.
format=txt                                                               This saves as text file
lsEntryName=THIS_IS_REPORT_NAME        Name of the report. Rename the report with underscores. Can't use spaces.
D:\Reports\REPORTNAME.txt                             Directory on the server where the file will save and the name you prefer

 

Thanks patrick.Just create a XML file with these content and place it in path is Enough? Else need to scheduling it as a task?Any other procedures needed to do automation?

Hours and day data only is it possible to fetch?Suppose last 15 minutes data I need how to fetch that data?

Thanks

Soorya

 

 

 

 

prufe
Contributor

I just saved mine as a tasks-110-reports.xml file.  After that you must save it to the Compuware\CAS\config directory.  Once that is complete, you need to restart the CAS service so it picks up the task.  

The smallest time period I have set a report to is an hour, by using periodType="HOUR" in the xml.

sooryaprabha_mo
Inactive

Hi Patrick,

Thanks for the help.It works Fine now.(smile)

 

Best Regards

Soorya

 

sooryaprabha_mo
Inactive

Hi All,

I created the file as mentioned in the above comments as tasks-110-reports.xml.In this file I set the periodType="DAY" even though generated report has only previous 4 hours of data only.(i.e) offsetTime="00:10" in this case I will get only the data between 8/26/15 20:10 to 8/27/15 00:10(4 hours).In case anyone, gone through this kind of issues and know how to resolve, please let me know your suggestions.

Thanks

Soorya Mohan

 

Hi All,

I have created the below task to run every hour , but its executed only Twice in a day. Please let me know is any modfication requried on this task defination:

<tasks>

<task
ID="GenerateDmiReports1" name="DMI Hourly Report Task"
periodType="HOUR" period="1" timeLine="SERVER"
offsetTime="00:05" timeout="00:00"
threadFromCmd="">

<command
ID="0" name="Report Save">

<class>adlex.delta.scheduler.command.SaveReportCommand</class>

<param>/LSSaveAs?lsAction=Saveas&format=txt&lsEntryName=Application+Performance+Report</param>

<param>C:\DCRUM\Synthetic\SynthethicMonitoringReportEmite_[date].csv</param>

</command>

</task>

</tasks>

himanshumor
Inactive

Hi Everyone ,

please explain me how your are running the tasks actually being discussed in this thread?

this task definitoin should be part of URL or something else.

himanshumor
Inactive

I need to fetch a report of synthetic transactions failures(with timestamp of each failure) in a csv format

adam_piotrowicz
Dynatrace Pro
Dynatrace Pro

Then Task Scheduling is what you need, especially SaveReportCommand with example.