Setting metadata for KMs


For each solution that provides metadata, you need to set the metadata for each of the KMs in that solution. You must set this metadata in pre-discovery. The following code snippet shows how to set the metadata for few variables:

To set the metadata for KMs compatible with PATROL Agent version 9.5 and later

You can set the metadata for KMs using the PATROL Classic console.

  1. Open the PATROL Classic console in Developer mode.
  2. Click the KM tab
  3. Right click the Application Classes, and select  New
  4. Type a name for the Application class.
  5. Application Properties window is displayed as shown in the following diagram
    application_class1.png

  6. Click the Metadata tab and provide the information such as: Display Name, Monitor Type, Monitor Category, and CDM Class Name.
  7. Click Apply and save the Application Properties for a KM. 

The following code block illustrates an example of xml snippet that is automatically generated when you set the metadata for a KM through a developer console. This is applicable for KMs that are compatible with PATROL Agent version 9.5 and later.

<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<KMFile description="PATROL Knowledge Module for Microsoft Windows Operating System" majorVersion="1" minorVersion="90" package="pwk" productcode="pwk" release="5.0.00" revision="00" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="KMFile.xsd">
<Applications>
<Application CDMClass=" " active="true" category="System" createIcon="false" discovery="PSL" discoveryTime="0" displayName="Processor" helpContextId="13117" helpFile="pwkkm.hlp" name="NT_CPU" okPicture="cpu_ok.xpm" propagateState="true" security="false" suspendGlobalParams="false" type="MONITOR" wrongPicture="cpu_warn.xpm">
...
...
<Parameters>
<Parameter active="true" autoRescale="false" check="false" format="%f" helpContextId="12153" helpFile="pwkkm.hlp" historyLevel="false" historySpan="0" historyTime="600" monitor="true" name="CPUprcrProcessorTimePercent" output="OUTPUT_GRAPH" title="Processor Time" type="CONSUMER" units="%" yAxisMax="100" yAxisMin="0">
<ParamMetadata applicationCollectionStatus="false" availability="false" config="false" delta="false" graphByDefault="true" kpi="true" monitorForAbnormalities="true" normalDistribution="true" responseTime="false" statistical="true"/>
<BaseCommand>
<Command commandType="OS" computerType="ALL_COMPUTERS">
<Commandtext serial="1085771978">exit;</Commandtext>
</Command>
</BaseCommand>
<Ranges>
<Range active="false" alarmWhen="ALARM_INSTANT" alarmWhenN="0" maximum="100" minimum="0" name="BORDER" state="ALARM"/>
<Range active="false" alarmWhen="ALARM_INSTANT" alarmWhenN="0" maximum="95" minimum="90" name="ALARM1" state="WARN"/>
<Range active="false" alarmWhen="ALARM_INSTANT" alarmWhenN="0" maximum="100" minimum="95" name="ALARM2" state="ALARM"/>
</Ranges>
</Parameter>

<Parameter active="true" autoRescale="false" check="false" format="%f" helpContextId="12152" helpFile="pwkkm.hlp" historyLevel="false" historySpan="0" historyTime="600" monitor="true" name="CPUprcrPrivTimePercent" output="OUTPUT_GRAPH" title="Privileged Time" type="CONSUMER" units="%" yAxisMax="100" yAxisMin="0">
<ParamMetadata applicationCollectionStatus="false" availability="false" config="false" delta="false" graphByDefault="false" kpi="false" monitorForAbnormalities="true" normalDistribution="true" responseTime="false" statistical="true"/>
<BaseCommand>
<Command commandType="OS" computerType="ALL_COMPUTERS">
<Commandtext serial="1268815460">exit;</Commandtext>
</Command>
</BaseCommand>
<Ranges>
<Range active="false" alarmWhen="ALARM_INSTANT" alarmWhenN="0" maximum="100" minimum="0" name="BORDER" state="ALARM"/>
<Range active="false" alarmWhen="ALARM_INSTANT" alarmWhenN="0" maximum="95" minimum="90" name="ALARM1" state="WARN"/>
<Range active="false" alarmWhen="ALARM_INSTANT" alarmWhenN="0" maximum="100" minimum="95" name="ALARM2" state="ALARM"/>
</Ranges>
</Parameter>

<Parameter active="true" autoRescale="false" check="false" format="%f" helpContextId="12154" helpFile="pwkkm.hlp" historyLevel="false" historySpan="0" historyTime="600" monitor="true" name="CPUprcrUserTimePercent" output="OUTPUT_GRAPH" title="User Time" type="CONSUMER" units="%" yAxisMax="100" yAxisMin="0">
<ParamMetadata applicationCollectionStatus="false" availability="false" config="false" delta="false" graphByDefault="true" kpi="true" monitorForAbnormalities="true" normalDistribution="true" responseTime="false" statistical="true"/>
<BaseCommand>
<Command commandType="OS" computerType="ALL_COMPUTERS">
<Commandtext serial="1268815596">exit;</Commandtext>
</Command>
</BaseCommand>
<Ranges>
<Range active="false" alarmWhen="ALARM_INSTANT" alarmWhenN="0" maximum="100" minimum="0" name="BORDER" state="ALARM"/>
<Range active="false" alarmWhen="ALARM_INSTANT" alarmWhenN="0" maximum="95" minimum="90" name="ALARM1" state="WARN"/>
<Range active="false" alarmWhen="ALARM_INSTANT" alarmWhenN="0" maximum="100" minimum="95" name="ALARM2" state="ALARM"/>
</Ranges>
</Parameter>
</Parameters>
</Application>
</Applications>
</KMFile>


To set the metadata for KMs that are compatible with versions earlier to PATROL Agent 9.5

The following code block illustrates an example of how to set the metadata for KMs that are compatible with versions earlier to PATROL Agent 9.5

set("MetaCategory","solutionCategory");  
set("MetaAvailabilityParams", [" _parameter1_
"
," _parameter2_
"
,...]);
set("MetaResponseTimeParams", [" _parameter1_
"
," _parameter2_
"
, ..."]);
set("
MetaKpiParams", [" _parameter1_
"," _parameter2_
", ..."]);
set("MetaNormalDistributionParams", [" _parameter1_
"
," _parameter2_
"
, ..."]);
set("
MetaAbnormalitiesParams", [" _parameter1_
"," _parameter2_
", ..."]);

The following example shows how to set metadata for an application class, NT_CPU:

AppClass ="/NT_CPU/";
set("MetaAbnormalitiesParams", [" _parameter1_
"
," _parameter2_
"
, ..."]);
MetaKMDisplayName="
MetaKMDisplayName";
MetaKMDisplayNameValue="
CPU";
set(AppClass.MetaKMDisplayName,MetaKMDisplayNameValue);
set(AppClass.MetaKMDisplayName,MetaKMDisplayNameValue);
MetaKMCategory="
MetaKMCategory";
MetaKMCategoryValue="
System";
set(AppClass.MetaKMCategory,MetaKMCategoryValue);
set(AppClass.MetaKMCategory,MetaKMCategoryValue);
MetaKMType="
MetaKMType";
MetaKMTypeValue="
MONITOR";
set(AppClass.MetaKMType,MetaKMTypeValue);
set(AppClass.MetaKMType,MetaKMTypeValue);
MetaKMCDMClassName="
MetaKMCDMClassName";
MetaKMCDMClassNameValue="";
set(AppClass.MetaKMCDMClassName,MetaKMCDMClassNameValue);
set(AppClass.MetaKMCDMClassName,MetaKMCDMClassNameValue);
MetaKpiParams="
MetaKpiParams";
MetaKpiParamsList=["
CPUprcrProcessorTimePercent","CPUprcrUserTimePercent","CPUprcrVMProcessorTimePercent"];
set(AppClass.MetaKpiParams,MetaKpiParamsList);
set(AppClass.MetaKpiParams,MetaKpiParamsList);
MetaGraphByDefaultParams="
MetaGraphByDefaultParams";
MetaGraphByDefaultParamsList=["
CPUprcrProcessorTimePercent","CPUprcrUserTimePercent","CPUprcrPrivTimePercent","CPUprcrInterruptsPerSec","CPUprcrVMReservation","CPUprcrVMProcessorTimePercent"];
set(AppClass.MetaGraphByDefaultParams,MetaGraphByDefaultParamsList);

You can also set the metadata for a KM in the batch mode using the batch_set() function as follows:

batch_set("MetaKMCategory\bSYSTEM\a". "MetaAvailabilityParams\b".["parameter1","parameter2","parameter3"]."\a");

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*