PDA

View Full Version : OR with AND conditions


atlantiatech
05-01-2010, 01:15
I am trying to setup a host for monitoring. I have my actions based on the AND/OR trigger of 4 conditions.

Example:

TYPE AND/OR

Conditions
(A) Trigger = "Asterisk is not running on Asterisk Rackspace"
(B) Trigger = "ICMP Simple Check"
(C) Trigger = "Asterisk Rackspace has just been restarted"
(D) Trigger = "Server Asterisk Rackspace is unreachable"

now I want to add a straight AND

(E) Trigger = "ICMP Simple Check - Ping Google" (or something similar)

(I have the host google created and the item setup)

Can I force it to confirm that it can reach a sane internet destination before it spams me with notifications??

- Speaking of which, any way to tell ZABBIX to send notifications X per a period of time only?

Thanks in advance

zabbix_zen
06-01-2010, 19:34
Sure.

If I understood correctly you're looking for (A OR B OR C OR D) AND E.
You can achieve this by selecting the check boxes A,B,C,D with the OR operator, saving, and adding the E checkbox with the AND operator afterwards.

any way to tell ZABBIX to send notifications X per a period of time only?
You just need to add something like the following conditions
(F) Time period in "1-7,00:00-05:59"
(G) Time period in "1-7,23:15-23:59"

this way,
..... E AND (F OR G)

atlantiatech
06-01-2010, 20:15
Thank you for your response,

If I understood correctly you're looking for (A OR B OR C OR D) AND E.
You can achieve this by selecting the check boxes A,B,C,D with the OR operator, saving, and adding the E checkbox with the AND operator afterwards.

I just tried this, and here's how it behaves for me:

If I change the operator drop down it changes the

"Type of calculation" AND/OR (A or B or C or D)

to

"Type of calculation" AND (A and B and C and D)

regardless of the checkboxes.

If I add it a new one it becomes (A and B and C and D and E) and applies the dropdown to all of them still, regardless of the checkbox.

You just need to add something like the following conditions
(F) Time period in "1-7,00:00-05:59"
(G) Time period in "1-7,23:15-23:59"

I may have miscommunicated the need. I mean more about frequency of notification, I could be wrong but I have noticed on occasion zabbix would rapid fire notifications to me. This may have been to a quickly changing state of an issue though. (like intermittent network drops)

Is it supposed to send only one notification per item event? I know there is a period of time to check each item.


Thanks again

zabbix_zen
06-01-2010, 21:34
Sorry.

I was thinking by heart.

What you need to do is add A, B, C, D conditions with the OR operator,
save and add E condition with the AND/OR operator.
it will result in the following
(A OR B OR C OR D) AND E

Zabbix configuration flow respects the following order:
Host -> Items -> Triggers -> Actions

thus, if an Action is only called when a certain value/condition is passed(Triggered)
to increase the frequency the Action is called, you must increase the Item's refresh rate(don't push it too far or Server load will also increase).

atlantiatech
06-01-2010, 22:21
Yes, I tried that as well (adding the AND trigger as a new one after saving).

Maybe this is something broken in this version of Zabbix? (1.6.6)

I'll upgrade to 1.8 tomorrow and see the differences. I am probably past due anyways.

zabbix_zen
07-01-2010, 12:17
It's not broken.
I've been successfully doing this since my first 1.6.x installation.

Follow my previous post directions.
After saving the ORed 1st conditions you've to add the AND/OR operator, not the AND one.

atlantiatech
07-01-2010, 18:01
Hmm...

Ok so it is completely a problem with which Trigger I wanted to add as an "and".

If I try

(A) Trigger = "Asterisk is not running on Rose Hill Indigo iPBX"
(B) Trigger = "Rose Hill Indigo iPBX has just been restarted"
(C) Trigger = "Server Rose Hill Indigo iPBX is unreachable"

and then add

(D) Trigger = "ICMP Simple Check" (on google.com)

it says (A or B or C or D)

but if I use Host = Google.com, as E it says

(A or B or C or D) and (E)

What I want is

(A) Trigger = "Asterisk is not running on Rose Hill Indigo iPBX"
or
(B) Trigger = "Rose Hill Indigo iPBX has just been restarted"
or
(C) Trigger = "Server Rose Hill Indigo iPBX is unreachable"

and

(D) Trigger = ICMP Simple Check (www.google.com)
and
(E) Value = OK

I am obviously doing something wrong here.

and a screen shot of my attempt

http://imgur.com/KXuFC

atlantiatech
08-01-2010, 02:33
Just wanted to add I appreciate the help. I believe you are right, just not sure what I am doing wrong. :D

zabbix_zen
08-01-2010, 11:25
Here I explained for (A or B or C or D) AND (E)
What you need to do is add A, B, C, D conditions with the OR operator,
save and add E condition with the AND/OR operator.


If your goal is
(A or B or C) AND (D) AND (E)

you've already almost accomplished it.


you just have to add A, B, C as an 'OR' condition and
the following ones: D, E as an 'AND/OR' one.

The thing is, to obtain a mixed AND&OR expression you either start some conditions with an 'AND' or 'OR',
and afterwards you can use the 'AND/OR' operator to get the mirrored first operator(AND -> OR , or, OR -> AND)

Cheers,
Joćo