Skip to content

zabbix

Zabbix API curl

#LOGIN
curl -i -X POST -H 'Content-type:application/json' -d '{"jsonrpc":"2.0","method":"user.login","params":{ "user":"myUserName","password":"myPassword"},"auth":null,"id":0}' https://zabbix.server/api_jsonrpc.php

#GET ALL HOSTS WITH NAME
curl -i -X POST -H 'Content-type:application/json' -d '{"jsonrpc":"2.0","method":"host.get","params":{"output": ["hostid", "name"]},"auth":"<AUTH_KEY>","id":0}' https://zabbix.server/api_jsonrpc.php

#GET ALL HOSTS WITH NAME, HOSTNAME AND IP ADDRESS
curl -i -X POST -H 'Content-type:application/json' -d '{"jsonrpc":"2.0","method":"host.get","params":{"output":["hostid", "host", "name"], "selectInterfaces":["ip"]},"auth":"<AUTH_KEY>","id":0}' https://zabbix.server/api_jsonrpc.php

Zabbix trigger hysteresis

Hysteresis, in the context of triggers and monitoring, describes a property of systems that do not instantly follow the variables they are responding to, but react slower or have a delayed output.

Essentially, in a monitoring system, hysteresis is implemented to prevent false trigger alarms, or "flapping", which is when a system rapidly alternates between states. This could occur, for example, if a measured value fluctuates around a threshold limit. Without hysteresis, each crossing of the threshold would trigger an alarm, leading to numerous unnecessary notifications.

By implementing hysteresis, you create a buffer, or a deadband, which means a set range that the value has to pass through before an alarm is triggered. This deadband has two thresholds: a set threshold for triggering the alarm and a reset threshold to stop the alarm. For instance, if you're monitoring internet uplink and you set the alarm threshold at 90% usage, you might set your reset threshold at 85%. The alarm won't stop until the usage drops below 85%, even if it briefly dips below 90%. This prevents the system from triggering a stop alarm immediately after it dips below 90% and then a start alarm when it inevitably goes back over 90%.