View Full Version : Triggers with calculations
Is it possible to create a trigger like
'(({Host.SNMP.Win32.VMWARE:hrStorageUsed.last(0)} * 100) / {Host.SNMP.Win32.VMWARE:hrStorageUsed.last(0)}) <=5'
I always get an error when trying to store this in the database.
[ERROR:Invalid trigger expression]
Regards
Raf Schandevyl
Sorry Mistyped the expression
(({Host.SNMP.Win32.VMWARE:hrStorageUsed.last(0)} * 100) / {Host.SNMP.Win32.VMWARE:hrStorageSize.last(0)}) <=5
This function calculates the % off free disk space for my Machines
Regards
Raf
Try this instead:
({Host.SNMP.Win32.VMWARE:hrStorageUsed.last(0)}/{Host.SNMP.Win32.VMWARE:hrStorageSize.last(0)})<=0.05
Sorry, "<=" is not supported, use '<'.
I've tried this
({Host.SNMP.Win32.VMWARE:hrStorageUsed.last(0)}/{Host.SNMP.Win32.VMWARE:hrStorageSize.last(0)})<0.05
With no success. Still the same error.
Raf
jpawlowski
02-06-2005, 18:21
have the same problem, already reported in this forum so here should be a cross-link :-)
http://www.zabbix.com/forum/showthread.php?t=851
unfortunately still no solution...
I've tried this
({Host.SNMP.Win32.VMWARE:hrStorageUsed.last(0)}/{Host.SNMP.Win32.VMWARE:hrStorageSize.last(0)})<0.05
With no success. Still the same error.
Raf
I had a similar problem a while ago check 89
hth,
cooper
jpawlowski
03-06-2005, 09:27
no, our problem is different. we are not even able to create the trigger but get the error "Invalid trigger expression".
I succesfully added the following trigger on my test system (1.1alpha10):
({a0.system[procload].last(0)}/{a0.system[procload].last(0)})<0.05
I do not quite understand why ZABBIX refuses your trigger.
jpawlowski
03-06-2005, 11:06
i found zabbix's failure: a trigger like the above does work while the same expression only with an arithmetical minus instead of the division does not.
Works:
({Host:check_url_lastmod[URL].now(0)}/{Host:check_url_lastmod[URL].last(0)})>21600
Works not:
({Host:check_url_lastmod[URL].now(0)}-{Host:check_url_lastmod[URL].last(0)})>21600
I found my problem. You can't use spaces in the expressions.
Everthing works fine for me now.
Regards
Raf
Well, I should have done the expressions less sensible. I will fix it in 1.1.