PDA

View Full Version : Triggers with calculations


RafS
01-06-2005, 16:26
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

RafS
01-06-2005, 16:28
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

Alexei
01-06-2005, 16:33
Try this instead:

({Host.SNMP.Win32.VMWARE:hrStorageUsed.last(0)}/{Host.SNMP.Win32.VMWARE:hrStorageSize.last(0)})<=0.05

Alexei
01-06-2005, 16:33
Sorry, "<=" is not supported, use '<'.

RafS
02-06-2005, 08:51
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...

cooper
02-06-2005, 19:09
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".

Alexei
03-06-2005, 09:41
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

RafS
03-06-2005, 13:38
I found my problem. You can't use spaces in the expressions.


Everthing works fine for me now.

Regards
Raf

Alexei
03-06-2005, 14:10
Well, I should have done the expressions less sensible. I will fix it in 1.1.