Advanced Search
HomeTechnical DocumentsTipsTivoliEnterprise Console › Event Sensitive Help from the TEC Console

Event Sensitive Help from the TEC Console

One of the most common requirements of any event management tool is to have some way of recording information about an event in order to help other operators understand what that event means to the business and what actions they should take.

Most organisations have highly sophisticated trouble ticketing systems like Remedy, Vantive etc, however most organisations only raise trouble tickets for the most critical events. These problems are then tracked and any resolutions recorded to help in future problem determination.

What happens to the other events that aren't so critical - but are nevertheless still problems. Generally information about these events are stored in flat files or more often than not in peoples heads. When the problem occurs again, unless you know where to look or whom to ask, an operator will have to learn all about that problem again.

Over the next couple of weeks I will present solutions for tackling this problem, for giving the operators the right information at the right time. The first solution will simply describe a mechanism that you can employ to display descriptions, resolutions and related information about a particular event. Next weeks solution will go further presenting a more advanced solution storing and retrieving information in from a database.

Simple Event Help

In this first solution all we're going to provide is a button on the TEC console which allows an operator to select a particular event, launch a Web Browser of some description (in this example we'll use Netscape but you could quite easily use Explorer or NeoPlanet or some such other browser) that contains an existing HTML file containing helpful information about that event.

Modifying the Event Console

Events are displayed in the Event Group, part of the Event Console - or EnterpriseClient (which is what the Event Console resource is known as). Like other aspects of Tivoli the EnterpriseClient can be modified using AEF (Application Extension Facility). AEF allows the modification of some existing dialogs, unfortunately the EnterpriseClient has various components that cannot be modifed at all. AEF can also be used to get information out of gadgets.

The first thing we need to understand is how exactly are we going to get the information about an event, in particular the class - as this will be our primary key.

The main console window is generated from the dialog egMessageList.

This can be retrieved by performing the following:

Open in New Window
# List the available dialogs
wlsdialog -r EnterpriseClient
egTextMode
sgTextMode
egcAssignEgsToAdmin
egActionStatus
egMessageList
egMessageView
confirm_quit
egSeverityConfig
egEventGroupDisplay
egSetFields
egSortMessages
egMessageTimeLimits
...
...
# Get the dialog code in question
wgetdialog -r EnterpriseClient egMessageList egMessageList.d
# Reverse compile it so we have a readable -a nd more importantly -
editable dialog
rdsl egMessageList
.egMessageList.dsl?>

Within this dialog events are displayed in a Table Gadget, which contains rows of events and columns of event attributes (or slots). At the present time there is no way to access any of the information within a table through AEF, the best we can hope for is to get the row number of the table and the table name itself. This is used to find out which event has been selected, for instance the following DSL extract to acknowledge an event you'll see these three attributes being passed to the mod_event method ie

Open in New Window
Button
{
    
Commands =
        
mod_event&(
$table_name,
$table_grp.MessageTable,
ack);
        
Name AcknowledgeButton;
        
Title Msg(tec_cat,"Acknowledge Message",135);
}
?>

where $table_name holds the name of the table and $table_grp.MessageTable holds the row number of the selected event (or events).

As we cannot access the event details directly we need to find some other way of getting the data. Luckily Tivoli provide an internal mechanism for generating Trouble Tickets. This is the bare bones solution as most trouble ticketting system are completely different.

Internally a callback is provided called run_extern_cmd, that gets the data from the table for the selected row and passes it to an external script as environment variables. If we look at the existing menu item for Trouble Ticket you'll see this used

Open in New Window
Button
{
    
Commands =
        
run_external_cmd&.:/table_grp/commands/OpenMessageDialogButton(
$table_name,
$table_grp.MessageTable,
TroubleTicket);
    
HelpMessage Msg(tec_cat,"Generate a trouble ticket",239);
    
Mnemonic Msg(tec_cat,O,405);
    
Name RunCmdButton;
    
Title Msg(tec_cat,"Trouble Ticket",240);
}
?>

An additional fetaure of this method, is that you pass your own script to it to run rather than the standard TroubleTicket.sh ie replace the third argument with the name of your script eg

Open in New Window
    Commands =
        
run_external_cmd&.:/table_grp/commands/OpenMessageDialogButton(
$table_name,
$table_grp.MessageTable,
event_help);?>

This is argument is then passed as ARGV1 to the ToubleTicket.sh script. From this you could ten invoke another script.

So taking all of these parts we can create a new button on the TEC ie

Open in New Window
Button
{
    
Commands =
        
run_external_cmd&.:/table_grp/commands/OpenMessageDialogButton(
$table_name,
$table_grp.MessageTable,
TroubleTicket);
    
HelpMessage "Get external help for this event";
    
Name RunExternalHelpApplication;
    
Title "Event help";
}
?>

Now we've edited out DSL file we can now update the dialog

  • First compile the DSL code

dsl egMessageList.dsl > egMessageList.d

  • Now replace the old dialog with the new

wputdialog -r EnterpriseClient egMessageList < egMessageList.d

  • Now closedown any open consoles and restart them

The new dialog looks like the following



Running Something External

Now we have our button, when we select an event and hit the Event Helper button, the script $BINDIR/TME/TEC/TroubleTicket.sh will be executed. This file by default is just a bunch of comments. To actually do something eg launch a web browser we need to add the relevant commands.

Getting Event Data

To begin with we'll just add the command 'env' > TroubleTicket.out, just to show the environment variables that are set.

The file created in $DBDIR contains the following list of environment variables - those relating to the Event have been highlighted

Open in New Window
_=e:/Tivoli/tmr2-bin/w32-ix86/tools/env.exe
ack_time
=0
ACL
=[ admin]
acl=[ admin]
ADAPTER_HOST=
adapter_host=''
ADMINISTRATOR=
administrator=''
BASH=e:/Tivoli/tmr2-bin/w32-ix86/tools/sh.exe
BIM_PROLOG_DIR
=e:/Tivoli/tmr2-bin/w32-ix86/TME/TEC
CAUSE_DATE
=0
cause_date_reception
=0
cause_event_handle
=0
CAUSE_HNDL
=0
CHILD_OF_OSERV
=0000019c
CLASS_NAME
=TEC_Notice
class_name
=TEC_Notice
classpath
=E:\MQSeries\java\lib\COMIBM~2.JAR;E:\MQSeries\java\lib\COMIBM~1.JAR;
E:\MQSeries\java\lib\COMIBM~3.JAR;E:\MQSeries\tools\javaclnt\samples\en_us;E:\j
dk
-1.2.2\lib
ComSpec
=C:\WINNT\system32\cmd.exe
CONSOLE_NAME
=Root_roobarb-region
credibility
=1
date
='Feb 05, 2000 15:36'
DATE_EVENT=Feb 052000 15:36
DATE_RECEPTION
=949707399
date_reception
=949707399
DISPLAY
=roobarb:0
DSLISTEN
=ROOBARB
DSQUERY
=ROOBARB
duration
=0
EV_KEY
=11949707399
ev_key
=11949707399
event_handle
=1
FAIL_CNT
=0
FORMATTED_DATE
=Feb 05 15:36:39 2000
HANDLE
=1
HOSTNAME
=roobarb
hostname
=roobarb
Include=e:\SYBASE\INCLUDE;E:\MQSeries\tools\cplus\include;E:\MQSeries\tools\c\i
nclude
INTERP
=w32-ix86
LANG
=C
Lib
=e:\SYBASE\LIB;E:\MQSeries\tools\lib
list=[ ]
msg='This is a test - ignore'
MSG=This is a test ignore
msg_catalog
=''
msg_index=0
NLSPATH
=e:/Tivoli/msg_cat/%L/%N.cat
num_actions
=0
NUMBER_OF_PROCESSORS
=1
o_dispatch
=94
ORIGIN
=196.1.90.128
origin
=196.1.90.128
Os2LibPath
=C:\WINNT\system32\os2\dll;
OS=Windows_NT
Path
=e:\Tivoli\tmr2-bin\w32-ix86\bin;e:\Tivoli\tmr2-bin\w32-ix86\tools;C:\WINNT
\System32
;
E:\ACTIVE~1\bin;C:\WINNT\system32;C:\WINNT;e:\SYBASE\dll;e:\SYBASE\bin;E:\MSOff
ice\Office
;
E:\ULTRAEDIT;E:\gnuwin32\b18\H-i386-cygwin32\bin;E:\gnuwin32\b18\H-i386-cygwin3
2\lib\gcc
-lib
\i386
-cygwin32\cygnus-2.7.2-970404;E:\ORANT\BIN;E:\ORANT;E:\ORANT\RSF72;E:\MQSe
ries\tools\c
\samples\bin
;E:\MQSeries\bin;E:\jdk-1.2.2\bin;;E:\ULTRAE~1
PROCESSOR_ARCHITECTURE
=x86
PROCESSOR_IDENTIFIER
=x86 Family 6 Model 6 Stepping 10GenuineIntel
PROCESSOR_LEVEL
=6
PROCESSOR_REVISION
=060a
REPEAT_COUNT
=0
repeat_count
=0
RUN_CNT
=0
server_handle
=1
SEVERITY
=WARNING
severity
=WARNING
SHELL
=sh
SHLVL
=1
SLOTS
=server_handle date_reception event_handle source sub_source origin
sub_origin hostname adapter_host status administrator acl severity date duration
msg msg_catalog msg_index num_actions credibility repeat_count cause_date_reception
cause_event_handle ack_time 
list
SOURCE=EVENT
source
=EVENT
SRVR_HANDLE
=1
STATUS
=OPEN
status
=OPEN
SUB_ORIGIN
=
sub_origin=''
SUB_SOURCE=
sub_source=''
SUCCESS_CNT=0
SYBASE
=e:\SYBASE
SystemRoot
=C:\WINNT
TCL_LIBRARY
=E:\ORANT\network\agent\tcl
TEC_BIN_DIR
=e:\Tivoli\bin/w32-ix86/TME/TEC
TEMP
=e:\Tivoli\db\roobarb.db\tmp
TERM
=dumb
TISDIR
=e:/Tivoli/bin/generic
TMF_BOA
=boa
TMF_ORB
=orb
TMF_SELF
=1863249578.1.634#TecClient::tec_client#
TMP=e:\Tivoli\db\roobarb.db\tmp
UNKNOWN_CNT
=0
WD_DESKTOP_HOST
=roobarb
WD_DESKTOP_OID
=1863249578.1.529#TMF_UI::Extd_Desktop#
WD_DESKTOP_PID=232
WD_DIALOG_INSTANCE
=1863249578.1.529#TMF_UI::Extd_Desktop#:232
WD_DIALOG_NAME=desktop
WD_DIALOG_OWNER
=1863249578.1.634#TecClient::tec_client#
WD_DISPLAY=roobarb:0
WD_GADGET_PATH
=icon_view.1863249578x1x634#TecClient::tec_client#
WD_OCO_OID=1863249578.1.178#TMF_Administrator::Configuration_GUI#
WD_SOURCE_PATH=icon_view.1863249578x1x634#TecClient::tec_client#
windir=C:\WINNT
WLOCALHOST
=roobarb?>

As you should be able to see all of the information about the event is available - including data from custom slots eg list (even though in the comments in the TroubleTicket.sh it says only a few key values are available!). You can therefore process all of the data in the event.

Often you will not know what slots are set for what events so the environment variable $SLOTS is very useful as it defines the names of all the slots available. Note here though that class is not defined as environment variable - instead it is held in the $CLASS_NAME variable.

Launching a Browser

Armed with the data now, you can do something like fire up a web browser (or notepad, or someother application). In the following example we'll fire up Netscape.

On NT

As the process that will launch the browser does not own the NT Window, you can't just run the app and hope it displays. There is however a Tivoli supplied command - wrunui that will allow you to display another application.

In out TroubleTicket.sh script we're going to modify it to fire up Netscape as follows

Open in New Window
#!/bin/sh
#
# Customised TroubleTicket.sh
#

wrunui -e e:/netscape/program/netscape.exe
    file
://e:/Tivoli/Custom/Help/event_help.html#${CLASS_NAME}

exit 0 ?>

All this will do is launch Netscape with a pre-written HTML page (event_help.html) and it will focus on the target $CLASS_NAME eg

On Unix

Things are a little simpler on Unix, as we can address the desktop directly and as long as the current user of the desktop have allowed everyone to access their screen (eg xhost +) we should be able to display.

Again we need to modify the TroubleTicket.sh script as follows:

Open in New Window
#
# Customised TroubleTicket.sh
#

/opt/sw/netscape/netscape -display
    
${WD_DISPLAY}.0 file://opt/sw/Tivoli/Custom/Help/event_help.html#${CLASS_NAME}

exit 0?>

This will act exactly as before on NT