OnDemand User Group
Support Forums => MP Server => Topic started by: fnb4321 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 ?
-
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
-
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!
-
Yup, I agree. That's why I only process for 88's and 87's and precompile the script.
-walt