summaryrefslogtreecommitdiffstats
path: root/frontends/php
diff options
context:
space:
mode:
authorhugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2002-06-21 18:41:45 +0000
committerhugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2002-06-21 18:41:45 +0000
commit7b8199f4bbc932f3d72c6c67e4205c8ef4aed704 (patch)
tree26e77b279bc27c922ac51ca644bec5f790912441 /frontends/php
parent043dbb70cbc557bbc5f70a74453e506546148963 (diff)
- status of triggers changes if host/item status has been changed (Alexei)
- status of triggers is set correctly even if zabbix is restarted (Alexei) git-svn-id: svn://svn.zabbix.com/trunk@412 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php')
-rw-r--r--frontends/php/alarms.php2
-rw-r--r--frontends/php/include/config.inc.php36
-rw-r--r--frontends/php/index.php2
-rw-r--r--frontends/php/report2.php4
4 files changed, 36 insertions, 8 deletions
diff --git a/frontends/php/alarms.php b/frontends/php/alarms.php
index 2c26c8a3..4c2efcb0 100644
--- a/frontends/php/alarms.php
+++ b/frontends/php/alarms.php
@@ -72,7 +72,7 @@
echo "<TR>";
echo "<TD><FONT SIZE=+1>Time</FONT></TD>";
echo "<TD><FONT SIZE=+1>Status</FONT></TD>";
- echo "<TD><FONT SIZE=+1>Length</FONT></TD>";
+ echo "<TD><FONT SIZE=+1>Duration</FONT></TD>";
echo "<TD><FONT SIZE=+1>Sum</FONT></TD>";
echo "<TD><FONT SIZE=+1>%</FONT></TD>";
echo "</TR>";
diff --git a/frontends/php/include/config.inc.php b/frontends/php/include/config.inc.php
index bb48475d..d746b2ad 100644
--- a/frontends/php/include/config.inc.php
+++ b/frontends/php/include/config.inc.php
@@ -2961,7 +2961,7 @@ where h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=$triggerid";
show_table2_header_end();
}
-
+/*
function show_footer()
{
echo "<br>";
@@ -2982,6 +2982,33 @@ where h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=$triggerid";
echo "</body>";
}
+*/
+
+ function show_footer()
+ {
+ global $USER_DETAILS;
+
+ echo "<br>";
+ echo "<table border=0 cellpadding=1 cellspacing=0 width=\"100%\" align=center>";
+ echo "<tr>";
+ echo "<td bgcolor=\"#000000\">";
+ echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"3\" width=\"100%\" bgcolor=\"#666666\">";
+ echo "<tr><td align=center width=\"90%\">";
+ echo "<font face=\"Arial,Helvetica\" size=1>";
+ echo "<a href=\"http://zabbix.sourceforge.net\">ZABBIX</a> Copyright 2000,2001,2002 by <a href=\"mailto:alex@gobbo.caves.lv\">Alexei Vladishev</a>";
+ echo "</font>";
+ echo "</td>";
+ echo "<td align=right>";
+ echo "<font size=-1>| Connected as ".$USER_DETAILS["alias"];
+ echo "</td>";
+ echo "</tr>";
+ echo "</table>";
+ echo "</td>";
+ echo "</tr>";
+ echo "</table>";
+
+ echo "</body>";
+ }
function get_stats()
{
@@ -3051,6 +3078,8 @@ where h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=$triggerid";
$sql="select clock,value from alarms where triggerid=$triggerid and clock>=$min and clock<=$max";
$result=DBselect($sql);
+// echo $sql,"<br>";
+
// -1,0,1
$state=-1;
$true_time=0;
@@ -3078,7 +3107,7 @@ where h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=$triggerid";
{
$true_time+=$diff;
}
- if($state == 3)
+ if($state == 2)
{
$unknown_time+=$diff;
}
@@ -3093,7 +3122,7 @@ where h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=$triggerid";
$true_time+=$diff;
$state=$value;
}
- else if($state==3)
+ else if($state==2)
{
$unknown_time+=$diff;
$state=$value;
@@ -3120,6 +3149,7 @@ where h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=$triggerid";
}
}
+// echo "$true_time $false_time $unknown_time";
$total_time=$true_time+$false_time+$unknown_time;
$ret["true_time"]=$true_time;
diff --git a/frontends/php/index.php b/frontends/php/index.php
index 96cf5bcc..0aa931c2 100644
--- a/frontends/php/index.php
+++ b/frontends/php/index.php
@@ -40,8 +40,6 @@
else
{
echo "<center>";
- echo "Connected as ".$USER_DETAILS["alias"];
- echo "<br>";
echo "Press <a href=\"index.php?reconnect=1\">here</a> to reconnect";
echo "</center>";
}
diff --git a/frontends/php/report2.php b/frontends/php/report2.php
index 19c9a974..a27a5970 100644
--- a/frontends/php/report2.php
+++ b/frontends/php/report2.php
@@ -26,7 +26,7 @@
<?
- $result=DBselect("select h.hostid,h.host,t.triggerid,t.expression,t.description,t.istrue from triggers t,hosts h,items i,functions f where f.itemid=i.itemid and h.hostid=i.hostid and t.istrue!=2 and t.triggerid=f.triggerid and h.status in (0,2) and i.status=0 order by h.host,t.lastchange desc, t.description");
+ $result=DBselect("select h.hostid,h.host,t.triggerid,t.expression,t.description,t.value from triggers t,hosts h,items i,functions f where f.itemid=i.itemid and h.hostid=i.hostid and t.status=0 and t.triggerid=f.triggerid and h.status in (0,2) and i.status=0 order by h.host,t.lastchange desc, t.description");
$lasthost="";
$col=0;
@@ -53,7 +53,7 @@
if($col++%2 == 1) { echo "<TR BGCOLOR=#DDDDDD>"; }
else { echo "<TR BGCOLOR=#EEEEEE>"; }
- echo "<TD>".$row["description"]."</TD>";
+ echo "<TD><a href=\"alarms.php?triggerid=".$row["triggerid"]."\">".$row["description"]."</a></TD>";
$description=rawurlencode($row["description"]);
echo "<TD>".explode_exp($row["expression"],1)."</TD>";