summaryrefslogtreecommitdiffstats
path: root/frontends
diff options
context:
space:
mode:
authorhugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2005-01-15 08:21:02 +0000
committerhugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2005-01-15 08:21:02 +0000
commit15b84090305640db312b39c8be647669eb0b5265 (patch)
tree2cefea49bb302b18f946f415c4e89a2b8f72e74e /frontends
parent2497838d3b5277b74caa07247315019475c063a1 (diff)
downloadzabbix-15b84090305640db312b39c8be647669eb0b5265.tar.gz
zabbix-15b84090305640db312b39c8be647669eb0b5265.tar.xz
zabbix-15b84090305640db312b39c8be647669eb0b5265.zip
Finished changed related to host.available
git-svn-id: svn://svn.zabbix.com/trunk@1608 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends')
-rw-r--r--frontends/php/graph.php2
-rw-r--r--frontends/php/hosts.php26
-rw-r--r--frontends/php/include/config.inc.php12
-rw-r--r--frontends/php/include/defines.inc.php6
-rw-r--r--frontends/php/index.php2
-rw-r--r--frontends/php/latest.php10
-rw-r--r--frontends/php/map.php8
-rw-r--r--frontends/php/queue.php2
-rw-r--r--frontends/php/report2.php8
-rw-r--r--frontends/php/report3.php2
-rw-r--r--frontends/php/screenedit.php4
-rw-r--r--frontends/php/tr_status.php14
12 files changed, 50 insertions, 46 deletions
diff --git a/frontends/php/graph.php b/frontends/php/graph.php
index e10e0f37..493d9d99 100644
--- a/frontends/php/graph.php
+++ b/frontends/php/graph.php
@@ -174,7 +174,7 @@
echo S_PARAMETER;
show_table2_h_delimiter();
- $result=DBselect("select h.host,i.description,i.itemid from hosts h,items i where h.hostid=i.hostid and h.status in (0,2) and i.status=0 order by h.host,i.description");
+ $result=DBselect("select h.host,i.description,i.itemid from hosts h,items i where h.hostid=i.hostid and h.status=".HOST_STATUS_MONITORED." and i.status=".ITEM_STATUS_ACTIVE." order by h.host,i.description");
echo "<select name=\"itemid\" size=1>";
for($i=0;$i<DBnum_rows($result);$i++)
{
diff --git a/frontends/php/hosts.php b/frontends/php/hosts.php
index 829c20ad..a07b9dce 100644
--- a/frontends/php/hosts.php
+++ b/frontends/php/hosts.php
@@ -430,13 +430,13 @@
}
if(check_right("Host","U",$row["hostid"]))
{
- if($row["status"] == 0)
+ if($row["status"] == HOST_STATUS_MONITORED)
$status=array("value"=>"<a class=\"off\" href=\"hosts.php?hostid=".$row["hostid"]."&register=changestatus&status=1\">".S_MONITORED."</a>","class"=>"off");
- else if($row["status"] == 1)
+ else if($row["status"] == HOST_STATUS_NOT_MONITORED)
$status=array("value"=>"<a class=\"on\" href=\"hosts.php?hostid=".$row["hostid"]."&register=changestatus&status=0\">".S_NOT_MONITORED."</a>","class"=>"on");
- else if($row["status"] == 2)
- $status=array("value"=>S_UNREACHABLE,"class"=>"unknown");
- else if($row["status"] == 3)
+// else if($row["status"] == 2)
+// $status=array("value"=>S_UNREACHABLE,"class"=>"unknown");
+ else if($row["status"] == HOST_STATUS_TEMPLATE)
$status=array("value"=>S_TEMPLATE,"class"=>"unknown");
else if($row["status"] == HOST_STATUS_DELETED)
$status=array("value"=>S_DELETED,"class"=>"unknown");
@@ -445,13 +445,13 @@
}
else
{
- if($row["status"] == 0)
+ if($row["status"] == HOST_STATUS_MONITORED)
$status=array("value"=>S_MONITORED,"class"=>"off");
- else if($row["status"] == 1)
+ else if($row["status"] == HOST_STATUS_NOT_MONITORED)
$status=array("value"=>S_NOT_MONITORED,"class"=>"on");
- else if($row["status"] == 2)
- $status=array("value"=>S_UNREACHABLE,"class"=>"unknown");
- else if($row["status"] == 3)
+// else if($row["status"] == 2)
+// $status=array("value"=>S_UNREACHABLE,"class"=>"unknown");
+ else if($row["status"] == HOST_STATUS_TEMPLATE)
$status=array("value"=>S_TEMPLATE,"class"=>"unknown");
else if($row["status"] == HOST_STATUS_DELETED)
$status=array("value"=>S_DELETED,"class"=>"unknown");
@@ -521,7 +521,7 @@
$host=@iif(isset($_GET["host"]),$_GET["host"],"");
$port=@iif(isset($_GET["port"]),$_GET["port"],get_profile("HOST_PORT",10050));
- $status=@iif(isset($_GET["status"]),$_GET["status"],0);
+ $status=@iif(isset($_GET["status"]),$_GET["status"],HOST_STATUS_MONITORED);
$useip=@iif(isset($_GET["useip"]),$_GET["useip"],"off");
$newgroup=@iif(isset($_GET["newgroup"]),$_GET["newgroup"],"");
$ip=@iif(isset($_GET["ip"]),$_GET["ip"],"");
@@ -667,13 +667,13 @@
echo S_STATUS;
show_table2_h_delimiter();
echo "<select class=\"biginput\" name=\"status\" size=\"1\">";
- if($status==0)
+ if($status==HOST_STATUS_MONITORED)
{
echo "<option value=\"0\" selected>".S_MONITORED;
echo "<option value=\"1\">".S_NOT_MONITORED;
echo "<option value=\"3\">".S_TEMPLATE;
}
- else if($status==3)
+ else if($status==HOST_STATUS_TEMPLATE)
{
echo "<option value=\"0\">".S_MONITORED;
echo "<option value=\"1\">".S_NOT_MONITORED;
diff --git a/frontends/php/include/config.inc.php b/frontends/php/include/config.inc.php
index 0158c6d6..79baf9ef 100644
--- a/frontends/php/include/config.inc.php
+++ b/frontends/php/include/config.inc.php
@@ -2143,7 +2143,7 @@ echo "</head>";
if($status != $old_status)
{
update_trigger_value_to_unknown_by_hostid($hostid);
- $sql="update hosts set status=$status where hostid=$hostid and status not in (".HOST_STATUS_UNREACHABLE.",".HOST_STATUS_DELETED.")";
+ $sql="update hosts set status=$status where hostid=$hostid and status!=".HOST_STATUS_DELETED;
return DBexecute($sql);
}
else
@@ -3395,7 +3395,7 @@ echo "</head>";
}
- $sql="insert into hosts (host,port,status,useip,ip,disable_until) values ('$host',$port,$status,$useip,'$ip',0)";
+ $sql="insert into hosts (host,port,status,useip,ip,disable_until,available) values ('$host',$port,$status,$useip,'$ip',0,".HOST_AVAILABLE_UNKNOWN.")";
$result=DBexecute($sql);
if(!$result)
{
@@ -4289,13 +4289,13 @@ echo "</head>";
$result=DBselect("select count(*) from hosts");
$stat["hosts_count"]=DBget_field($result,0,0);
- $result=DBselect("select count(*) from hosts where status=0");
+ $result=DBselect("select count(*) from hosts where status=".HOST_STATUS_MONITORED);
$stat["hosts_count_monitored"]=DBget_field($result,0,0);
- $result=DBselect("select count(*) from hosts where status=1");
+ $result=DBselect("select count(*) from hosts where status!=".HOST_STATUS_MONITORED);
$stat["hosts_count_not_monitored"]=DBget_field($result,0,0);
- $result=DBselect("select count(*) from hosts where status=3");
+ $result=DBselect("select count(*) from hosts where status=".HOST_STATUS_DELETED);
$stat["hosts_count_template"]=DBget_field($result,0,0);
$result=DBselect("select count(*) from users");
@@ -4786,7 +4786,7 @@ echo "</head>";
$icon=DBget_field($result,$i,8);
$url=DBget_field($result,$i,9);
- if( ($status==0)||($status==2))
+ if($status==HOST_STATUS_MONITORED)
{
$sql="select image from images where imagetype=1 and name='$icon'";
$result2=DBselect($sql);
diff --git a/frontends/php/include/defines.inc.php b/frontends/php/include/defines.inc.php
index bc2c4bf2..c707dc60 100644
--- a/frontends/php/include/defines.inc.php
+++ b/frontends/php/include/defines.inc.php
@@ -43,10 +43,14 @@
define("HOST_STATUS_MONITORED", 0);
define("HOST_STATUS_NOT_MONITORED", 1);
- define("HOST_STATUS_UNREACHABLE", 2);
+// define("HOST_STATUS_UNREACHABLE", 2);
define("HOST_STATUS_TEMPLATE", 3);
define("HOST_STATUS_DELETED", 4);
+ define("HOST_AVAILABLE_UNKNOWN", 0);
+ define("HOST_AVAILABLE_TRUE", 1);
+ define("HOST_AVAILABLE_FALSE", 2);
+
define("GRAPH_DRAW_TYPE_LINE",0);
define("GRAPH_DRAW_TYPE_FILL",1);
define("GRAPH_DRAW_TYPE_BOLDLINE",2);
diff --git a/frontends/php/index.php b/frontends/php/index.php
index 53a47edc..c1513b77 100644
--- a/frontends/php/index.php
+++ b/frontends/php/index.php
@@ -19,7 +19,7 @@
**/
?>
<?php
- $page["title"]="Zabbix main page";
+ $page["title"]="ZABBIX main page";
$page["file"]="index.php";
include "include/config.inc.php";
diff --git a/frontends/php/latest.php b/frontends/php/latest.php
index db9a0b2f..241b1eda 100644
--- a/frontends/php/latest.php
+++ b/frontends/php/latest.php
@@ -63,7 +63,7 @@
while($row=DBfetch($result))
{
// Check if at least one host with read permission exists for this group
- $result2=DBselect("select h.hostid,h.host from hosts h,items i,hosts_groups hg where h.status in (0,2) and h.hostid=i.hostid and hg.groupid=".$row["groupid"]." and hg.hostid=h.hostid group by h.hostid,h.host order by h.host");
+ $result2=DBselect("select h.hostid,h.host from hosts h,items i,hosts_groups hg where h.status=".HOST_STATUS_MONITORED." and h.hostid=i.hostid and hg.groupid=".$row["groupid"]." and hg.hostid=h.hostid group by h.hostid,h.host order by h.host");
$cnt=0;
while($row2=DBfetch($result2))
{
@@ -86,11 +86,11 @@
if(isset($_GET["groupid"]))
{
- $sql="select h.hostid,h.host from hosts h,items i,hosts_groups hg where h.status in (0,2) and h.hostid=i.hostid and hg.groupid=".$_GET["groupid"]." and hg.hostid=h.hostid group by h.hostid,h.host order by h.host";
+ $sql="select h.hostid,h.host from hosts h,items i,hosts_groups hg where h.status=".HOST_STATUS_MONITORED." and h.hostid=i.hostid and hg.groupid=".$_GET["groupid"]." and hg.hostid=h.hostid group by h.hostid,h.host order by h.host";
}
else
{
- $sql="select h.hostid,h.host from hosts h,items i where h.status in (0,2) and h.hostid=i.hostid group by h.hostid,h.host order by h.host";
+ $sql="select h.hostid,h.host from hosts h,items i where h.status=".HOST_STATUS_MONITORED." and h.hostid=i.hostid group by h.hostid,h.host order by h.host";
}
$result=DBselect($sql);
@@ -251,9 +251,9 @@
$_GET["sort"]="order by i.description";
}
if(isset($_GET["select"]))
- $sql="select h.host,i.itemid,i.description,i.lastvalue,i.prevvalue,i.lastclock,i.status,h.hostid,i.value_type,i.units,i.multiplier from items i,hosts h where h.hostid=i.hostid and h.status in (0,2) and i.status=0 and i.description like '%".$_GET["select"]."%' ".$_GET["sort"];
+ $sql="select h.host,i.itemid,i.description,i.lastvalue,i.prevvalue,i.lastclock,i.status,h.hostid,i.value_type,i.units,i.multiplier from items i,hosts h where h.hostid=i.hostid and h.status=".HOST_STATUS_MONITORED." and i.status=0 and i.description like '%".$_GET["select"]."%' ".$_GET["sort"];
else
- $sql="select h.host,i.itemid,i.description,i.lastvalue,i.prevvalue,i.lastclock,i.status,h.hostid,i.value_type,i.units,i.multiplier from items i,hosts h where h.hostid=i.hostid and h.status in (0,2) and i.status=0 and h.hostid=".$_GET["hostid"]." ".$_GET["sort"];
+ $sql="select h.host,i.itemid,i.description,i.lastvalue,i.prevvalue,i.lastclock,i.status,h.hostid,i.value_type,i.units,i.multiplier from items i,hosts h where h.hostid=i.hostid and h.status=".HOST_STATUS_MONITORED." and i.status=0 and h.hostid=".$_GET["hostid"]." ".$_GET["sort"];
$result=DBselect($sql);
while($row=DBfetch($result))
{
diff --git a/frontends/php/map.php b/frontends/php/map.php
index 43ddc016..3ac814ad 100644
--- a/frontends/php/map.php
+++ b/frontends/php/map.php
@@ -245,10 +245,10 @@
$icon_on=DBget_field($result,$i,9);
- $result1=DBselect("select count(distinct t.triggerid) from items i,functions f,triggers t,hosts h where h.hostid=i.hostid and i.hostid=$hostid and i.itemid=f.itemid and f.triggerid=t.triggerid and t.value=1 and t.status=0 and h.status in (0,2) and i.status=0");
+ $result1=DBselect("select count(distinct t.triggerid) from items i,functions f,triggers t,hosts h where h.hostid=i.hostid and i.hostid=$hostid and i.itemid=f.itemid and f.triggerid=t.triggerid and t.value=1 and t.status=0 and h.status=".HOST_STATUS_MONITORED." and i.status=0");
$count=DBget_field($result1,0,0);
- if( ($status!=1)&&($count>0))
+ if( ($status!=HOST_STATUS_NOT_MONITORED)&&($count>0))
{
$icon=$icon_on;
}
@@ -291,7 +291,7 @@
ImageString($im, 2, $x1, $y1, $label,$black);
}
- if($status == 1)
+ if($status == HOST_STATUS_NOT_MONITORED)
{
$color=$darkred;
# $label="Not monitored";
@@ -301,7 +301,7 @@
{
if($count==1)
{
- $result1=DBselect("select distinct t.description,t.triggerid, t.priority from items i,functions f,triggers t,hosts h where h.hostid=i.hostid and i.hostid=$hostid and i.itemid=f.itemid and f.triggerid=t.triggerid and t.value=1 and t.status=0 and h.status in (0,2) and i.status=0");
+ $result1=DBselect("select distinct t.description,t.triggerid, t.priority from items i,functions f,triggers t,hosts h where h.hostid=i.hostid and i.hostid=$hostid and i.itemid=f.itemid and f.triggerid=t.triggerid and t.value=1 and t.status=0 and h.status=".HOST_STATUS_MONITORED." and i.status=0");
$label=DBget_field($result1,0,0);
if (DBget_field($result1,0,2) > 3)
$color=$red;
diff --git a/frontends/php/queue.php b/frontends/php/queue.php
index 2686b9f8..5b8a961d 100644
--- a/frontends/php/queue.php
+++ b/frontends/php/queue.php
@@ -41,7 +41,7 @@
<?php
$now=time();
- $result=DBselect("select i.itemid, i.nextcheck, i.description, h.host,h.hostid from items i,hosts h where i.status=0 and i.type not in (2) and h.status=0 and i.hostid=h.hostid and i.nextcheck<$now and i.key_<>'status' order by i.nextcheck");
+ $result=DBselect("select i.itemid, i.nextcheck, i.description, h.host,h.hostid from items i,hosts h where i.status=0 and i.type not in (2) and h.status=".HOST_STATUS_MONITORED." and i.hostid=h.hostid and i.nextcheck<$now and i.key_<>'status' order by i.nextcheck");
table_begin();
table_header(array(S_NEXT_CHECK,S_HOST,S_DESCRIPTION));
$col=0;
diff --git a/frontends/php/report2.php b/frontends/php/report2.php
index 8a3b2c96..3fe5ed08 100644
--- a/frontends/php/report2.php
+++ b/frontends/php/report2.php
@@ -49,7 +49,7 @@
while($row=DBfetch($result))
{
// Check if at least one host with read permission exists for this group
- $result2=DBselect("select h.hostid,h.host from hosts h,items i,hosts_groups hg where h.status in (0,2) and h.hostid=i.hostid and hg.groupid=".$row["groupid"]." and hg.hostid=h.hostid group by h.hostid,h.host order by h.host");
+ $result2=DBselect("select h.hostid,h.host from hosts h,items i,hosts_groups hg where h.status=".HOST_STATUS_MONITORED." and h.hostid=i.hostid and hg.groupid=".$row["groupid"]." and hg.hostid=h.hostid group by h.hostid,h.host order by h.host");
$cnt=0;
while($row2=DBfetch($result2))
{
@@ -72,11 +72,11 @@
if(isset($_GET["groupid"]))
{
- $sql="select h.hostid,h.host from hosts h,items i,hosts_groups hg where h.status in (0,2) and h.hostid=i.hostid and hg.groupid=".$_GET["groupid"]." and hg.hostid=h.hostid group by h.hostid,h.host order by h.host";
+ $sql="select h.hostid,h.host from hosts h,items i,hosts_groups hg where h.status=".HOST_STATUS_MONITORED." and h.hostid=i.hostid and hg.groupid=".$_GET["groupid"]." and hg.hostid=h.hostid group by h.hostid,h.host order by h.host";
}
else
{
- $sql="select h.hostid,h.host from hosts h,items i where h.status in (0,2) and h.hostid=i.hostid group by h.hostid,h.host order by h.host";
+ $sql="select h.hostid,h.host from hosts h,items i where h.status=".HOST_STATUS_MONITORED." and h.hostid=i.hostid group by h.hostid,h.host order by h.host";
}
$result=DBselect($sql);
@@ -101,7 +101,7 @@
$row=DBfetch($result);
show_table_header($row["host"]);
- $result=DBselect("select distinct 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.hostid=".$_GET["hostid"]." and h.status in (0,2) and i.status=0 order by h.host, t.description");
+ $result=DBselect("select distinct 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.hostid=".$_GET["hostid"]." and h.status=".HOST_STATUS_MONITORED." and i.status=0 order by h.host, t.description");
table_begin();
table_header(array(S_DESCRIPTION,S_TRUE,S_FALSE,S_UNKNOWN,S_GRAPH));
$col=0;
diff --git a/frontends/php/report3.php b/frontends/php/report3.php
index fdc4a060..3303f41d 100644
--- a/frontends/php/report3.php
+++ b/frontends/php/report3.php
@@ -52,7 +52,7 @@
show_table_v_delimiter();
- $result=DBselect("select h.hostid,h.host from hosts h,items i where h.status in (0,2) and h.hostid=i.hostid group by h.hostid,h.host order by h.host");
+ $result=DBselect("select h.hostid,h.host from hosts h,items i where h.status=".HOST_STATUS_MONITORED." and h.hostid=i.hostid group by h.hostid,h.host order by h.host");
$year=date("Y");
for($year=date("Y")-2;$year<=date("Y");$year++)
diff --git a/frontends/php/screenedit.php b/frontends/php/screenedit.php
index ba7d399e..f1e37685 100644
--- a/frontends/php/screenedit.php
+++ b/frontends/php/screenedit.php
@@ -139,7 +139,7 @@
show_table2_v_delimiter();
echo nbsp(S_PARAMETER);
show_table2_h_delimiter();
- $result=DBselect("select h.host,i.description,i.itemid from hosts h,items i where h.hostid=i.hostid and h.status in (0,2) and i.status=0 order by h.host,i.description");
+ $result=DBselect("select h.host,i.description,i.itemid from hosts h,items i where h.hostid=i.hostid and h.status=".HOST_STATUS_MONITORED." and i.status=0 order by h.host,i.description");
echo "<select name=\"resourceid\" size=1>";
echo "<OPTION VALUE='0'>(none)";
for($i=0;$i<DBnum_rows($result);$i++)
@@ -157,7 +157,7 @@
show_table2_v_delimiter();
echo nbsp(S_PARAMETER);
show_table2_h_delimiter();
- $result=DBselect("select h.host,i.description,i.itemid from hosts h,items i where h.hostid=i.hostid and h.status in (0,2) and i.status=0 order by h.host,i.description");
+ $result=DBselect("select h.host,i.description,i.itemid from hosts h,items i where h.hostid=i.hostid and h.status=".HOST_STATUS_MONITORED." and i.status=0 order by h.host,i.description");
echo "<select name=\"resourceid\" size=1>";
echo "<OPTION VALUE='0'>(none)";
for($i=0;$i<DBnum_rows($result);$i++)
diff --git a/frontends/php/tr_status.php b/frontends/php/tr_status.php
index 51e8a8ae..4209ea5c 100644
--- a/frontends/php/tr_status.php
+++ b/frontends/php/tr_status.php
@@ -201,7 +201,7 @@
while($row=DBfetch($result))
{
// Check if at least one host with read permission exists for this group
- $result2=DBselect("select h.hostid,h.host from hosts h,items i,hosts_groups hg where h.status in (0,2) and h.hostid=i.hostid and hg.groupid=".$row["groupid"]." and hg.hostid=h.hostid group by h.hostid,h.host order by h.host");
+ $result2=DBselect("select h.hostid,h.host from hosts h,items i,hosts_groups hg where h.status=".HOST_STATUS_MONITORED." and h.hostid=i.hostid and hg.groupid=".$row["groupid"]." and hg.hostid=h.hostid group by h.hostid,h.host order by h.host");
$cnt=0;
while($row2=DBfetch($result2))
{
@@ -224,11 +224,11 @@
if(isset($_GET["groupid"]))
{
- $sql="select h.hostid,h.host from hosts h,items i,hosts_groups hg where h.status in (0,2) and h.hostid=i.hostid and hg.groupid=".$_GET["groupid"]." and hg.hostid=h.hostid group by h.hostid,h.host order by h.host";
+ $sql="select h.hostid,h.host from hosts h,items i,hosts_groups hg where h.status=".HOST_STATUS_MONITORED." and h.hostid=i.hostid and hg.groupid=".$_GET["groupid"]." and hg.hostid=h.hostid group by h.hostid,h.host order by h.host";
}
else
{
- $sql="select h.hostid,h.host from hosts h,items i where h.status in (0,2) and h.hostid=i.hostid group by h.hostid,h.host order by h.host";
+ $sql="select h.hostid,h.host from hosts h,items i where h.status=".HOST_STATUS_MONITORED." and h.hostid=i.hostid group by h.hostid,h.host order by h.host";
}
$result=DBselect($sql);
@@ -367,11 +367,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 h.status in (0,2) and t.triggerid=f.triggerid and t.description $select_cond and i.status=0 $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=".HOST_STATUS_MONITORED." and t.triggerid=f.triggerid and t.description $select_cond and i.status=0 $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.status=0 and h.status in (0,2) and t.description $select_cond and i.status=0 $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=".HOST_STATUS_MONITORED." and t.description $select_cond and i.status=0 $cond group by 1";
}
$result=DBselect($sql);
$p0=$p1=$p2=$p3=$p4=$p5=0;
@@ -497,11 +497,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) and h.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=".HOST_STATUS_MONITORED." $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.status=0 and t.description $select_cond and i.status in (0,2) and h.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=".HOST_STATUS_MONITORED." $cond $sort");
}
$col=0;
while($row=DBfetch($result))