I think this will help you out. Thanks to Jennifer Nelson for this! This will add Monitor->Events->Current Events and Monitor->Events->Event History to the UI.
Scott
################## Start /usr/OV/registration/C/list_traps.reg ###################
/* Menu addition to list all traps received for a certain device.
Jennifer Nelson, Tivoli Services
December 6, 2000
*/
Application 'Trap Customization'
{
Description {
"Window to list all traps received for a device"
}
MenuBar "Monitor"
{
<92> "Display Latest Traps..." _D f.action dis_latesttraps;
<91> "Display Archived Traps..." _A f.action dis_archtraps;
}
/******* Popups ***/
Menu 'P_Monitor'
{
<92> "Display Latest Traps..." _D f.action dis_latesttraps;
<91> "Display Archived Traps..." _A f.action dis_archtraps;
}
/*****Actions*****/
Action dis_latesttraps {
MinSelected 1;
MaxSelected 1;
SelectionRule ( isNode ) ;
Command ' \
/usr/OV/bin/xnmappmon \
-commandTitle \" Trap List \" \
-geometry 900x600 \
-cmd /usr/OV/scripts/listtraps latest';
}
Action dis_archtraps {
MinSelected 1;
MaxSelected 1;
SelectionRule ( isNode ) ;
Command ' \
/usr/OV/bin/xnmappmon \
-commandTitle \" Trap List \" \
-geometry 900x600 \
-cmd /usr/OV/scripts/listtraps archived';
}
}
################## End /usr/OV/registration/C/list_traps.reg ###################
################## Start /usr/OV/scripts/listtraps ###########################
#!/bin/ksh
# This script will grep through a trapd.log file for a certain
# node and display all matching up/down/marginal traps for it.
# This script is called by the NetView registration file
# /usr/OV/registration/C/list_traps.reg.
#
# Jennifer Nelson, Tivoli Services
# December 6, 2000
if [[ $1 = latest ]]; then
logfile=/usr/OV/log/trapd.log
elif [[ $1 = archived ]]; then
logfile=/usr/OV/log/trapd.log.old
else
echo " Error determining log file to use. Exiting."
exit 1
fi
if [[ ! -s $logfile ]]; then
echo " No data available."
exit 2
fi
startdate=`head -1 $logfile | awk '{ print $3, $4, $5, $6, $7 }'`
echo " ***** Trap listing for: $OVwSelection1 since $startdate. *****"
echo
grep $OVwSelection1 $logfile | grep -iE "up|down|marginal" | tail -n 100
exit 0
################## End /usr/OV/scripts/listtraps ###########################