diff options
| author | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2002-08-04 16:53:24 +0000 |
|---|---|---|
| committer | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2002-08-04 16:53:24 +0000 |
| commit | 2f691b3628c4589fe258def9564d78cd134d3ebb (patch) | |
| tree | 278a676e3e5540977348c86b9d7a96ccc105902d /frontends/php/latest.php | |
| parent | 89d810024288866e72586c1774dec254db9aa884 (diff) | |
- added upgrades/dbpatches/1.0beta4_to_1.0beta5/ with patches (Alexei)
- added support for disktotal[*] (Alexei)
- added support for inodetotal[*] (Alexei)
- added support for *,/,+, and - in trigger expressions (Alexei)
- removed frontends/php/chart4.php (Alexei)
- update item status to UNSUPPORTED in case if SNMP support was not included
into zabbix_suckerd (Alexei)
- added mysql_init() to DBconnect() (Alexei)
- fixed Next100 and Prev100 for case if some hosts are hidden (Alexei)
- added select for latest values (Alexei)
- delete related services if trigger is deleted (Alexei)
- fixed problem with substitution of macros for messages (Alexei)
- eliminated DBis_empty() by replacing to DBnum_rows() (Alexei)
- MAX_STRING_LEN increased to 4096 (Alexei)
- fixed zabbix_log(). Possible coredump if data contains %s, etc (Alexei)
git-svn-id: svn://svn.zabbix.com/trunk@445 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/latest.php')
| -rw-r--r-- | frontends/php/latest.php | 75 |
1 files changed, 68 insertions, 7 deletions
diff --git a/frontends/php/latest.php b/frontends/php/latest.php index 1031e392..b38454f7 100644 --- a/frontends/php/latest.php +++ b/frontends/php/latest.php @@ -13,6 +13,11 @@ show_footer(); exit; } + if(isset($select)) + { + unset($hostid); + } + if(isset($hostid)&&!check_right("Host","R",$hostid)) { show_table_header("<font color=\"AA0000\">No permissions !</font @@ -51,6 +56,26 @@ } echo "</font>"; + if(!isset($hostid)&&isset($select_form)&&!isset($select)) + { + show_table_v_delimiter(); + echo "<form name=\"form1\" method=\"get\" action=\"latest.php?select=true\"> + <input type=\"text\" name=\"select\" value=\"$txt_select\"> + <input type=\"submit\" name=\"Select\" value=\"Select\"> + </form>"; + } + else + { + show_table_v_delimiter(); + if(isset($select)) + { + echo "<b>[<a href='latest.php?select_form=1'>Select</a>]</b>"; + } + else + { + echo "[<a href='latest.php?select_form=1'>Select</a>]"; + } + } show_table_header_end(); if(!isset($sort)) @@ -67,13 +92,20 @@ } } - if(isset($hostid)) + if(isset($hostid)||isset($select)) { - $result=DBselect("select host from hosts where hostid=$hostid"); - $host=DBget_field($result,0,0); echo "<br>"; - show_table_header("<a href=\"latest.php?hostid=$hostid\">$host</a>"); + if(!isset($select)) + { + $result=DBselect("select host from hosts where hostid=$hostid"); + $host=DBget_field($result,0,0); + show_table_header("<a href=\"latest.php?hostid=$hostid\">$host</a>"); + } + else + { + show_table_header("Description is like *$select*"); + } # show_table_header_begin(); # echo "<a href=\"latest.php?hostid=$hostid\">$host</a>"; # show_table3_v_delimiter(); @@ -82,13 +114,24 @@ cr(); echo "<TR BGCOLOR=\"CCCCCC\">"; cr(); + if(isset($select)) + { + echo "<TD><B>Host</B></TD>"; + } if(!isset($sort)||(isset($sort)&&($sort=="description"))) { echo "<TD><B>DESCRIPTION</B></TD>"; } else { - echo "<TD><B><a href=\"latest.php?hostid=$hostid&sort=description\">Description</B></TD>"; + if(isset($select)) + { + echo "<TD><B><a href=\"latest.php?select=$select&sort=description\">Description</B></TD>"; + } + else + { + echo "<TD><B><a href=\"latest.php?hostid=$hostid&sort=description\">Description</B></TD>"; + } } if(isset($sort)&&($sort=="lastcheck")) { @@ -96,7 +139,14 @@ } else { - echo "<TD WIDTH=\"12%\"><B><a href=\"latest.php?hostid=$hostid&sort=lastcheck\">Last check</B></TD>"; + if(isset($select)) + { + echo "<TD WIDTH=\"12%\"><B><a href=\"latest.php?select=$select&sort=lastcheck\">Last check</B></TD>"; + } + else + { + echo "<TD WIDTH=\"12%\"><B><a href=\"latest.php?hostid=$hostid&sort=lastcheck\">Last check</B></TD>"; + } } cr(); echo "<TD WIDTH=\"10%\" NOSAVE><B>Last value</B></TD>"; @@ -132,7 +182,14 @@ { $sort="order by i.description"; } - $result=DBselect("select h.host,i.itemid,i.description,i.lastvalue,i.prevvalue,i.lastclock,i.status,h.hostid,i.value_type from items i,hosts h where h.hostid=i.hostid and h.status in (0,2) and i.status in (0,2) and h.hostid=$hostid $sort"); + if(isset($select)) + { + $result=DBselect("select h.host,i.itemid,i.description,i.lastvalue,i.prevvalue,i.lastclock,i.status,h.hostid,i.value_type from items i,hosts h where h.hostid=i.hostid and h.status in (0,2) and i.status in (0,2) and i.description like '%$select%' $sort"); + } + else + { + $result=DBselect("select h.host,i.itemid,i.description,i.lastvalue,i.prevvalue,i.lastclock,i.status,h.hostid,i.value_type from items i,hosts h where h.hostid=i.hostid and h.status in (0,2) and i.status in (0,2) and h.hostid=$hostid $sort"); + } while($row=DBfetch($result)) { if(!check_right("Item","R",$row["itemid"])) @@ -146,6 +203,10 @@ if($col++%2 == 1) { echo "<tr bgcolor=#DDDDDD>"; } else { echo "<tr bgcolor=#EEEEEE>"; } + if(isset($select)) + { + echo "<td>".$row["host"]."</td>"; + } echo "<td>".$row["description"]."</td>"; echo "<td>"; |
