Chapter 9. IBM Tivoli NetView integration 321
Figure 9-26 NetView Console launch process
The process is:
1. The Java console sends information about the menu entry selected and the
physical resource to the Console Server.
2. The Console Server retrieves the necessary data, depending on the physical
resource under investigation from the object database, and passes the data
back to the Java console. The data can be different for the various resources.
For example, the launch of the NetView diagnostics for an Ethernet switch
may differ from a launch for a router.
3. The launch command invokes the launch.jar java application on the local
workstation and passes the parameters to it. The passed parameters contain
the target NetView Server, the resource under investigation, and the name of
a NetView server-side script that supplies the requested action.
4. The server-side script, usually found under /usr/OV/webapps/netview/scripts,
launches the NetView Web console through launch.jar and displays the
results.
A real-life example of a new menu entry
As you can see from the previous chapter, a new menu entry meant to allow new
or different actions against a network resource requires modification on both the
IBM Tivoli Business Systems Manager side and the NetView side.
TBSM Console
NetView server
TBSM Database ServerTBSM Console Server
nvlaunch.jar
1. Request Launch entry
2. Launch command
3. Request data
4. Populate console
322 Tivoli Business Systems Manager Version 2.1: End-to-End Business Impact Management
As a real-life example, we show the steps you need to implement in order to
provide a new menu that:
? Provides all three types of supported actions in a single launch of the Web
console,
? Changes the order of the different panes inside the NetView Web console to
display the diagnostic pane on top,
? Changes the diagnostics to run the more useful NetView quicktest instead of
a simple ICMP echo request against the resource under test. The NetView
quicktest is especially useful for IProuters. It checks all of the routers displays
and shows its status.
Here are the steps:
? On the NetView server, go to /usr/OV/www/webapps/netview/scripts. As
shown in Example 9-21, you will find a few files with a .js extension. These are
server scripts that are executed by the NetView Web server. A closer look at
the names will reveal the actions the script is supposed to carry out:
diagnostics.js Provides the diagnostics pane in the Web console.
objectproperties.js Displays the NetView object properties pane in the
Web console.
submapexplorer.js Displays the NetView submap where the object under
investigation is located.
The remaining scripts shown in Example 9-21 are not used by IBM Tivoli
Business Systems Manager.
Example 9-21 The existing server scripts
capecod:/usr/OV/www/webapps/netview/scripts #ls
3beansalad.js diagnostics.js resolvetarget.js
README.txt objectproperties.js submapexplorer.js
A closer look at the file 3beansalad.js shows what the name implies: The
script displays all three panes used by IBM Tivoli Business Systems Manager
in a single script. You can check this by launching the script manually as
shown in 9.6.3, Testing the launch functions on page 308. However, the
panes order could be more useful than displaying the diagnostic pane
overlapping the other two panes, as shown in Figure 9-27 on page 323.
Chapter 9. IBM Tivoli NetView integration 323
Figure 9-27 3beansalad.js display
To rearrange the three panes:
? Make a copy of 3beansalad.js and give it a different name. For reference, it is
listed in Example C-5 on page 574. We renamed ours TBSMsummary.js.
? Open the file with a text editor. Examining the script code, you can easily
recognize the four sections in the script. The first three sections provide the
data for the panes being displayed while the fourth section (just one line)
displays the result.
? You dont have to be fluent in JavaScript to move the sections that change the
display order. For our example, we rewrite our script to open the submap
explorer first, followed by the object properties pane, then the diagnostics
pane. This places the diagnostics pane on top when the console is launched.
? In the diagnostics block, locate the statement:
diag.performTest("Test", "Ping", targetnode);
? Replace the Ping parameters by a call to Quicktest:
diag.performTest("Test", "QuickTest", targetnode);
Example 9-22 on page 324 shows the complete, revised script.
324 Tivoli Business Systems Manager Version 2.1: End-to-End Business Impact Management
Example 9-22 TBSMsummary.js
/* TBSMsummary.js: This is a modified 3beansalad.js file
* to demonstrate custom TBSM menus used in SG24-6610
* 3-dec-2002 glasi */
/*************** First display the explorer submap **********?
var mapconn = new Packages.com.tivoli.netview.mapconnector.client.MapConnector(protocol,
hostname, port);
if (!mapconn.isOkToSkipOpenMapDialog()) {
var dialog = mapconn.createDialog(null);
dialog.setVisible(true);
}
var mapport = mapconn.getMapServerPort();
var mapname = mapconn.getMapName();
if (0 != mapport) {
var subexp = new
Packages.com.tivoli.netview.maptree.client.submapexplorer.SubmapExplorer();
subexp.setProtocol(protocol);
subexp.setHostName(hostname);
subexp.setPort(port);
subexp.setMapPort(mapport);
subexp.setMapName(mapname);
subexp.setTargetNode(targetnode);
subexp.activate();
framefactory.addFrame(subexp, "Submap Explorer", "anm_wc_win_subexplorer");
}
/********************** second, display the object properties *******************/
var objprop = new Packages.com.tivoli.netview.objectproperties.client.ObjectProperties();
objprop.setProtocol(protocol);
objprop.setHostName(hostname);
objprop.setPort(port);
objprop.resetTargetNode(targetnode);
framefactory.addFrame(objprop, "Object Properties", "anm_wc_win_objprops");
/*************** third launch a Quicktest against the node ******************/
var diag = new Packages.com.tivoli.netview.diagnostics.client.Diagnostics();
diag.setProtocol(protocol);
diag.setHostName(hostname);
diag.setPort(port);
diag.performTest("Test", "QuickTest", targetnode);
framefactory.addFrame(diag, "Diagnostics", "anm_wc_win_diagnostics");
Packages.com.tivoli.netview.client.global.NetView.bringToForeground();
? Save the script and test it as described in 9.6.3, Testing the launch functions
on page 308. This should produce a NetView Web console that displays all
three selected panes with the Quicktest diagnostic pane on top as in
Figure 9-29 on page 327.
Chapter 9. IBM Tivoli NetView integration 325
? Now, having the NetView part up and running, you have to provide IBM Tivoli
Business Systems Manager with the correct information to actually launch it.
? On your database server, go to the TivoliManagerin directory. Locate the
file nvlaunchconfig.sh, copy it, and give the copy a new name, for example
newmenu.sh.
? Open the file with an editor. Assign
the SQL server name
the SQL user account
the SQL password
to the top three variables in the script. (This likely has already been done,
because we are using a copy of the nvlaunchconfig.sh script).
? From the add_entries and delete_entries sections in the script, remove all the
diagnostics entries and the object properties entries. We will need just one
block of definitions.
? In each AddAppLauncherEntry.sh line, replace the -n flag with a new name
such as NVsum. We suggest keeping the last letter unchanged: NVConsR
then becomes NVsumR, and so on.
? In each AddAppLauncherEntry.sh line, replace the value of the scripurl
parameter by the path to our modified NetView Server script. In our example,
replace submapexplorer.js by TBSMsummary.js
? In each AddAppLauncherMenuItem.sh line, replace the -n and -r flag values
with the name assigned to the AddAppLauncherEntry.sh -n flag, which in our
case is NVsum. As before, we suggest you keep the last letter as is.
Then replace the description supplied with the -l flag by a new menu name,
such as NetView Overview in our example.
For reference, Example 9-23 shows an example line for each command type
being executed inside newmenu.sh.
Example 9-23 The modified command parameters
AddAppLauncherEntry.sh -S $SQLSERVER -U$SQLUSER -P$SQLPWD -nNVsumR
-l"Windows NT" -cSockets -m8899 -x8899 -w5000 -r18
-g"cmd /c %NVWC_HOME%in vlaunch.bat port 8899 > nvlaunch.log 2>&1"
-a"serverinfo=%nvserver%
scripturl=/netview/scripts/TBSMsummary.js
sctargetnode=%name% tbsm=true"
AddAppLauncherMenuItem.sh -S $SQLSERVER -U$SQLUSER -P$SQLPWD -nNVsumR
-cROUT -l"NetView Overview"
-r"NVsumR,name=%IPHostName%,nvserver=%this.LookupNetViewURLs%"
DeleteAppLauncherMenuItem.sh -S $SQLSERVER -U$SQLUSER -P$SQLPWD -nNVsumR -r
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset