Hi everyone, I'ved some difficulties with zabbix API when i get item objects.
Exist a someway to get item last value, using the API, with the preprocessing aplicate ? Or the unique form is aplicate the preproccesment with a programming language after get the data?
Exemple:
{
"jsonrpc": "2.0",
"method": "item.get",
"params": {
"output": "extend",
"hostids": "10603",
"with_triggers": true,
"selectValueMap": ["mappings"],
"selectPreprocessing": "extend",
"search": {
"key_": ""
},
"sortfield": "name"
},
"id": 1,
"auth": "*********************"
}
Response:
{
"itemid": "54714",
"type": "20",
"snmp_oid": "1.3.6.1.2.1.31.1.1.1.15.37",
"hostid": "10603",
"name": "Interface XGigabitEthernet0/0/31(): Speed",
"key_": "net.if.speed[ifHighSpeed.37]",
"delay": "5m",
"value_type": "3",
"preprocessing": [
{
"type": "1",
"params": "1000000",
"error_handler": "0",
"error_handler_params": ""
},
{
"type": "20",
"params": "1h",
"error_handler": "0",
"error_handler_params": ""
}
],
"valuemap": [],
"parameters": [],
"lastclock": "1709602313",
"lastns": "444924369",
"lastvalue": "10000000000", -> How to apply preprocessing on this value in every API call and, if possible, apply value map
"prevvalue": "10000000000"
},
Thank you very much in advance
Exist a someway to get item last value, using the API, with the preprocessing aplicate ? Or the unique form is aplicate the preproccesment with a programming language after get the data?
Exemple:
{
"jsonrpc": "2.0",
"method": "item.get",
"params": {
"output": "extend",
"hostids": "10603",
"with_triggers": true,
"selectValueMap": ["mappings"],
"selectPreprocessing": "extend",
"search": {
"key_": ""
},
"sortfield": "name"
},
"id": 1,
"auth": "*********************"
}
Response:
{
"itemid": "54714",
"type": "20",
"snmp_oid": "1.3.6.1.2.1.31.1.1.1.15.37",
"hostid": "10603",
"name": "Interface XGigabitEthernet0/0/31(): Speed",
"key_": "net.if.speed[ifHighSpeed.37]",
"delay": "5m",
"value_type": "3",
"preprocessing": [
{
"type": "1",
"params": "1000000",
"error_handler": "0",
"error_handler_params": ""
},
{
"type": "20",
"params": "1h",
"error_handler": "0",
"error_handler_params": ""
}
],
"valuemap": [],
"parameters": [],
"lastclock": "1709602313",
"lastns": "444924369",
"lastvalue": "10000000000", -> How to apply preprocessing on this value in every API call and, if possible, apply value map
"prevvalue": "10000000000"
},
Thank you very much in advance
Comment