On this page
5 Protocollo Zabbix sender
Panoramica
Il server Zabbix e il proxy Zabbix utilizzano un protocollo di comunicazione basato su JSON per la ricezione di dati da Zabbix sender. I dati possono essere ricevuti tramite un elemento trapper, o un elemento agente HTTP con il trapping abilitato.
I messaggi di richiesta e risposta devono iniziare con intestazione e lunghezza dati.
Richiesta Zabbix sender
{
"request": "sender data",
"data": [
{
"host": "<hostname>",
"key": "trap",
"value": "test value"
}
]
}
Risposta del server Zabbix
{
"response": "success",
"info": "processed: 1; failed: 0; total: 1; seconds spent: 0.060753"
}
Richiesta di Zabbix sender con un timestamp
In alternativa, Zabbix sender può inviare una richiesta con un timestamp e nanosecondi.
{
"request": "sender data",
"data": [
{
"host": "<hostname>",
"key": "trap",
"value": "test value",
"clock": 1516710794,
"ns": 592397170
},
{
"host": "<hostname>",
"key": "trap",
"value": "test value",
"clock": 1516710795,
"ns": 192399456
}
],
"clock": 1516712029,
"ns": 873386094
}
Risposta del server Zabbix
{
"response": "success",
"info": "processed: 2; failed: 0; total: 2; seconds spent: 0.060904"
}