#!/usr/local/bin/rxx /* (c) copyright 1995, Paul Zarnowski and Cornell University (see "Legal Information", below) daily.actlog Extract yesterday's ADSM activity log, filter out nominal messages, save a copy on disk and mail it to the administrator(s). Launch via 'cronrexx'. Author Information: Paul Zarnowski Cornell Information Technologies Ithaca, NY 14853-2601 psz1@cornell.edu Update History: 9-Oct-95 psz1: Initial version */ mailto="adsm-maint" TOPDIR='/u/adsm-mon/log' LOGDIR=TOPDIR'/actlog' TAPE_HIST_FILE=TOPDIR'/tape.history' /* Determine today's date and yesterday's date */ TODAY=edate(U,,,L) YESTERDAY=edate(U,,-1,L) FILENAME=edate(S,,-1,L) /* TODAY=edate(U,,-1,L) YESTERDAY=edate(U,,-2,L) FILENAME=edate(S,,-2,L) */ F0="/tmp/adsm.actlog."FILENAME F1="/tmp/adsm.actlog.head" F2="/tmp/adsm.actlog.out" F3="/tmp/adsm.actlog.temp" /* Get daily activity log for yesterday. */ "rxx daily.actlog.get" TODAY YESTERDAY F0 /* Filter out normal messages */ "rxx daily.actlog.filter" F0 F2 F1 TAPE_HIST_FILE call lineout TAPE_HIST_FILE /* Send any abnormal messages to adsm-maint */ "test -f" F2 if (rc = 0) then do call popen("wc -l" F2) pull lines . if (lines > 0) then do "echo Output from ADSM maintenance script: daily.actlog >>" F3 "echo '' >>" F3 'cat' F3 F1 F2 '>' LOGDIR'/'FILENAME 'cat' LOGDIR'/'FILENAME '| mail -s "ADSM Activity Log for' YESTERDAY'"' , mailto "rm" F1 F2 F3 F0 end end /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ /* Legal Information: Although copyrighted, this software is being licensed to you for your use free of charge. However, ownership of and interest in this software shall remain with the author. Use and distribution of this software is governed by the following terms. This software is owned by the author and contains valuable and proprietary information of the author. If you violate any part of this agreement, your right to use this software terminates automatically. In the event of termination of this agreement, you must destroy all copies of this software and derivatives of this software in your possession and cease distributing the same. This software is being licensed to you as provided by the terms of this agreement. You may: 1. Use this software on as many computers as you want at any given time. 2. Make as many backup copies of this software as you want. 3. Alter the software in any manner you see fit FOR YOUR OWN PERSONAL USE. Such altered versions should not be distributed. The creation of such derivatives shall not diminish the author's title to this software. 4. Terminate this agreement at any time by destroying all copies of this software and derivatives of this software and cease distributing the same. You may not: 1. Create any derivative works from this software for distribution. 2. Re-distribute this software for commercial (for-profit) purposes. Contact the author at the address within this document if you wish to distribute this software for commercial usage, or if you have any questions about its redistribution. Disclaimer of warranty: In using this software, you understand and agree that this software is provided "as is" without warranty of any kind. The entire risk as to the results of and performance of using this software lies entirely with you, the user. The author does not make any warranties, either expressed or implied, including but not limited to implied warranties of merchantability and fitness for a particular purpose, with respect to this software. In no event shall the author be liable for any consequential, incidental, or special damages whatsoever arising out of the use or inability to use this software. */