Siebel Component reached Max Tasks

XML rule for importing

If a Siebel component has reached Max Tasks, it means no more tasks are available for that component, and if you try to start one an error will be generated.  For some components, that is fine.  Many, such as the SCBroker component in the example below, the maximum number of tasks is set to 1, and the number of tasks running is 1, so that component is at “Max Tasks”, but it is not an issue.

 

 

Other components however, especially the Siebel Object managers, should never run out of tasks.  If there are no tasks left, it means that no more users will be able to log into the system.  In addition, if your are monitoring the situation, you would want to be alerted as an administrator when the number of available tasks approaches 0, not when it is zero, that would give you time to do some preventative actions to correct the issue.

So, there are a few methods that VA2 provides to address this issue.  One of them is the getmaxtaskdelta($taskalias,$appserver) method.  If you call this, for a particular component, it will return the difference between the number of Running Tasks, and Max Tasks.  For example, calling that method on the PDbXtract component with the data seen above, would return a 6, the delta between Max and Running tasks.  Using the getmaxtaskdelta($taskalias,$appserver) method, a Siebel administrator could generate separate VA2 Statistics, or separate VA2 analysis Rules for each component that they want to check.  A sperate rule and event could be set up for each component in question.

Another approach is to use a VA2 rule that checks all components, and finds any Siebel component that is at Max Tasks, or getting near it.  This rule and code below give an example of that requirement.  Before listing the code, look at a number of setup parameters, and what they do for you code.

my $enterprise = 'siebel';                      #make sure to set Siebel $enterprise correclty

my $appserver = 'compaqamd';

my $maxlimit = 5;                                  # only check components that at MAX tasks > $maxlimit

my $threshold = 5;                                # if the component has less than $threshold tasks, error

my @exclusions = ("");            #

The first variables are pretty self explanatory, setting the $enterprise and $appserver parameter.  The $maxlimit one, is slightly different. It is used to only check components where the Max Tasks value for the component is greater than the $maxlimit value. For example, the $maxlimit is 5.  The SCBroker component in the example above the Max Tasks is 1.  Since our $maxlimit value is 5, we will only check components where the Max Tasks is above 5, so SCBroker will be ignored and whether this component is at max tasks or not it will not cause an error.

The $threshold variable is simply the delta of max tasks that will cause an alert.  If it is set to 5, when a component is within 5 tasks of its Max Tasks limit, an error would be generated.

The @exclusions variable is a list of components that you don’t want to check at all.  To set the variable, you would fill it out such as this:

my @exclusions = ("SRBroker,ClientAdmin"); 

Then the components SRBroker and ClientAdmin would not be checked for Max Tasks.  You can add new components separated by a comma, or just have one.

The rest of the code is an example of accessing individual elements when cycling through a list of Siebel components.  Another interesting feature, is that the code uses the $error_string variable a lot. So if this rule generates an error, the custom $error_string variable will be populated and sent in emails/events.  Download the code here in XML, or see the code below.

 

use siebsrvobj;

 

my $enterprise = 'siebel';                      #make sure to set Siebel $enterprise correclty

my $appserver = 'compaqamd';

my $maxlimit = 5;                                  # only check components that at MAX tasks > $maxlimit

my $threshold = 5;                                # if the component has less than $threshold tasks, error

my @exclusions = ("SRBroker,ClientAdmin");            #

 

my $entobj = siebsrvobj->newobj($datasession,$debug,$enterprise);         #initialize the enterprise object

 

#variable declarations

my @allcomps;        #  array of server task records

my $href;                 # refrence to a hash

my @error;              # list of task errors

 

@allcomps = $entobj->entcomps();                                                         #get array of all server tasks

 

foreach  $href (0..$#allcomps) {                                                              #loop through the components

               

      my $currentcomp =  $allcomps[$href]{cc_alias};                     #current component alias

      my $tasksrunning = $allcomps[$href]{cp_num_run};               #current component tasks running

      my $maxtasks =  $allcomps[$href]{cp_max_tas};                    #current component max tasks

      my $errstring;

      

     #only check components that have Max task > $maxlimit  and are not excluded 

      if ($maxtasks >  $maxlimit and !(grep(/$currentcomp/,@exclusions))) {  

           my $taskdelta = $entobj->getmaxtaskdelta($currentcomp,$appserver);

           if ($taskdelta < $threshold) {

                 push @error, "MAXTASK WARNING!! $currentcomp has ONLY $taskdelta tasks left!!\n";       

           }                     

    

      }

  }

 

if (@error == 0) { #the number of errors == 0, so $retval = 1

                $retval = 1;

}

$error_string = join(" ",@error);

print "error string =  $error_string\n";

 

 

 

 

 

 

 

 

 

 

 

Here is the code.  Also can download it here as XML and import it.  Make sure to customize the name of your Siebel $enterprise and $appserver parameters.

use siebsrvobj;

 

my $enterprise = 'siebel';                      #make sure to set Siebel $enterprise correclty

my $appserver = 'compaqamd';

 

#set these if you want to skip some components

my $exludeshutdown = 0;

my @excludecomps = "SRProc";

 

my $entobj = siebsrvobj->newobj($datasession,$debug,$enterprise);         #initialize the enterprise object

 

$retval = $entobj->appservercompsnotrunning($appserver,$exludeshutdown,@excludecomps);

$error_string = $retval;