DX Application Performance Management

 View Only

Field Pack: Introscope Report Generator 

Aug 20, 2014 03:25 PM

What It Be


Using the command-line workstation (CLW), this script will execute specified reports (via regular expressions found in a configuration file) and email them to appropriate parties.  It is designed to be automated via cron so that reports are sent at regular intervals.



You can create a wrapper script that calls this report utility once for each application that needs reports.  Each application would have its own configuration file with specified management modules, report names, and destination email addresses.  The wrapper would simply have something like this:



reportGenerator.pl -f app1_config.properties

reportGenerator.pl -f app2_config.properties



Then you'd setup crontab to execute the wrapper at a specified time each day or week, and all your reporting will be automated.





Ground Rules


This is a free offering from Wily, and thus currently not an officially supported product from Wily Technology. Consult your field rep/SE for assistance, rather than contact Wily Technical Support.





Technical Requirements


The field extension is tested and developed against Introscope v8.x and v9.x; it will work with any version of the command-line workstation.

It requires Perl 5.8 or newer.

It has been tested on Windows, Linux, and Mac OS-X.







This script requires shared libraries.  It will not run by itself.  See the lib directory that accompanies.



You need to copy in your CLW.jar file to the clw/lib/ directory.





No special installation necessary.  However, to keep the file size small, I did not include the CLW jar file(s).  Therefore, you need to copy the clw jar file(s) to the clw/lib/ directory, as noted by the readme.  Then point to the appropriate version jar file using the config file.







Run with -? for usage statement.  There are options to send mail only, run reports only, etc.



All other properties are found in the properties file, for which there's a template provided.  The template WILL need editing before the tool will work, as some properties do not have valid default values (such as for mail details).







If you have issues with this script, turn on debug and see if you can find the problem.  Debug is enabled using the DEBUG environment variable with integers; the higher the number the more verbose debug will be.  A debug level of 2 will dump the loaded configuration so you can validate that all values were properly picked up.



export DEBUG=1





If you have issues with timestamps, see the comments at the top of the script or in the properties file.  It often has to do with missing libraries or a failure to resolve timezones.



If you get a crash running a change-detector related report (such as if you select to run ALL reports), try skipping the change-detector report if CD is not enabled.



If you get an error about "Undefined subroutine &Date::Manip::UnixDate" then open reportGenerator.pl and look at the comments that explain which lines to uncomment to fix the issue.






Change History

# 1.0    12/13/11 Initial.

# 1.0.1  12/16/11 Tested and fixed to run on Mac, Linux, and Windows

# 1.0.2  01/03/12 Fixed for timezone support for Windoze

# 1.1    01/10/12 Added EM port argument, fixed issue with single vs multiple to: email address parsing

#                 Added support for CC email. Incorporated into svn

# 1.1.1  01/11/12 Fix to support SunOS running Perl 5.8.

# 1.1.2  02/23/12 Fix for starttime/endtime overrides in config file

# 1.1.3  06/06/12 Fix for multiple email addresses (caused by 1.1); also fixed in Utils.pm

# 1.2    07/05/12 Fix for metachars in report names, cc addresses, inactive reports being excluded

# 1.2.1  09/06/12 Cosmetic fixes only

0 Favorited
0 Files

Tags and Keywords


Jan 14, 2016 09:14 PM

Thanks everyone for the support. It was an issue on the SMTP server side. Got it working now.



Jan 14, 2016 11:22 AM

Some mail servers require the sender to be whitelisted.  In a previous company, even though the message was dispatched successfully, it wouldn't be forwarded past the relay unless the sending server was whitelisted. 


Should you need to enable debug, just do it from the command line prior to running it.  It's an environment variable:


export DEBUG=2


The higher number you use the more detail will be shown.  2 is a good place to start.  3 (or perhaps 4) would be max.  It will print the debug statements to the STDERR.

Jan 14, 2016 02:53 AM

The Report Generator is not meant to run from a Management Module, but as a daemon/service.

Jan 14, 2016 02:41 AM

Hi Geethu,


These are not mandatory if you don't require authentication for mail server.


Please test mail manually using hiko's link.




Jan 14, 2016 02:28 AM

Hi Karthik,


I am not running the script from MOM. I tried the SMTP action in MM editor . The logs says Action successfully sent mail to xxxx@yy.com but still they are not receiving it.


Are these parameters mandatory. in MM editor , we don't specify this right? So in script also, are they mandatory?





Jan 14, 2016 01:53 AM

Hi Geethu,


This looks like script is working fine and it gives a success message "Mailing 1 reports to ***@yy.com".Finished"


So there is no issue on script. I hope you should be running this from your MOM server. Do you have mail action set in management module editor and working fine? If yes, use the same mail settings and your MOM server should be able to send those e-mails successfully.


If script throws any error, same should be printed under /logs folder.




Jan 14, 2016 01:41 AM

Hi Geethu_John,

I would try checking if you can properly connect to your SMTP gateway doing a simple email to your self to ensure you're getting good responses back.



Jan 14, 2016 01:10 AM

Hi Hiko,


Yes I edited to,from,smtprelay,smtpport,smtpuser and smtppassword.

The script ends with "Mailing 1 reports to ***@yy.com".Finished".


Can debug mode reveal more details, if yes , how can enable in this? Also, I feel the script is working fine and could there be any chance of mail being blocked at smtp server level ?



Jan 14, 2016 12:42 AM



Did you alter the configuration in your properties file?


#Specify the below arguments as necessary for sending mail. 

  #Specify destination address(es). 
  #There are no defaults for these properties.  The to property is REQUIRED.
  #Repeat the to=  or cc= options for more destination addresses (or use comma-delimited on the same line)

  #Specify the report sender.  Defaults to "noreply@ca.com" if not specified. 

  #Specify the report subject.  Defaults to "Wily Reports" if not specified. 
  #subject=Wily Reports
  #Specify mail-relay properties.  You may not need authentication, depending on your mail relay config.
  #There are no defaults for these properties.  The smtprelay property is REQUIRED.
  #smtprelay=<your mail server here>

  #Specify your body email message.  Everything before the ENDOFMESSAGE token will be included.
message <<__ENDMESSAGE__
Dear Colleague,

Please find attached the Introscope reports that you have requested.

Best Regards,

The APM Team



Jan 13, 2016 11:59 PM

Hi Karthik,


There was firewall issue but again I hit another issue , I am not receiving those mails. The script ends saying "Mailing 1 reports to ***@yy.com".



Jan 13, 2016 08:45 AM

Hi Geethu,


I have used this recently and it was successful.


By looking at the error, Check your mail-server settings are properly updated in report.properties file and you are able to reach mail server from the place you are running this script. Also check whether you have correct perl versions with all supported libraries




Jan 13, 2016 05:21 AM

Hi all,


Has anyone used this fieldpack? I set it up in our environment and am getting error:


SMTP Failed to connect to mail server: Bad file descriptor

at D:/Wily/reportGenerator_1.2/reportGenerator/../lib/Kline/Utils.pm line 285.


Any clues?



Sep 09, 2014 07:15 AM

Hi All,

Do you have a sample working codes/ for this item?

Im in the process of creating a job that can send a metrics recorded for the past week and send it via email.


Your immediate response is highly appreciate.




Related Entries and Links

No Related Resource entered.