target


Description

This table contains the most up to date information on what all the scouts/collectors should be targetting. Any time a new device is discovered, queries are run to determine if this device needs to be targeted for a given collector (based on target, eligible, stop and avoid list) for a given scantype (based on collector configuration). Apart from calculating in real time, query is also run every 24 hours that goes through all devices for a zone and inserts/updates/deletes records in this table to make it up to date with curent discovery and configuration data. It is parent table that is partitioned over zone schema. Entries from this table are returned when collectors request their next set of targets

Columns

Column Type Size Nulls Auto Default Children Parents Comments
id serial 10 nextval('zone.target_id_seq'::regclass)
target_highpriority.target_id fk_target_hp_target C

Unique identifier for target record

zone_id int4 10 null
zone.id fk_target_zone R

Zone Id for target record. It maps to system.zone.id.

collector_id int4 10 null
collector.id fk_target_collector C

Collector Id for target record. It maps to system.collector.id

device_id int4 10 null
device.id fk_target_device C

Device Id for target record. It maps to zone.device.id

route_id int4 10 null
route.id fk_target_route C

Route Id for target record. It maps to zone.route.id

cidr_id int4 10 null
attribute_cidr.id fk_target_cidr C

CIDR Id for target record. For each target CIDR entry, there will be one entry for host/path for collector that has host or path configured. It maps to zone.attribute_cidr.id

cidrval cidr 2147483647 null

Actual IP/CIDR that needs to be targeted. Having value in this record avoids extra joins with attribute_cidr, device or route tables.

scantype_id int4 10 null
scantype.id fk_target_scantype R

Scan Type / Discovery Type Id for target record. It maps to zone.scantype.id

details text 2147483647 null

Used to store target speicfic metadata. It holds extra configuration values that are being used by collectors.

last_target timestamp 29,6 null

Timestamp when this target was picked up by a collector last. It is set to null when it is yet to be picked up. When collector asks for next set of records, records with null last_target will get picked up first. If value is non null, targets will be picked up if time elapsed since last_update is greater than rescan interval of a collector.

batchid int4 10 null

A serial number that gets inserted each time a collector is given list of targets. It contains nextval('zone.target_batch_id').

ordid float4 8,8 random()

A Random value used to distribute targets. When collector requests next set of targets, query performs order by ordid before returning target list

expandedconfig text 2147483647 null

Not being used.

Table contained 0 rows

Indexes

Constraint Name Type Sort Column(s)
pk_target Primary key Asc id
idx_target_cidr Performance
idx_target_cidr_id Performance Asc cidr_id
idx_target_colcidr Performance Asc/Asc collector_id + cidrval
idx_target_colcidrst Performance Asc/Asc/Asc collector_id + scantype_id + cidrval
idx_target_collt Performance Asc/Asc collector_id + last_target
idx_target_colordid Performance Asc/Asc collector_id + ordid
idx_target_colscancidr_gist Performance Asc/Asc collector_id + scantype_id
idx_target_device_id Performance Asc device_id
idx_target_route_id Performance Asc route_id
idx_target_scantype_id Performance Asc scantype_id
uk_target Must be unique Asc/Asc/Asc/Asc cidrval + collector_id + zone_id + scantype_id

Relationships