PDA

View Full Version : Which Marco for error notification?


cphowdy
14-07-2008, 11:21
Hey guys,

I observe a lot websites with (this great tool ) zabbix. But somtimes there appear some errors like "page didn't match" or "timeout reached". I do use the notification and it's working fine. BUT , I want to add a Macro that tells me which errors occured. For example:

{HOSTNAME}:
{TRIGGER.NAME}: {STATUS}
Datum: {DATE} Uhrzeit: {TIME}
Gescheitert am Schritt Nummer:{ITEM.LASTVALUE}
Priorität: {TRIGGER.SEVERITY}
Error: {???? don't know which marco to use} <-- that's my problem
There should be: " Error: Page didn't match / Timeout reached

I hope you know what I mean!

Thanks

cphowdy
14-07-2008, 16:12
does anybody have an idea?

cphowdy
16-07-2008, 14:50
hey guys
I solved the problem on my own. We wanted a (email) error notification that looks like that:
subject: www.google.de webtest failed: ON (step 3)
Error: Page didn't match or Couldn't resolve hostname ...

It's a bit tricky but we managed it :D
You have to use a script for email or sms service (save it in /home/www/zabbix/bin/scriptname). Our script is the following:


<?php
$link = mysql_connect('localhost', 'user', 'password');
mysql_select_db('zabbix', $link);
$result = mysql_query('SELECT error FROM httptest WHERE name="'.$argv[3].'"');
$row = mysql_fetch_array($result);
mysql_close($link);

mail($argv[1], $argv[2], $row[0]);
?>


Add this script into the available mediatype and afterwards select a user who is ought to be informed and choose Skript as medium.

Hope I could help you with that!
See you

It's also possbile to send this notification via SMS. If you want the script ... just pay for a round ;) or just ask me for it.