Product / Documentation / Internals /   
Internals
* Database structure
* Processing of timeouts
Database structure

Database structure

The section describes structure of tables of ZABBIX database.

ACTIONS

The table contains list of actions to be applied if a trigger changes its state.

Column nameTypeDescription
actionidintUnique action ID
triggeridintTrigger ID
scopeintScope of the actions:
  • 0 - this trigger only
  • 1 - hosts of the trigger
  • 2 - all hosts
severityintApply action if and only if trigger severity is equal or more than this value. Works for scope equal to 1 or 2.
recipientintWho gets this action:
  • 0 - User
  • 1 - User group
useridint If recipient==0, then User ID If recipient==1, then User Group ID
goodint 
subjectvarcharSubject of the message
messagevarcharThe message itself
nextcheckintTime when the message should be sent next time. Number of second since 01/01/1970.
scopeintScope of this actions:
  • 0 - this trigger
  • 1 - all triggers of this host(s)
  • 2 - all triggers of all hosts
severityintPerform action if severity of the trigger more or equal to this value. Ignored if ‘scope’=0.

ALARMS

This table contains history of changes of trigger states. When a trigger changes its state, new record is added to the table.

Column nameTypeDescription
triggeridintTrigger ID
clockintTime when trigger changed its status. Number of second since 01/01/1970.
valueint Value of the alarm:
  • 0 - trigger became FALSE
  • 1 - trigger became TRUE
  • 2 - trigger became UNKNOWN

ALERTS

This table contains history of alerts sent to users.

Column nameTypeDescription
alertidintUnique alert ID
actionidintAction ID that generated this alert
mediatypeidintID of media type
clockintTime when this alert was generated. Number of second since 01/01/1970.
typevarcharType of alert: EMAIL – email based alert sendto varchar Recipient(s). In case of EMAIL, this specifies email address. subject varchar In case of email, specifies subject of the email.
messageblobMessage
statusint
  • 0 - not sent
  • 1 - successfully sent
retriesint Number of retries. zabbix_server will not send message if the value is more than 2. Increased after unsuccessful try.

AUDIT

The table contains global configuration parameters.

Column nameTypeDescription
auditidintUnique record ID
useridintUser ID who made an action
clockintTimestamp
actionint
  • 0 - added
  • 1 - updated
  • 2 - deleted
  • 3 - login
  • 4 - logout
resourceintAffected resource:
  • 0 - User
  • 1 - ZABBIX
  • 2 - Config
  • 3 - Media type
  • 4 - Host
  • 5 - Action
  • 6 - Graph
detailsvarcharFree text

CONFIG

The table contains global configuration parameters.

Column nameTypeDescription
alarm_historyintZABBIX will delete records in table alarms older than this value (in days)
alert_historyintZABBIX will delete record in table alerts older than this value (in days)

FUNCTIONS

The table contains list of simple functions used in trigger expressions.

Column nameTypeDescription
functionidintUnique function ID
itemidintItem ID
triggeridintTrigger ID
lastvaluedoubleLast (most recent) value
functionvarcharFunction name:
  • LAST
  • MIN
  • MAX
  • PREV
  • DIFF
  • STR
  • AVG
  • COUNT
  • SUM
  • DELTA
  • CHANGE
  • ABSCHANGE
parameterintParameter to the function. Ignored if function does not need any parameters

GRAPHS

The table contains list of user-defined graphs (charts).

Column nameTypeDescription
graphidintUnique graph ID
namevarcharName of the graph
widthintGraph width
heightintGraph height
yaxistypeint
  • 0 - Min/Max Y autocalculated
  • 1 - fixed Min/Max Y
yaxisminintFixed Min Y
yaxismaxintFixed Max Y

GRAPHS_ITEMS

The table contains list of monitored items belonging to graph.

Column nameTypeDescription
gitemidintUnique ID
graphidintGraph ID
itemidintItem ID
sort_orderintSort order (0-100). 0 - draw first, 100 - draw last.
drawtypeintDraw type:
  • 0 - Line
  • 1 - Filled
  • 2 - Bold line
  • 3 - Dot
colorintColor

GROUPS

The table contains list of host groups.

Column nameTypeDescription
groupidintUnique ID
namevarcharName of the group

HISTORY

This table contains history of integer values of items.

Column nameTypeDescription
itemidintItem ID
clockintTimestamp. Number of second since 01/01/1970.
valuedoubleValue of the item

HISTORY_STR

This table contains history of string values of items.

Column nameTypeDescription
itemidintItem ID
clockintTimestamp. Number of second since 01/01/1970.
valuevarcharValue of the item

HOSTS

The table contains list of monitored Hosts.

Column nameTypeDescription
hostidintUnique host ID
hostvarcharHost name or IP address
statusintHost status:
  • 0 - monitored
  • 1 - not monitored
  • 3 - template
  • 4 - deleted (housekeeping process will delete this host)
availableintHost availability:
  • 0 - available
  • 1 - not available
disable_untilintIn case if status is unreachable, do not check host and its items until this time. Number of second since 01/01/1970.

HOSTS_GROUPS

The table is used to define linkage between hosts and host groups.

Column nameTypeDescription
hostidintHost ID
groupidintGroup ID

HOSTS_TEMPLATES

The table is used to define hard-linkage between hosts and templates.

Column nameTypeDescription
hosttemplateidintUnique ID
hostidintHostid ID
templateidintHost templateid ID
itemsint
  • 0 - do not sync items
  • 1 - sync items
triggersint
  • 0 - do not sync triggers
  • 1 - sync triggers
actionsint
  • 0 - do not sync actions
  • 1 - sync actions
graphsint
  • 0 - do not sync graphs
  • 1 - sync graphs
screensint
  • 0 - do not sync screens
  • 1 - sync screens

IMAGES

The table is used to store various images.

Column nameTypeDescription
imageidintImage ID
imagetypeintImage type:
  • 1 - icon
  • 2 - background image
nameintUnique (for a give type) image name
imageblobRaw image data, usually in PNG or JPG format

ITEMS

This table contains definitions of monitored items.

Column nameTypeDescription
itemidintUnique item ID
typeintType of the item:
  • 0 - ZABBIX agent
  • 1 - SNMPv1
  • 2 - Trapper
  • 3 - Simple check
  • 4 - SNMPv2
  • 5 - Internal
  • 6 - SNMPv3
  • 7 - Active check
value_typeintType of received values:
  • 0 - float
  • 1 - string
snmp_communityvarcharName of community for SNMP request. Example: public
snmp_oidvarcharObject ID for SNMP request
hostidintHost ID
descriptionvarcharDescription of the item
key_varcharKey to be sent to monitored host
delayintUpdate interval. Defines how often retrieve this item (in sec)
historyintDo not store more than history days of history data. Used by housekeeping process.
lastdeleteintTime of last deletion from table history
nextcheckintTime when next value should be retrieved. Number of second since 01/01/1970.
lastvaluedoubleLast value retrieved from host. For items having delta==1, this field contains modified value.
lastclockintTime when last value was retrieved. Number of second since 01/01/1970.
prevorgvaluedoublePrevious retrieved value (used for items having delta==1)
prevvaluedoublePrevious retrieved value. For items having delta==1, this field contains modified value.
trapper_hostsvarchar Comma-delimited list of IP addresses of hosts allowed sending data of the item. For item type Trapper only.
statusintStatus of the item:
  • 0 - active
  • 1 - disabled
  • 3 - not supported by agent
  • 4 - deleted (housekeeping process will delete this item)
unitsvarcharUnits of returned values. Can be empty. For example: bps, B
multiplierintMultiplier for units. If agent returns KB, then multiplier must be 1, i.e. 1024^1.
deltaint0 - normal processing, keep received value without any modifications 1 - calculate (received - previous value)/(now-time of last check) and store it in the history. For numeric values only. 2 - difference between most recent and previous values
formulavarcharFormula for calculation of received values. Currently it used as a multiplier only.
snmpv3_securitynamevarcharSNMPv3 only. Security name.
snmpv3_securitylevelvarcharSNMPv3 only. Security level.
snmpv3_authpassphrasevarcharSNMPv3 only. Passphrase.
snmpv3_privpassphrasevarcharSNMPv3 only. Pivate passphrase.
trendsintDo not store more than trends days of trend data. Used by housekeeping process.

MEDIA

This table contains list of available medias for given user.

Column nameTypeDescription
mediaidintUnique media ID
useridintUser ID
mediatypeidintMedia type ID
sendtovarcharAddress to send alert to
activeintStatus of the media:
  • 0 - active
  • 1 - disabled
severityintBit:
  • 0 - Not classified (1)
  • 1 - Information (2)
  • 2 - Warning (4)
  • 3 - Average (8)
  • 4 - High (16)
  • 5 - Disaster (32)

MEDIA_TYPE

This table contains list of available medias for given user.

Column nameTypeDescription
mediatypeidintUnique media type ID
typeint Type:
  • 0 - EMAIL
  • 1 - external script
descriptionvarcharDescription of the media type
smtp_servervarcharSMTP server. For ‘type’=0 only.
smtp_helovarcharHELO value for SMTP server. For ‘type’=0 only.
smtp_emailvarcharEmail address of ZABBIX server. For ‘type’=0 only.
exec_pathvarcharName of an external script. Example: lmt.sh

PROFILES

This table contains user settings.

Column nameTypeDescription
profileidintUnique profile ID
useridintUser ID
idxvarcharIndex for searching
valuevarcharInformation for this index

RIGHTS

The table contains list of user permissions.

Column nameTypeDescription
rightidintUnique ID
useridintUser ID
namevarcharResource name
permissioncharPermission:
  • R - read only
  • U - read and write
  • A - add
  • H - restrict access (hide)
idintResource ID

SCREENS

The table contains list of user-defined screens.

Column nameTypeDescription
screenidintUnique screen ID
namevarcharScreen name
colsintNumber of screen columns
rowsintNumber of screen rows

SCREENS_ITEMS

The table contains configuration of screen cells.

Column nameTypeDescription
screenitemidintUnique ID of the screen item
screenidintScreen ID
resourceintType of resource connected to the cell:
  • 0 - graph
  • 1 - simple graph
  • 2 - map
  • 3 - plain text values
resourceidintResource ID
widthintWidth of the displayed resource. Ignored for Map.
heightintHeight of the displayed resource. Ignored for Map.
xintCoordinate X.
yintCoordinate Y.
SERVICES

This table contains list of defined IT services.

Column nameTypeDescription
serviceidintUnique service ID
nameintDescription of the service
statusintStatus of the service
algorithmintAlgorithm used to calculate status of the service:
  • 0 - none
  • 1 - MAX status of child services
  • 2 - MIN status of child services
triggeridintIs the service linked to the trigger: NULL – it is not otherwise, trigger ID
sortorderintDefines sort order for IT Service form.
goodslafloatAcceptable SLA (in %). Example: 99.5

SERVICE_ALARMS

This table is used to store history of state changes of IT Services.

Column nameTypeDescription
servicealarmidintUnique ID
serviceidintID of IT Service
clockintTimestamp. Number of second since 01/01/1970.
valueint[explain ...]

SERVICES_LINKS

This table is used to define connections between different services to form IT Service tree.

Column nameTypeDescription
linkidintUnique link ID
serviceupidintID of higher level service
servicedownidintID of lower level service
softint
  • 0 - hard link
  • 1 - soft link

SESSIONS

The table contains list of user sessions.

Column nameTypeDescription
sessionidvarcharUser ID
useridintUser ID
lastaccessintLast time the session was used

SYSMAPS

The table contains list of defined network maps.

Column nameTypeDescription
sysmapidintUnique network map ID
namevarcharName of the network map
widthintWidth of the map
heightintHeight of the map
backgroundintName of background image.
label_typeintIcon label type.
  • 0 - host label
  • 1 - IP address
  • 2 - host name
  • 3 - empty

SYSMAPS_HOSTS

The table contains definition of host displayed on network map.

Column nameTypeDescription
shostidintUnique ID
sysmapidintNetwork map ID
hostidintHost ID
iconvarcharIcon name. Display this icon when host is in OK state.
icon_onvarcharIcon name. Display this icon when host has problems.
labelvarcharLabel displayed under host icon
xintX
yintY
urlvarcharIf not empty, defines URL for displayed icon.

SYSMAPS_LINKS

The table contains list of connectors between hosts displayed on network map.

Column nameTypeDescription
linkidintUnique link ID
sysmapidintNetwork map ID
shostid1intID of first host
shostid2intID of second host
triggeridintID of trigger connected to this link. Can be NULL.
drawtype_offintDraw type when trigger is in state FALSE:
  • 0 - Line
  • 2 - Bold line
  • 4 - Dashed Line
color_offvarcharColor when trigger is in state FALSE:
  • 0 - Line
  • 2 - Bold line
  • 4 - Dashed Line
drawtype_onintDraw type when trigger is in state TRUE:
  • 0 - Line
  • 2 - Bold line
color_onvarcharColor when trigger is in state TRUE:
  • 0 - Line
  • 2 - Bold line

TRENDS

This table contains hourly averages of history of integer values of items.

Column nameTypeDescription
itemidintItem ID
clockintTimestamp (we are interested in hour only). Number of second since 01/01/1970.
value_mindoubleMinimum
value_maxdoubleMaximum
value_avgdoubleAverage
numintNumber of values of this hour

TRIGGERS

The table contains list of triggers.

Column nameTypeDescription
triggeridintUnique trigger ID
expressionvarcharTrigger's expression
urlvarcharURL
descriptionvarcharDescription of the trigger
statusintStatus of the trigger:
  • 0 - enabled
  • 1 - disabled
valueintValue of the trigger:
  • 0 - FALSE
  • 1 - TRUE
  • 2 - UNKNOWN
priorityintSeverity of the trigger:
  • 0 - not classified
  • 1 - just for information
lastchangeintTime when trigger value was changed
dep_levelintDependency level. The number shows how many triggers depend on this trigger.

TRIGGER_DEPENDS

The table contains list of trigger dependencies.

Column nameTypeDescription
triggerid_downintTrigger ID
triggerid_upintTrigger ID. This trigger depends of triggerid_down.

USERS

The table contains list of ZABBIX’s users.

Column nameTypeDescription
useridintUnique user ID
namevarcharName of the user
surnamevarcharSurname of the user
aliasvarcharShort name of the user
passwdvarcharMD5 hash of user password
urlvarcharInitial URL after login. Ignored if empty.

USERS_GROUPS

The table contains relationship between users and user groups.

Column nameTypeDescription
usrgrpidintUser group ID
useridintUser ID

USRGRP

The table contains list of user groups.

Column nameTypeDescription
usrgrpidintUnique user group ID
namevarcharName of the user group