I have configured a web scenario and 100 web URL's in it. I have to configure a trigger that if any URL is down we get an email alert. Please help on this.
Ad Widget
Collapse
How to add email alert if URL show error.
Collapse
X
-
Tags: None
-
Hello,
In order to add email alert you must create a trigger action. This action will be executed when trigger state changes from OK to PROBLEM state and back(see documentation https://www.zabbix.com/documentation...cations/action). You can add additional conditions for actions basing on trigger name, tags and etc if you want to have a dedicated notification for web scenario failures.
However actions will not be executed if proper trigger is not configured. One of the web scenario triggers example from documentation(https://www.zabbix.com/documentation...toring/items):
To create a “Web scenario failed” trigger with a useful problem description in the trigger name, you can define a trigger with name:
Web scenario "Scenario" failed: {ITEM.VALUE}
and trigger expression:
Make sure to replace 'Scenario' with the real name of your scenario.Code:{host:web.test.error[Scenario].strlen()}>0 and {host:web.test.fail[Scenario].last()}>0 -
Are you asking what expression you need in the trigger or how to generate the emails or both?
Here is what I use for a Web Scenario trigger on one of our sites.
I have the scenario set to look for a specific substring on the page the given URL returns and if it gets a 200 response. If it does not get a 200 response from the website for more than 60 seconds then it fails the Availability check and the trigger firesCode:{WebsiteTemplate:web.test.fail[{$URL} Availibility].last(60)}>0Comment
-
I have one web scenario in the scenario I have 100 URLs. I have configured the one trigger for it that I am able to get alert if URL in problem state. I want to know that I have to create 100 triggers or One
the trigger is sufficient for 100 URLs. Please help on this.Comment
-
Rahullinux,
You don't need to create a 100 trigger. You may use this trigger expression:
{host:web.test.fail[Scenario].last()}>0 It returns 0 if all web scenario steps were successful. In case if any failed then it returns number of failed step.Comment
-
Valentines Thanks for your reply.
I have configured the trigger and I have also received the alert but the issue I don't get the name of URL which is down. So it great if you tell how can I will get the URL name in an email:-
Problem started at 03:14:53 on 2019.11.06 Problem name: url monitor Host: test Severity: Warning Original problem ID: 1225 Can you help on this
Comment
-
You can try this option.
Put two expressions for the trigger
Then add following to the Trigger description:Code:{host:web.test.error[Scenario].strlen()}>0 and {host:web.test.fail[Scenario].last()}>0
Scenario step: {ITEM.VALUE2} //Last value of second item in trigger expression
Error description: {ITEM.VALUE1} //Last value of first item in trigger expression
Then in action you can use macro {TRIGGER.DESCRIPTION} which will populate your notification with number of step that failed and error message received.Comment
-
-
-
-
Do you have the Description field at very bottom of trigger configuration? I don't see the whole configuration on your screenshot.
Put these two lines into description field.
Code:Scenario step: {ITEM.VALUE2} Error description: {ITEM.VALUE1}Comment
-
Comment
-
Comment
-
Comment
-
Rahullinux,
As far as i know there is no opportunity to get the exact URL but you can see the failed step(2) and then go to Web Scenario configuration, locate this step and see the URL and other parameters applied to this step.Comment
Comment