Running tedgen without a TEC Server

by Nick Lansdowne

With ITM 6.2.2 FP01 IBM updated the functionality of the tedgen utility so that it could run on the TEMS/TEPS server. Previously it had been dependent on a TEC Server, a software product that is becoming very rare in the field. However, the tool does not run successfully when following the instructions in the standard IBM documentation, as demonstrated below.

# tedgen -itmDir $TECLIB -id 1 -xmlPath new.xml
Error generating output XML file. See log for more details.

By default the log file is in the local temporary directory but with the default logging levels it didn’t really provide much information:

# cat /tmp/tedgen_0.log
Jan 10, 2012 4:46:38 PM com.tivoli.tec.tedgen.baroc.BarocProcessor verifyTecLibDir
SEVERE: TEG0011E An unexpected error occurred while generating the output xml file.
Jan 10, 2012 4:46:38 PM com.tivoli.tec.tedgen.TedGenerator main
SEVERE: TEG0001E An error has occurred generating the event definition XML file for the specified TEC baroc files.

The logging levels were changed in the file $TEDGEN_DIR/scripts/tedgenlog.properties.The values for the following two properties were updated to “ALL”:

.level=ALL
java.util.logging.FileHandler.level = ALL

This provided much more details in the logfile, and the problem was identified from the excerpt below:

Jan 10, 2012 4:50:56 PM com.tivoli.tec.tedgen.baroc.BarocProcessor verifyTecLibDir
FINE: Exception create temp TEC_CLASSES directory /opt/IBM/ITM/tedgen/.temp/TEC_CLASSES
java.io.FileNotFoundException: /opt/IBM/ITM/tedgen/utils/root.baroc (No such file or directory)
        at java.io.FileInputStream.open(Native Method)
        at java.io.FileInputStream.<init>(FileInputStream.java:135)
        at com.tivoli.tec.tedgen.TedGeneratorHelper.copyFile(TedGeneratorHelper.java:405)
        at com.tivoli.tec.tedgen.baroc.BarocProcessor.verifyTecLibDir(BarocProcessor.java:271)
        at com.tivoli.tec.tedgen.baroc.BarocProcessor.parse(BarocProcessor.java:112)
        at com.tivoli.tec.tedgen.TedGenerator.initialize(TedGenerator.java:81)
        at com.tivoli.tec.tedgen.TedGenerator.main(TedGenerator.java:104)
Jan 10, 2012 4:50:56 PM com.tivoli.tec.tedgen.baroc.BarocProcessor verifyTecLibDir
SEVERE: TEG0011E An unexpected error occurred while generating the output xml file.

The log entry indicates a “FileNotFoundException” for the file /opt/IBM/ITM/tedgen/utils/root.baroc. All event classes inherit attributes (slots) from the event class named EVENT that is defined in the file root.baroc. This file is not shipped with the ITM core components or the agent support (agent support ships the agent specific baroc files only). To enable tedgen to run independently of the TEC Server product the root.baroc file is shipped with the tedgen tool but in the directory $TEDGEN _DIR/scripts/utils and not  in the directory the executable is expecting to find it, $TEDGEN _DIR/utils. Copying or moving the utils directory resolves the issue:

cd $TEDGEN_DIR
cp -R  scripts/utils utils

After copying the directory plus contents (it also includes two other required files Sentry.baroc and Tmw2k.baroc) the tool runs successfully on the TEMS/TEPS. The XML output file can be loaded by the TEP Server, by updating the environment variable KFW_MCS_XML_FILES and recycling the server, and custom classes can be selected from the situation editor EIF Slot Customization dialog.

tedgen-eventclasses

Note: This problem has been reproduced on UNIX, Linux and Windows systems. The syntax of the above examples is from a Linux TEMS/TEPS.

by Nick Lansdowne