Search code examples
triggersexpressionmonitoringzabbix

Zabbix Trigger Expression = NULL


i´ve a quick question regarding a zabbix trigger expression. Our script finds out the certification lifetime while returning a number into a file. I already created some triggers for specific time spans (like 10 days or 44 days).

For example:
{Certificate Lifetime:vfs.file.contents[C:\Zabbix_scripts\cert.txt].prev()}<=30 and {Certificate Lifetime:vfs.file.contents[C:\Zabbix_scripts\cert.txt].prev()}>10

I now want to have a trigger which will cause an "Disaster" when the value in the .txt file is unavailable, like the txt file is empty.

I´ve tried
{Certificate Lifetime:vfs.file.contents[C:\Zabbix_scripts\cert.txt].prev()}=0

But this was not the right sulution. Any ideas?

Moreover we have some machines which are equal to others but doesn´t show any value. Any ideas at this point?

Regards


Solution

  • You should be able to detect empty item value with something like this:

    strlen()=0