<xml xmlns:s='uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882'
	xmlns:dt='uuid:C2F41010-65B3-11d1-A29F-00AA00C14882'
	xmlns:rs='urn:schemas-microsoft-com:rowset'
	xmlns:z='#RowsetSchema'>
<s:Schema id='RowsetSchema'>
	<s:ElementType name='row' content='eltOnly'>
		<s:AttributeType name='analysis_rule_id' rs:number='1' rs:writeunknown='true'>
			<s:datatype dt:type='int' dt:maxLength='4' rs:precision='10' rs:fixedlength='true' rs:maybenull='false'/>
		</s:AttributeType>
		<s:AttributeType name='type' rs:number='2' rs:nullable='true' rs:writeunknown='true'>
			<s:datatype dt:type='string' rs:dbtype='str' dt:maxLength='10' rs:fixedlength='true'/>
		</s:AttributeType>
		<s:AttributeType name='rule_def' rs:number='3' rs:nullable='true' rs:writeunknown='true'>
			<s:datatype dt:type='string' rs:dbtype='str' dt:maxLength='4000'/>
		</s:AttributeType>
		<s:AttributeType name='error' rs:number='4' rs:nullable='true' rs:writeunknown='true'>
			<s:datatype dt:type='string' rs:dbtype='str' dt:maxLength='254' rs:fixedlength='true'/>
		</s:AttributeType>
		<s:AttributeType name='name' rs:number='5' rs:nullable='true' rs:writeunknown='true'>
			<s:datatype dt:type='string' rs:dbtype='str' dt:maxLength='100' rs:fixedlength='true'/>
		</s:AttributeType>
		<s:AttributeType name='sf_error_deff_id' rs:number='6' rs:nullable='true' rs:writeunknown='true'>
			<s:datatype dt:type='int' dt:maxLength='4' rs:precision='10' rs:fixedlength='true'/>
		</s:AttributeType>
		<s:AttributeType name='active' rs:number='7' rs:nullable='true' rs:writeunknown='true'>
			<s:datatype dt:type='string' rs:dbtype='str' dt:maxLength='1' rs:fixedlength='true'/>
		</s:AttributeType>
		<s:AttributeType name='execution_interval' rs:number='8' rs:nullable='true' rs:writeunknown='true'>
			<s:datatype dt:type='string' rs:dbtype='str' dt:maxLength='10'/>
		</s:AttributeType>
		<s:AttributeType name='description' rs:number='9' rs:nullable='true' rs:writeunknown='true'>
			<s:datatype dt:type='string' rs:dbtype='str' dt:maxLength='100' rs:fixedlength='true'/>
		</s:AttributeType>
		<s:AttributeType name='notimeout' rs:number='10' rs:nullable='true' rs:writeunknown='true'>
			<s:datatype dt:type='string' rs:dbtype='str' dt:maxLength='1' rs:fixedlength='true'/>
		</s:AttributeType>
		<s:extends type='rs:rowbase'/>
	</s:ElementType>
</s:Schema>
<rs:data>
	<z:row analysis_rule_id='3' type='Perl      ' rule_def='use siebsrvobj;

my $enterprise = &#x27;siebel&#x27;;                      #make sure to set Siebel $enterprise correclty
my $appserver = &#x27;compaqamd&#x27;;
my $maxlimit = 5;                                  # only check components that at MAX tasks &#x3e; $maxlimit
my $threshold = 5;                                # if the component has less than $threshold tasks, error
my @exclusions = (&#x22;&#x22;);            #

my $entobj = siebsrvobj-&#x3e;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-&#x3e;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 &#x3e; $maxlimit  and are not excluded  
      if ($maxtasks &#x3e;  $maxlimit and !(grep(/$currentcomp/,@exclusions))) {   
           my $taskdelta = $entobj-&#x3e;getmaxtaskdelta($currentcomp,$appserver); 
           if ($taskdelta &#x3c; $threshold) {
                 push @error, &#x22;MAXTASK WARNING!! $currentcomp has ONLY $taskdelta tasks left!!\n&#x22;;        
           } 		  
     
      }
  }

if (@error == 0) { #the number of errors == 0, so $retval = 1 
	$retval = 1;
}
$error_string = join(&#x22; &#x22;,@error);
print &#x22;error string =  $error_string\n&#x22;;'
		 error='                                                                                                                                                                                                                                                              '
		 name='Component Delta MAX Reached                                                                         ' active='Y'
		 execution_interval='1' description='Finds any components that  is within Delta of MAX tasks                                             '
		 notimeout='N'/>
</rs:data>
</xml>