In order to have a link to the graph(s) which cause a trigger became ON, I have made a little patch.
However, I know, is not very good : it give a link not to graph bug trigger page, and have hard-coded link.
I decide to put the patch here, because somebody more efficient to me in C language can complete it.
However, I know, is not very good : it give a link not to graph bug trigger page, and have hard-coded link.
I decide to put the patch here, because somebody more efficient to me in C language can complete it.
Code:
diff -ru zabbix-1.1-orig/src/zabbix_server/expression.c zabbix-1.1/src/zabbix_server/expression.c
--- zabbix-1.1/src/zabbix_server/expression.c 2006-06-08 15:21:33.000000000 +0200
+++ zabbix-1.1-orig/src/zabbix_server/expression.c 2006-07-19 14:03:05.000000000 +0200
@@ -565,6 +565,7 @@
char sql[MAX_STRING_LEN];
char str[MAX_STRING_LEN];
char tmp[MAX_STRING_LEN];
+ char tmp2[MAX_STRING_LEN];
time_t now;
struct tm *tm;
@@ -612,6 +613,15 @@
strncat(data, tmp, MAX_STRING_LEN);
strncat(data, s+strlen("{HOSTNAME}"), MAX_STRING_LEN);
}
+ else if( (s = strstr(str,"{GRAPH.LINK}")) != NULL )
+ {
+ snprintf(tmp2,sizeof(tmp2)-1,"http://[B][COLOR=Red]HOST_OF_ZABBIX_SERVER[/COLOR][/B]/alarms.php?triggerid=%d",trigger->triggerid);
+ strscpy(tmp,tmp2);
+ s[0]=0;
+ strcpy(data, str);
+ strncat(data, tmp, MAX_STRING_LEN);
+ strncat(data, s+strlen("{GRAPH.LINK}"), MAX_STRING_LEN);
+ }
else if( (s = strstr(str,"{TRIGGER.KEY}")) != NULL )
{
snprintf(sql,sizeof(sql)-1,"select distinct i.key_ from triggers t, functions f,items i, hosts h where t.triggerid=%d and f.triggerid=t.triggerid and f.itemid=i.itemid and h.hostid=i.hostid order by i.key_", trigger->triggerid);