#!/bin/csh -f # # ito_msg_gen - written by Kevin P. Inscoe (Monitor Gateway System) # modified for the OnDemand and generic use outside the Monitor # Gateway System. # # parameters: # # $1 - severity "normal|warning|minor|major|critical" # $2 - application # $3 - object # $4 - message group # # the message text is contained in stdin (-) # # # History: # # When Who What # ---- --- ---- # 5-12-98 Kevin Inscoe Create Original # 7-29-98 Kevin Inscoe made more generic for use outside # of Monitor System Gateway # ############################################################### # # Global Variables # set ME = `/usr/bin/id | /usr/bin/cut -f2 -d\( | /usr/bin/cut -f1 -d\)` set LOG = /var/log/msg.log set DTMP = `/bin/date '+%H%M%S'` set ITOLOG = "/var/log/itomsg.log" set TMP = /tmp/ito_msg_$DTMP.tmp /bin/echo "+++++" `/bin/date` >> $LOG /bin/echo "+++++" `/bin/date` >> $ITOLOG # # process input # /bin/cat - > $TMP set msg = `/bin/cat $TMP` echo $msg /usr/lpp/OV/OpC/opcmsg msg_text="`/bin/echo $msg`" sev=$1 node=`/bin/hostname` appl=$2 obj=$3 msg_grp=$4 /bin/echo `/bin/date` "msg_text=" $msg "sev=" $1 "node=" `/bin/hostname` "appl=" $2 "obj=" $3 "msg_grp=" $4 >> $ITOLOG /bin/cat $TMP >> $LOG /bin/rm -f $TMP