Author Topic: Creating User Exit  (Read 3238 times)

fnb4321

  • Jr. Member
  • **
  • Posts: 59
    • View Profile
Creating User Exit
« on: May 03, 2010, 12:17:15 PM »
  Anyone know the best way to capture message #87 details to include timestamp, filename,
and rows added for a specific application group ?  How would I go about creating an exit
like this ?

wwwalton

  • Guest
Re: Creating User Exit
« Reply #1 on: May 03, 2010, 12:36:25 PM »
I customized the arslog script to invoke a python program.  I use this for a number of message types.  You could just work within the arslog script but I find python has a richer set of functions.
-walt

Justin Derrick

  • IBM Content Manager OnDemand Consultant
  • Administrator
  • Hero Member
  • *****
  • Posts: 2230
  • CMOD Guru for hire...
    • View Profile
    • Tenacious Consulting
Re: Creating User Exit
« Reply #2 on: May 04, 2010, 06:34:32 AM »
Hey Alan...

The built-in arslog exit has the basics of what you need, including examples.

I have a few suggestions when it comes to User Exits (and specifically the arslog exit)...

  • Do the absolute minimum amount of work possible inside the exits -- a shell script to evaluate the message number, and print some variables to a file is all it should really need.  Launching an interpretive language like Perl (and compiling your source code) several times a second will bring your system to a crawl.
  • Archive the logs on a regular basis (daily, weekly, monthly).  This can be easily achieved by including the year and month in the file name you create.
  • Process the log with a higher-level language later.  Do your heavy lifting and slicing-and-dicing later.  If you need real-time monitoring, consider letting your enterprise monitoring software grab the log file and process it itself.
  • Be particularly cognizant of the time it takes to run your script.  While you're developing it, use tools like 'time' to measure how long it takes to execute, and wring out each and every hundredth of a second of performance -- this will keep your server from getting bogged down.  Use a script to read individual lines from a file and launch the script (say, a thousand times) because this is precisely how CMOD will use it.

Good luck!
« Last Edit: May 16, 2010, 01:17:51 AM by Justin Derrick »
IBM CMOD Professional Services: http://TenaciousConsulting.com
Call:  +1-866-533-7742  or  eMail:  jd@justinderrick.com
IBM CMOD Wiki:  https://CMOD.wiki/
FREE IBM CMOD Education & Webinars:  https://CMOD.Training/

Interests: #AIX #Linux #Multiplatforms #DB2 #TSM #SP #Performance #Security #Audits #Customizing #Availability #HA #DR

wwwalton

  • Guest
Re: Creating User Exit
« Reply #3 on: May 04, 2010, 07:32:06 AM »
Yup, I agree. That's why I only process for 88's and 87's and precompile the script.
-walt