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 name | Type | Description |
| actionid | int | Unique action ID |
| triggerid | int | Trigger ID |
| scope | int | Scope of the actions:
0 this trigger only
1 hosts of the trigger
2 all hosts |
| severity | int | Apply action if and only if
trigger severity is equal or more than this value. Works for scope equal to 1 or 2. |
| recipient | int | Who gets this action:
0 User
1 User group |
| userid | int |
If recipient==0, then User ID
If recipient==1, then User Group ID |
| good | int | |
| subject | varchar | Subject of the message |
| message | varchar | The message itself |
| nextcheck | int | Time when the message should be sent next time. Number of second since 01/01/1970. |
| scope | int | Scope of this actions:
0 this trigger
1 all triggers of this host(s)
2 all triggers of all hosts |
| severity | int | Perform 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 name | Type | Description |
| triggerid | int | Trigger ID |
| clock | int | Time when trigger changed its status. Number of second since 01/01/1970. |
| value | int |
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 name | Type | Description |
| alertid | int | Unique alert ID |
| actionid | int | Action ID that generated this alert |
| mediatypeid | int | ID of media type |
| clock | int | Time when this alert was generated. Number of second since 01/01/1970. |
| type | varchar | Type 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. |
| message | blob | Message |
| status | int | 0 not sent
1 successfully sent |
| retries | int |
Number of retries. zabbix_suckerd will not send message if the value is more than 2. Increased after unsuccessful try. |
CONFIG
The table contains global configuration parameters.
| Column name | Type | Description |
| alarm_history | int | ZABBIX will delete records in table alarms older than this value (in days) |
| alert_history | int | ZABBIX 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 name | Type | Description |
| functionid | int | Unique function ID |
| itemid | int | Item ID |
| triggerid | int | Trigger ID |
| lastvalue | double | Last (most recent) value |
| function | varchar | Function name: LAST, MIN, MAX, PREV, DIFF, STR, AVG, COUNT,SUM, DELTA,
CHANGE, ABSCHANGE |
| parameter | int | Parameter to the function. Ignored if function does not need any parameters |
GRAPHS
The table contains list of user-defined graphs (charts).
| Column name | Type | Description |
| graphid | int | Unique graph ID |
| name | varchar | Name of the graph |
| width | int | Graph width |
| height | int | Graph height |
GRAPHS_ITEMS
The table contains list of monitored items belonging to graph.
| Column name | Type | Description |
| gitemid | int | Unique ID |
| graphid | int | Graph ID |
| itemid | int | Item ID |
| sort_order | int | Sort order (0-100). 0 draw first, 100 draw last. |
| drawtype | int | Draw type:
0 Line
1 Filled
2 Bold line
3 - Dot |
| color | int | Color |
GROUPS
The table contains list of host groups.
| Column name | Type | Description |
| groupid | int | Unique ID |
| name | varchar | Name of the group |
HISTORY
This table contains history of integer values of items.
| Column name | Type | Description |
| itemid | int | Item ID |
| clock | int | Timestamp. Number of second since 01/01/1970. |
| value | double | Value of the item |
HISTORY_STR
This table contains history of string values of items.
| Column name | Type | Description |
| itemid | int | Item ID |
| clock | int | Timestamp. Number of second since 01/01/1970. |
| value | varchar | Value of the item |
HOSTS
The table contains list of monitored Hosts.
| Column name | Type | Description |
| hostid | int | Unique host ID |
| host | varchar | Host name or IP address |
| status | int | Host status:
0 monitored
1 not monitored
2 unreachable
3 template
4 deleted (housekeeping process will delete this host) |
| disable_until | int | In 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 name | Type | Description |
| hostid | int | Host ID |
| groupid | int | Group ID |
ITEMS
This table contains definitions of monitored items.
| Column name | Type | Description |
| itemid | int | Unique item ID |
| type | int | Type of the item:
0 ZABBIX agent
1 SNMPv1
2 Trapper
3 Simple check
4 SNMPv2
5 - Internal |
| value_type | int | Type of received values:
0 float
1 string |
| snmp_community | varchar | Name of community for SNMP request.
Example: public |
| snmp_oid | varchar | Object ID for SNMP request |
| hostid | int | Host ID |
| description | varchar | Description of the item |
| key_ | varchar | Key to be sent to monitored host |
| delay | int | Update interval. Defines how often retrieve this item (in sec) |
| history | int | Do not store more than history days of history data |
| lastdelete | int | Time of last deletion from table history |
| nextcheck | int | Time when next value should be retrieved. Number of second since 01/01/1970. |
| lastvalue | double | Last value retrieved from host.
For items having delta==1, this field contains modified value. | |
| lastclock | int | Time when last value was retrieved. Number of second since 01/01/1970. |
| prevorgvalue | double | Previous retrieved value (used for items having delta==1) |
| prevvalue | double | Previous retrieved value.
For items having delta==1, this field contains modified value. |
| trapper_hosts | varchar |
Comma-delimited list of IP addresses of hosts allowed sending data of the item. For item type Trapper only. |
| status | int | Status of the item:
0 active
1 disabled
3 not supported by agent
4 deleted (housekeeping process will delete this item) |
| units | varchar | Units of returned values. Can be empty.
For example: bps, B |
| multiplier | int | Multiplier for units. If agent returns KB, then multiplier must be 1, i.e. 1024^1. |
| delta | int | 0 - 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. |
MEDIA
This table contains list of available medias for given user.
| Column name | Type | Description |
| mediaid | int | Unique media ID |
| userid | int | User ID |
| mediatypeid | int | Media type ID |
| sendto | varchar | Address to send alert to |
| active | int | Status of the media:
0 active
1 disabled |
| severity | int | Bit:
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 name | Type | Description |
| mediatypeid | int | Unique media type ID |
| type | int |
Type:
0 EMAIL
1 external script |
| description | varchar | Description of the media type |
| smtp_server | varchar | SMTP server. For type=0 only. |
| smtp_helo | varchar | HELO value for SMTP server. For type=0 only. |
| smtp_email | varchar | Email address of ZABBIX server. For type=0 only. |
exec_pathvarchar | Name of an external script.
Example:
lmt.sh |
PROFILES
This table contains user settings.
| Column name | Type | Description |
| profileid | int | Unique profile ID |
| userid | int | User ID |
| idx | varchar | Index for searching |
| value | varchar | Information for this index |
RIGHTS
The table contains list of user permissions.
| Column name | Type | Description |
| rightid | int | Unique ID |
| userid | int | User ID |
| name | varchar | Resource name |
| permission | char | Permission:
R read only
U read and write
A add
H restrict access (hide) |
| id | int | Resource ID |
SCREENS
The table contains list of user-defined screens.
| Column name | Type | Description |
| screenid | int | Unique screen ID |
| name | varchar | Screen name |
| cols | int | Number of screen columns |
| rows | int | Number of screen rows |
SCREENS_ITEMS
The table contains configuration of screen cells.
| Column name | Type | Description |
| screenitemid | int | Unique ID of the screen item |
| screenid | int | Screen ID |
| resource | int | Type of resource connected to the cell:
0 graph
1 simple graph
2 map |
| resourceid | int | Resource ID |
| width | int | Width of the displayed resource. Ignored for Map. |
| height | int | Height of the displayed resource. Ignored for Map. |
| x | int | Coordinate X. |
| y | int | Coordinate Y. |
SERVICES
This table contains list of defined IT services.
| Column name | Type | Description |
| serviceid | int | Unique service ID |
| name | int | Description of the service |
| status | int | Status of the service |
| algorithm | int | Algorithm used to calculate status of the service:
0 none
1 MAX status of child services
2 MIN status of child services |
| triggerid | int | Is the service linked to the trigger:
NULL it is not
otherwise, trigger ID |
| sortorder | int | Defines sort order for IT Service form. |
| goodsla | float | Acceptable SLA (in %).
Example:
99.5 |
SERVICE_ALARMS
This table is used to store history of state changes of IT Services.
| Column name | Type | Description |
| servicealarmid | int | Unique ID |
| serviceid | int | ID of IT Service |
| clock | int | Timestamp. Number of second since 01/01/1970. |
| value | int | [explain ...] |
SERVICES_LINKS
This table is used to define connections between different services to form IT Service tree.
| Column name | Type | Description |
| linkid | int | Unique link ID |
| serviceupid | int | ID of higher level service |
| servicedownid | int | ID of lower level service |
| soft | int | 0 hard link
1 soft link |
SESSIONS
The table contains list of user sessions.
| Column name | Type | Description |
| sessionid | varchar | User ID |
| userid | int | User ID |
| lastaccess | int | Last time the session was used |
SYSMAPS
The table contains list of defined network maps.
| Column name | Type | Description |
| sysmapid | int | Unique network map ID |
| name | varchar | Name of the network map |
| width | int | Width of the map |
| height | int | Height of the map |
SYSMAPS_HOSTS
The table contains definition of host displayed on network map.
| Column name | Type | Description |
| shostid | int | Unique ID |
| sysmapid | int | Network map ID |
| hostid | int | Host ID |
| label | varchar | Label displayed under host icon | |
| x | int | X |
| y | int | Y |
SYSMAPS_LINKS
The table contains list of connectors between hosts displayed on network map.
| Column name | Type | Description |
| linkid | int | Unique link ID |
| sysmapid | int | Network map ID |
| shostid1 | int | ID of first host |
| shostid2 | int | ID of second host |
| triggerid | int | ID of trigger connected to this link. Can be NULL. |
| drawtype_off | int | Draw type when trigger is in state FALSE:
0 Line
2 Bold line
4 Dashed Line |
| color_off | varchar | Color when trigger is in state FALSE:
0 Line
2 Bold line
4 Dashed Line |
| drawtype_on | int | Draw type when trigger is in state TRUE:
0 Line
2 Bold line |
| color_on | varchar | Color 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 name | Type | Description |
| itemid | int | Item ID |
| clock | int | Timestamp (we are interested in hour only). Number of second since 01/01/1970. |
| value_min | double | Minimum |
| value_max | double | Maximum |
| value_avg | double | Average |
| num | int | Number of values of this hour |
TRIGGERS
The table contains list of triggers.
| Column name | Type | Description |
| triggerid | int | Unique trigger ID |
| expression | varchar | Triggers expression |
| url | varchar | URL |
| description | varchar | Description of the trigger |
| status | int | Status of the trigger:
0 enabled
1 disabled |
| value | int | Value of the trigger:
0 FALSE
1 TRUE
2 UNKNOWN |
| priority | int | Severity of the trigger:
0 not classified
1 just for information
|
| lastchange | int | Time when trigger value was changed |
| dep_level | int | Dependency level. The number shows how many triggers depend on this trigger. |
TRIGGER_DEPENDS
The table contains list of trigger dependencies.
| Column name | Type | Description |
| triggerid_down | int | Trigger ID |
| triggerid_up | int | Trigger ID. This trigger depends of triggerid_down. |
USERS
The table contains list of ZABBIXs users.
| Column name | Type | Description |
| userid | int | Unique user ID |
| name | varchar | Name of the user |
| surname | varchar | Surname of the user |
| alias | varchar | Short name of the user |
| passwd | varchar | MD5 hash of user password |
USERS_GROUPS
The table contains relationship between users and user groups.
| Column name | Type | Description |
| usrgrpid | int | User group ID |
| userid | int | User ID |
USRGRP
The table contains list of user groups.
| Column name | Type | Description |
| usrgrpid | int | Unique user group ID |
| name | varchar | Name of the user group |
|