summaryrefslogtreecommitdiffstats
path: root/frontends
diff options
context:
space:
mode:
authorhugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2002-06-05 08:48:43 +0000
committerhugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2002-06-05 08:48:43 +0000
commit64d2ad28cd35462e60b82c7bbef3edbde55b1cee (patch)
treed276823e6aea87030b1a75bbab3c830a1adb971c /frontends
parent16ade8fbfde6ec3f6c899bab8a109db0b366acdb (diff)
downloadzabbix-64d2ad28cd35462e60b82c7bbef3edbde55b1cee.tar.gz
zabbix-64d2ad28cd35462e60b82c7bbef3edbde55b1cee.tar.xz
zabbix-64d2ad28cd35462e60b82c7bbef3edbde55b1cee.zip
Different improvements.
git-svn-id: svn://svn.zabbix.com/trunk@403 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends')
-rw-r--r--frontends/php/include/config.inc7
-rw-r--r--frontends/php/include/db.inc2
-rw-r--r--frontends/php/latestalarms.php4
-rw-r--r--frontends/php/tr_status.php12
-rw-r--r--frontends/php/triggers.php4
5 files changed, 18 insertions, 11 deletions
diff --git a/frontends/php/include/config.inc b/frontends/php/include/config.inc
index 8799b623..3b163592 100644
--- a/frontends/php/include/config.inc
+++ b/frontends/php/include/config.inc
@@ -1133,13 +1133,14 @@ where h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=$triggerid";
return DBexecute($sql);
}
- function update_trigger_status_to_unknown_by_hostid($hostid)
+ function update_trigger_value_to_unknown_by_hostid($hostid)
{
$sql="select distinct t.triggerid from hosts h,items i,triggers t,functions f where f.triggerid=t.triggerid and f.itemid=i.itemid and h.hostid=i.hostid and h.hostid=$hostid";
$result=DBselect($sql);
while($row=DBfetch($result))
{
- update_trigger_status($row["triggerid"],3);
+ $sql="update triggers set value=2 where triggerid=".$row["triggerid"];
+ DBexecute($sql);
}
}
@@ -1158,7 +1159,7 @@ where h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=$triggerid";
$result=DBselect($sql);
if($status != DBget_field($result,0,0))
{
- update_trigger_status_to_unknown_by_hostid($hostid);
+ update_trigger_value_to_unknown_by_hostid($hostid);
$sql="update hosts set status=$status where hostid=$hostid";
return DBexecute($sql);
}
diff --git a/frontends/php/include/db.inc b/frontends/php/include/db.inc
index a140b2fc..2de3acce 100644
--- a/frontends/php/include/db.inc
+++ b/frontends/php/include/db.inc
@@ -47,7 +47,7 @@
{
global $DB,$DB_TYPE;
- echo $query,"<br>";
+// echo $query,"<br>";
if($DB_TYPE == "MYSQL")
{
diff --git a/frontends/php/latestalarms.php b/frontends/php/latestalarms.php
index 2712063e..e31e1bb1 100644
--- a/frontends/php/latestalarms.php
+++ b/frontends/php/latestalarms.php
@@ -68,11 +68,11 @@
}
elseif($row["value"] == 1)
{
- echo "<TD><font color=\"AAAAAA\">ON</font></TD>";
+ echo "<TD><font color=\"AA0000\">ON</font></TD>";
}
else
{
- echo "<TD><font color=\"AA0000\">UNKNOWN</font></TD>";
+ echo "<TD><font color=\"AAAAAA\">UNKNOWN</font></TD>";
}
echo "</TR>";
}
diff --git a/frontends/php/tr_status.php b/frontends/php/tr_status.php
index 46e4c366..fdf81e34 100644
--- a/frontends/php/tr_status.php
+++ b/frontends/php/tr_status.php
@@ -215,11 +215,11 @@
if($onlytrue=='true')
{
- $sql="select t.priority,count(*) from triggers t,hosts h,items i,functions f where t.value=1 and t.status=0 and f.itemid=i.itemid and h.hostid=i.hostid and t.triggerid=f.triggerid and t.description $select_cond and i.status in (0,2) $cond group by 1";
+ $sql="select t.priority,count(*) from triggers t,hosts h,items i,functions f where t.value=1 and t.status=0 and f.itemid=i.itemid and h.hostid=i.hostid and h.status in (0,2) and t.triggerid=f.triggerid and t.description $select_cond and i.status in (0,2) $cond group by 1";
}
else
{
- $sql="select t.priority,count(*) from triggers t,hosts h,items i,functions f where f.itemid=i.itemid and h.hostid=i.hostid and t.triggerid=f.triggerid and t.description $select_cond and i.status in (0,2) $cond group by 1";
+ $sql="select t.priority,count(*) from triggers t,hosts h,items i,functions f where f.itemid=i.itemid and h.hostid=i.hostid and t.triggerid=f.triggerid and t.status=0 and h.status in (0,2) and t.description $select_cond and i.status in (0,2) $cond group by 1";
}
$result=DBselect($sql);
$p0=$p1=$p2=$p3=$p4=$p5=0;
@@ -272,7 +272,7 @@
if($compact!='true') {echo "<BR><FONT SIZE=-1>Expression</FONT></B>";}
echo "</TD>";
- echo "<TD WIDTH=\"5%\"><B>Status</B></TD>";
+ echo "<TD WIDTH=\"5%\"><B>Value</B></TD>";
if(!isset($sort)||(isset($sort) && $sort=="priority"))
{
@@ -335,11 +335,11 @@
if($onlytrue=='true')
{
- $result=DBselect("select distinct t.triggerid,t.status,t.description,t.expression,t.priority,t.lastchange,t.comments,t.url,t.value from triggers t,hosts h,items i,functions f where t.value=1 and t.status=0 and f.itemid=i.itemid and h.hostid=i.hostid and t.description $select_cond and t.triggerid=f.triggerid and i.status in (0,2) $cond $sort");
+ $result=DBselect("select distinct t.triggerid,t.status,t.description,t.expression,t.priority,t.lastchange,t.comments,t.url,t.value from triggers t,hosts h,items i,functions f where t.value=1 and t.status=0 and f.itemid=i.itemid and h.hostid=i.hostid and t.description $select_cond and t.triggerid=f.triggerid and i.status in (0,2) and h.status in (0,2) $cond $sort");
}
else
{
- $result=DBselect("select distinct t.triggerid,t.status,t.description,t.expression,t.priority,t.lastchange,t.comments,t.url,t.value from triggers t,hosts h,items i,functions f where f.itemid=i.itemid and h.hostid=i.hostid and t.triggerid=f.triggerid and t.description $select_cond and i.status in (0,2) $cond $sort");
+ $result=DBselect("select distinct t.triggerid,t.status,t.description,t.expression,t.priority,t.lastchange,t.comments,t.url,t.value from triggers t,hosts h,items i,functions f where f.itemid=i.itemid and h.hostid=i.hostid and t.triggerid=f.triggerid and t.status=0 and t.description $select_cond and i.status in (0,2) and h.status in (0,2) $cond $sort");
}
$col=0;
while($row=DBfetch($result))
@@ -381,6 +381,8 @@
echo "</TD>";
if($row["value"]==0)
{ echo "<TD ALIGN=CENTER><FONT COLOR=\"00AA00\">FALSE</FONT></TD>";}
+ else if($row["value"]==2)
+ { echo "<TD ALIGN=CENTER><FONT COLOR=\"AAAAAA\">UNKNOWN</FONT></TD>"; }
else
{ echo "<TD ALIGN=CENTER><FONT COLOR=\"AA0000\">TRUE</FONT></TD>"; }
diff --git a/frontends/php/triggers.php b/frontends/php/triggers.php
index c322cf92..98f4ab11 100644
--- a/frontends/php/triggers.php
+++ b/frontends/php/triggers.php
@@ -148,6 +148,10 @@
{
echo "<a href=\"triggers.php?register=changestatus&triggerid=".$row["triggerid"]."&status=0&hostid=".$row["hostid"]."\">Disabled</a>";
}
+ else if($row["status"] == 2)
+ {
+ echo "<a href=\"triggers.php?register=changestatus&triggerid=".$row["triggerid"]."&status=1&hostid=".$row["hostid"]."\">Unknown</a>";
+ }
else
{
echo "<a href=\"triggers.php?register=changestatus&triggerid=".$row["triggerid"]."&status=1&hostid=".$row["hostid"]."\">Enabled</a>";