selivan / selivan.github.io

my blog
https://selivan.github.io
12 stars 10 forks source link

2016/06/14/zabbix-server-agent-wrong-default-timeouts #42

Open selivan opened 6 years ago

selivan commented 6 years ago

This is the comment thread for Zabbix: unawailable items and hosts caused by wrong default timeout settings.

pida42 commented 6 years ago

Hello Pavel,

thanks for your article. I had a similar issue. Our zabbix randomly triggered hosts as unreachable for a few seconds without any logic reason. I tried to change unreachable/unavailable host settings and also timeout settings. Nothing helped resolve it.

So I changed Zabbix agent trigger Zabbix agent on {HOST.NAME} is unreachable from:

{Zabbix Agent:agent.ping.nodata(1m)}=1

to

{Zabbix Agent:agent.ping.last(0)}=0

and now everything works well.

edit: I tested this on v1.8.9

selivan commented 6 years ago

@pida42

Are you sure, that now it works as intended? Zabbix documentation says that agent.ping value is 1 or nothing, you will never get 0.

And also if last value was collected a week ago, it is still considered the last(0), if I get it correctly.

pida42 commented 6 years ago

@selivan Thanks, my mistake, it works only on older version (for me 1.8.9).

Finally did that using net.tcp.service, only if monitored host is visible for Zabbix server on network.

Item:

Type: Simple check
Key: net.tcp.service[tcp,,10050]
Type of information: Numeric (unsigned)
Show value: Host availability

Trigger:

{Template App Zabbix Agent:net.tcp.service[tcp,,10050].last()}=0

Tested version 3.4.13.

selivan commented 6 years ago

@pida42 Have you tested it by blocking the host IP on server or by turning the host off?

I suppose, when host goes down, no new values for item net.tcp.service[..] are sent to server. last() returns the last seen value which is still 1, so the trigger is not switched.

EDIT: if the check is made from server host, not from agent itself, it should work.

pida42 commented 6 years ago

@selivan

I did. I tried:

Yes, it's Simple check, so it runs from Zabbix server. It's enough for our solution.

Here is exported template: https://gist.github.com/pida42/126eeaee45ae303fe2ee549306a9208f

Thank you for your help...