Monday, October 6, 2014

PatrolCli - Part 7: Dynamically activate diagnostic data collection in PATROL

If you monitor web applications using BMC TM-ART or a similar product, you will receive a critical event in BPPM cell when the response time exceeds your threshold.  When this happens, you would wish that you can collect detailed performance data at EJB level to help you diagnose the poor response time.  So you probably end up developing a custom PATROL knowledge module to collect detailed EJB data from your J2EE application server.

However, you don't want to have your EJB KM running all the time since it is resource intensive.  It would make sense if you can activate and deactivate your EJB KM dynamically.  When your BPPM cell receives a critical event about slow web application response time, your EJB KM will be activated automatically.  When the same web application response time goes back to normal, your EJB KM will be deactivated automatically.

As you can see it here, BPPM cell is the only component that knows when to activate and deactivate your EJB KM because it receives and clears the slow web application response time alert.  

Since PATROL agent is normally installed on BPPM cell server, you can use PatrolCli to activate and deactivate your EJB KM.

For example, if your have a custom PATROL KM called EJB_KM, you can activate it by including the following PatrolCli command in an OS script called activate_ejb_km.cmd located on BPPM cell server:

execpsl "set(\"/EJB_KM/active\", 2);"

Then simply invoke activate_ejb_km.cmd in execute() function of a MRL rule from BPPM cell when BPPM cell receives a critical event for slow web application response time. 

Similarly, you can deactivate EJB_KM by including the following PatrolCli command in an OS script called deactivate_ejb_km.cmd located on BPPM cell server:

execpsl "set(\"/EJB_KM/active\", 0);"

Then simply invoke deactivate_ejb_km.cmd in execute() function of a MRL rule from BPPM cell when the previous critical event is cleared in BPPM cell.

No comments:

Post a Comment