
Tutorial - Statistic Creation
Some things to note about VA2 Statistics:
- VA2 Statistics are represented as time series graphs - a point of information graphed over time.
- They are not limited to Siebel data - they use Perl as scripting language, and any data point can be used
- They are executed on an interval, configurable from 1 minute to 1 week collection periods
- VA2 Statistics are a good way to start with application monitoring - before creating Analysis Rules and Events, first measure and graph current performance trends with VA2 Statitics.
- Statitics (and Analysis Rules) are best debugged on the same machine as the VA2 Central Server.
Step 1 - Create a new Statistic
1. For this tutorial we assume you have VA2 setup correctly and collecting Siebel Server information, as can be seen in step 4 of the verification steps. Open VA2 MMC - Navigate to the Statitics folder. Right click and select Add from the menu. (You can also import pre-built Statistics. However, for this tutorial we will build a statistic by hand.)
2. You are now presented with a code editor for your statistic. Fill out the some properties:
- Name: "TxnMerge - Task count"
- Description: "Counts the number of tasks for Siebel Component"
- Type: "Perl"
- Execution Interval: "1 Min"
We will then create a VA2 rule that counts the number of tasks for a particular Siebel component. In this example, we track the number of tasks for TxnMerge, or Siebel Transaction Merger, a component for Siebel remote, just as an example.
You will need the following values:
-Siebel Enterprise, set the $enterprise variable in the code below
-Siebel Appserver, set the $appserver variable in the code below
Code:
use siebsrvobj;
my $enterprise = 'siebel';
my $appserver = 'compaqamd';
my $compalias = 'TxnMerge';
my $entobj = siebsrvobj->newobj($datasession,$debug,$enterprise); #initialize the enterprise object
$retval = $entobj->numoftasksforappsrvrcomp($appserver,$compalias); #get number of running tasks for TxnMerge
Step 2 - Debugging Statistic
We have now written a statistic. Keep in mind that you need to customize the code with your Siebel $enterprise and $appserver values. The next step is to test the code - which we do by pressing the debug button.
When you press the debug button, the code in its current state is saved. A debug window pops up, executing the code in its current state. The quickest way to check the output is to look at the debug window, which displays what the $retval variable has returned or any error messages.
In this example, $retval = 1. That means if we activate this Statistic, the VA2 Central Server will execute this satistic on interval, every minute in this example, and graph the result which is the number of tasks for the TxnMerge Siebel Component.
To set the rule active, merely select the Active box, and press OK. The rule is saved, and VA2 will begin to execute the statistic an graph the results.
What if your rule retuned a zero or blank? A couple things to check:
- Is the Siebel information collected by VA2, as can be verified in step 4 of the MMC verification steps?
- Have you customized the Statistic code to reflect your Siebel Enterprise and Appserver values?
- Are there any obvious errors displayed in the output window of the debugger? If there is a syntax error, the debugger will print the following message "####################################################################
STATIC RULE HAS A SYNTAX ERROR. IF EXECUTED IN NON DEBUG MODE IT WILL BE SET TO
INACTIVE:"
And finally, here is the result, showing a graph of only four consecutive data points, all with a value of 1.