Na tej stronie
serverinfo.get
This method allows you to retrieve the time of the last update from the given Zabbix server.
The method is available to User, Admin, Super admin, and unauthenticated users.
Method signature: object serverinfo.get(object parameters)
Method source: CServerInfo::get() in ui/include/classes/api/services/CServerInfo.php
Parameters
| Parameter | Type | Description |
|---|---|---|
| serverid | ID | ID of the Zabbix server. Parameter behavior: - Required |
| output | query | This parameter is described in the reference commentary. |
Return values
| Property | Type | Description |
|---|---|---|
| serverid | ID | Zabbix server ID. |
| lastaccess | timestamp | Time of the last update from Zabbix server. For a high availability (HA) cluster, this shows the lastaccess value of the active node. |
Examples
Retrieve server info
Retrieve information about the given Zabbix server.
{
"jsonrpc": "2.0",
"method": "serverinfo.get",
"params": {
"serverid": "019fb1f9-22bd-74ea-bc03-51efb8b76aba",
"output": "extend"
},
"id": 1
}
Response:
{
"jsonrpc": "2.0",
"result": {
"serverid": "019fb1f9-22bd-74ea-bc03-51efb8b76aba",
"lastaccess": 1785337245
},
"id": 1
}