How an application sensor is started

This information describes how an application sensor is started.

The GenericServerSensor runs the following commands:
On Linux®, Solaris, AIX®, and Linux on System z® operating systems
  • lsof -nP -i to get the port information
  • ps axww to get the command line information
On Windows operating systems
  • netstat.exe -nao to get the port information
  • wmic process list to get the command line information
The process ID (PID) is used to merge the output. The template matcher then operates on the merged data. When the logging level is set to DEBUG in the collation.properties file, the output of these commands is located in the following logs:
  • GenericServerSensor.log
  • DiscoverManager.log

The merged data must match the criteria that is defined in the sensor template. You can find the template criteria that starts a sensor in the following sample template definition for the DB2® sensor.

Run the following command (a redirect to a file is helpful), replacing <username> and <password> with a valid user name and associated password (for example, ...dist/sdk/bin/api.sh -u administrator -p collation find --depth=5 AppServerTemplate):
...dist/sdk/bin/api.sh -u <username> -p <password> find --depth=5 AppServerTemplate

The preceding command produces XML output that is the template definition. In the template definition, if the value for the <order> element is less than 0, the template is for a sensor. If the value for the <order> element is greater than 0, the template is for a custom server. The matching occurs starting with the lowest value for the <order> element so that is how sensors get higher matching priority than custom servers.

The following sample template definition is for the DB2 sensor. Notice the two <operand1> elements, one with a value of db2tcpcm and one with a value of db2agent. The value for the <boolExp> element indicates whether both or only one of the <operand1> values must be present. A value of 1 for the <boolExp> element indicates the logical operator OR, which means only one of the <operand1> values must be present. A value of 0 for the <boolExp> element indicates the logical operator AND, which means both of the <operand1> values must be present.

<Template array="18" guid="C1A992327AFF33409C41D5C71046DBB9"
lastModified="1177555771479"
xsi:type="coll:com.collation.platform.model.discovery.template.AppServerTemplate">
   <displayName>DB2</displayName>
   <name>DB2</name>
   <type>DatabaseServer</type>
   <internal>true</internal>
   <filterSet guid="B599AED918F436C99FDA0E8EDA578F02"
   lastModified="1177555771475" 
   parent="C1A992327AFF33409C41D5C71046DBB9"
   xsi:type="coll:com.collation.platform.model.discovery.template.FilterSet">
      <displayName>DB2</displayName>
      <filterList array="1"
      guid="BBE4D351653B37E38BFFD2DEBD532EE8"
      lastModified="1177555771476"
      parent="B599AED918F436C99FDA0E8EDA578F02" 
      xsi:type="coll:com.collation.platform.model.discovery.template.Filter">
         <displayName>unknown</displayName>
         <operand1>db2tcpcm</operand1>
         <operator>contains</operator>
         <part>Program Name</part>
      </filterList>
      <filterList array="2"
      guid="63816C902B0A317F8C3B24C7A1EEBC17"
      lastModified="1177555771471"
      parent="B599AED918F436C99FDA0E8EDA578F02" 
      xsi:type="coll:com.collation.platform.model.discovery.template.Filter">
         <displayName>unknown</displayName>
         <operand1>db2agent</operand1>
         <operator>contains</operator>
         <part>Program Name</part>
      </filterList>
      <boolExp>1</boolExp>
   </filterSet>
   <index>0</index>
   <order>-10</order>
   <enabled>true</enabled>
   <action>1</action>
   <source>0</source>
   <seedClass>com.collation.discover.seed.app.db.db2.Db2Seed</seedClass>
</Template>