zabgrab.model.item

Item specifications: how the user selects Zabbix items.

Classes

ItemSpec(*[, itemid, host, name, key, tag])

Selects one item by ID, or any number of items by pattern.

class zabgrab.model.item.ItemSpec(*, itemid=None, host=None, name=None, key=None, tag=None)[source]

Bases: BaseModel

Selects one item by ID, or any number of items by pattern.

Patterns match like the Zabbix API’s searches: the whole value, ignoring case, with * matching any text (so *CPU* finds CPU anywhere). All given patterns must match.

Parameters:
  • itemid (Annotated[int, Gt(gt=0)] | None)

  • host (Annotated[Annotated[str, FieldInfo(annotation=NoneType, required=True, metadata=[MinLen(min_length=1)]), Tag(tag=<value>)] | Annotated[Choice[Annotated[str, FieldInfo(annotation=NoneType, required=True, metadata=[MinLen(min_length=1)])]], Tag(tag=<choice>)], Discriminator(discriminator=~zabgrab.model.choice._discriminate, custom_error_type=None, custom_error_message=None, custom_error_context=None)] | None)

  • name (Annotated[str, FieldInfo(annotation=NoneType, required=True, metadata=[MinLen(min_length=1)])] | None)

  • key (Annotated[str, FieldInfo(annotation=NoneType, required=True, metadata=[MinLen(min_length=1)])] | None)

  • tag (Annotated[str, FieldInfo(annotation=NoneType, required=True, metadata=[MinLen(min_length=1)])] | None)

itemid

A single item’s ID; can’t be combined with patterns.

Type:

int or None

host

A pattern for the host’s technical or visible name, or a choice of them.

Type:

str or Choice of str or None

name

A pattern for the item’s name.

Type:

str or None

key

A pattern for the item’s key.

Type:

str or None

tag

A tag the item must have: "name" or "name:value".

Type:

str or None

model_config = {'extra': 'forbid', 'frozen': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].