diff options
| author | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2002-08-11 16:16:22 +0000 |
|---|---|---|
| committer | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2002-08-11 16:16:22 +0000 |
| commit | cbb3323a0ad2ae65d0134e01b807faf8df99a2d2 (patch) | |
| tree | ad55125fb7f264d94d07d873e00f45c19097f4f6 /frontends/php | |
| parent | 150ed6cf4a06893d5ab64eb31c7efc06c4e05744 (diff) | |
| download | zabbix-cbb3323a0ad2ae65d0134e01b807faf8df99a2d2.tar.gz zabbix-cbb3323a0ad2ae65d0134e01b807faf8df99a2d2.tar.xz zabbix-cbb3323a0ad2ae65d0134e01b807faf8df99a2d2.zip | |
- added housekeeping procedure for table sessions (Alexei)
- changed width=\"X%\" to width=X% in *.php (Alexei)
- Status of a trigger will blink if it was changes during last 60
seconds (Alexei)
- Zabbix daemons to update triggers.lastchange when triggers.values
is changed (Alexei)
- added misc/init.d/debian/zabbix-[suckerd|trapperd] (Alexei)
- removed misc/init.d/debian/zabbix-server (Alexei)
- send_email() will timeout after 10 seconds (Alexei)
- DBadd_alarm() renamed to add_alarm() (Alexei)
- support for SCO OpenServer (Alexei). Thanks to Alexender Kirhenstein.
- ./configure will correctly define socklen_t (Alexei)
- <center> changed to <div align=center> (Alexei)
- reason of problem in screen IT Services (Alexei)
- added frontends.php/helpdesk.php (Alexei)
- added tables: problems, problems_comments,categories (Alexei)
- added "...#form" to button Change in form Configuration of Users (Alexei)
- "Just for information" changed to "Information" (Alexei)
- fixed ./configure to correctly find zlib (Alexei)
- housekeeping to delete no more than HousekeepingFrequency*3600 records
from table history and history_str at once (MySQL only) (Alexei)
git-svn-id: svn://svn.zabbix.com/trunk@450 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php')
29 files changed, 507 insertions, 211 deletions
diff --git a/frontends/php/about.php b/frontends/php/about.php index b07204f8..b9eec5c9 100644 --- a/frontends/php/about.php +++ b/frontends/php/about.php @@ -9,7 +9,7 @@ show_table_header("Information about Zabbix (v1.0beta5)"); ?> -<TABLE BORDER=0 COLS=4 WIDTH="100%" BGCOLOR="#CCCCCC" cellspacing=1 cellpadding=3> +<TABLE BORDER=0 COLS=4 WIDTH=100% BGCOLOR="#CCCCCC" cellspacing=1 cellpadding=3> <TR BGCOLOR=#EEEEEE> <TD ALIGN=LEFT> <font face="Helvetica"><a href="http://zabbix.sourceforge.net">Homepage of Zabbix</a></font><br> diff --git a/frontends/php/actions.php b/frontends/php/actions.php index abd461d6..cfa84cfe 100644 --- a/frontends/php/actions.php +++ b/frontends/php/actions.php @@ -44,7 +44,7 @@ $sql="select a.actionid,a.triggerid,u.alias,a.good,a.delay,a.subject,a.message from actions a,users u where a.userid=u.userid and a.triggerid=$triggerid order by u.alias, a.good desc"; $result=DBselect($sql); - echo "<CENTER>"; + echo "<div align=center>"; echo "<TABLE BORDER=0 WIDTH=100% BGCOLOR=\"#CCCCCC\" cellspacing=1 cellpadding=3>"; echo "<TR>"; echo "<TD><b>Send message to</b></TD>"; @@ -89,7 +89,8 @@ ?> </font> </tr> -</table></center> +</table> +</div> <? diff --git a/frontends/php/alarms.php b/frontends/php/alarms.php index de02ba75..dfbce0d9 100644 --- a/frontends/php/alarms.php +++ b/frontends/php/alarms.php @@ -24,7 +24,7 @@ if(!isset($triggerid)) { - echo "<CENTER><B>No triggerID!!!!</B><BR>Please Contact Server Adminstrator</CENTER>"; + echo "<div align=center><B>No triggerID!!!!</B><BR>Please Contact Server Adminstrator</div>"; show_footer(); exit; } @@ -71,8 +71,7 @@ $sql="select clock,value,triggerid from alarms where triggerid=$triggerid order by clock desc $limit"; $result=DBselect($sql); - echo "<CENTER>"; - echo "<TABLE WIDTH=100% BORDER=0 BGCOLOR=\"#CCCCCC\" cellspacing=1 cellpadding=3>"; + echo "<TABLE WIDTH=100% align=center BORDER=0 BGCOLOR=\"#CCCCCC\" cellspacing=1 cellpadding=3>"; echo "<TR>"; echo "<TD><FONT SIZE=+1>Time</FONT></TD>"; echo "<TD><FONT SIZE=+1>Status</FONT></TD>"; @@ -170,11 +169,8 @@ echo "<TD>$proc</TD>"; echo "</TR>"; } - echo "</TABLE><BR>"; + echo "</TABLE>"; ?> -</FONT> -</TR> -</TABLE></CENTER> <? show_footer(); diff --git a/frontends/php/alerts.php b/frontends/php/alerts.php index 983839c7..e595b43b 100644 --- a/frontends/php/alerts.php +++ b/frontends/php/alerts.php @@ -49,13 +49,12 @@ } $result=DBselect($sql); - echo "<CENTER>"; - echo "<TABLE WIDTH=100% BORDER=0 BGCOLOR=\"#CCCCCC\" cellspacing=1 cellpadding=3>"; + echo "<TABLE WIDTH=100% align=center BORDER=0 BGCOLOR=\"#CCCCCC\" cellspacing=1 cellpadding=3>"; echo "<TR>"; - echo "<TD WIDTH=\"10%\"><b>Time</b></TD>"; - echo "<TD WIDTH=\"5%\"><b>Type</b></TD>"; - echo "<TD WIDTH=\"5%\"><b>Status</b></TD>"; - echo "<TD WIDTH=\"15%\"><b>Recipient(s)</b></TD>"; + echo "<TD WIDTH=10%><b>Time</b></TD>"; + echo "<TD WIDTH=5%><b>Type</b></TD>"; + echo "<TD WIDTH=5%><b>Status</b></TD>"; + echo "<TD WIDTH=15%><b>Recipient(s)</b></TD>"; echo "<TD><b>Subject</b></TD>"; echo "<TD><b>Message</b></TD>"; echo "</TR>"; @@ -96,19 +95,20 @@ echo "<TD><font color=\"AA0000\">not sent</font></TD>"; } echo "<TD>".$row["sendto"]."</TD>"; - echo "<TD>".$row["subject"]."</TD>"; + echo "<TD><pre>".$row["subject"]."</pre></TD>"; echo "<TD>"; - for($i=0;$i<strlen($row["message"]);$i++) - { - if($row["message"][$i]=="\n") - { - echo "<br>"; - } - else - { - echo $row["message"][$i]; - } - } + echo "<pre>".$row["message"]."</pre>";; +// for($i=0;$i<strlen($row["message"]);$i++) +// { +// if($row["message"][$i]=="\n") +// { +// echo "<br>"; +// } +// else +// { +// echo $row["message"][$i]; +// } +// } echo "</TD>"; echo "</TR>"; } @@ -116,7 +116,7 @@ ?> </FONT> </TR> -</TABLE></CENTER> +</TABLE> <? show_footer(); diff --git a/frontends/php/charts.php b/frontends/php/charts.php index 44becaf8..7afed486 100644 --- a/frontends/php/charts.php +++ b/frontends/php/charts.php @@ -87,13 +87,13 @@ } show_table_header($map); - echo "<TABLE BORDER=0 COLS=4 WIDTH=\"100%\" BGCOLOR=\"#CCCCCC\" cellspacing=1 cellpadding=3>"; + echo "<TABLE BORDER=0 align=center COLS=4 WIDTH=100% BGCOLOR=\"#CCCCCC\" cellspacing=1 cellpadding=3>"; echo "<TR BGCOLOR=#EEEEEE>"; echo "<TR BGCOLOR=#DDDDDD>"; echo "<TD ALIGN=CENTER>"; if(isset($graphid)) { - echo "<IMG ALIGH=CENTER SRC=\"chart2.php?graphid=$graphid&period=$period&from=$from\">"; + echo "<IMG SRC=\"chart2.php?graphid=$graphid&period=$period&from=$from\">"; } else { @@ -105,7 +105,7 @@ if(isset($graphid)&&(!isset($fullscreen))) { - echo("<center>"); + echo("<div align=center>"); echo("<hr>"); $tmp=$from+12*14; echo("[<A HREF=\"charts.php?graphid=$graphid&from=$tmp&period=$period\">"); @@ -165,7 +165,7 @@ { echo("[Week forward]"); } - echo("</center>"); + echo("</div>"); } ?> diff --git a/frontends/php/compare.php b/frontends/php/compare.php index 29fb403a..bfda81d0 100644 --- a/frontends/php/compare.php +++ b/frontends/php/compare.php @@ -64,7 +64,7 @@ { show_table_header("Select type of trend"); } - echo "<TABLE BORDER=0 COLS=4 WIDTH=\"100%\" BGCOLOR=\"#CCCCCC\" cellspacing=1 cellpadding=3>"; + echo "<TABLE BORDER=0 align=center COLS=4 WIDTH=100% BGCOLOR=\"#CCCCCC\" cellspacing=1 cellpadding=3>"; echo "<TR BGCOLOR=#EEEEEE>"; echo "<TR BGCOLOR=#DDDDDD>"; echo "<TD ALIGN=CENTER>"; diff --git a/frontends/php/graph.php b/frontends/php/graph.php index e7bc0ce3..5af51a15 100644 --- a/frontends/php/graph.php +++ b/frontends/php/graph.php @@ -31,7 +31,7 @@ $result=DBselect("select name from graphs where graphid=$graphid"); $row=DBfetch($result); show_table_header($row["name"]); - echo "<TABLE BORDER=0 COLS=4 WIDTH=\"100%\" BGCOLOR=\"#CCCCCC\" cellspacing=1 cellpadding=3>"; + echo "<TABLE BORDER=0 COLS=4 align=center WIDTH=100% BGCOLOR=\"#CCCCCC\" cellspacing=1 cellpadding=3>"; echo "<TR BGCOLOR=#DDDDDD>"; echo "<TD ALIGN=CENTER>"; echo "<IMG SRC=\"chart2.php?graphid=$graphid&period=3600&from=0\">"; @@ -40,16 +40,15 @@ echo "</TABLE>"; show_table_header("DISPLAYED PARAMETERS"); - echo "<TABLE BORDER=0 COLS=4 WIDTH=\"100%\" BGCOLOR=\"#CCCCCC\" cellspacing=1 cellpadding=3>"; - echo "<TD WIDTH=\"10%\" NOSAVE><B>Host</B></TD>"; - echo "<TD WIDTH=\"10%\" NOSAVE><B>Parameter</B></TD>"; - echo "<TD WIDTH=\"10%\" NOSAVE><B>Color</B></TD>"; - echo "<TD WIDTH=\"10%\" NOSAVE><B>Actions</B></TD>"; + echo "<TABLE BORDER=0 COLS=4 WIDTH=100% BGCOLOR=\"#CCCCCC\" cellspacing=1 cellpadding=3>"; + echo "<TD WIDTH=10% NOSAVE><B>Host</B></TD>"; + echo "<TD WIDTH=10% NOSAVE><B>Parameter</B></TD>"; + echo "<TD WIDTH=10% NOSAVE><B>Color</B></TD>"; + echo "<TD WIDTH=10% NOSAVE><B>Actions</B></TD>"; echo "</TR>"; $sql="select i.itemid,h.host,i.description,gi.gitemid,gi.color from hosts h,graphs_items gi,items i where i.itemid=gi.itemid and gi.graphid=$graphid and h.hostid=i.hostid"; $result=DBselect($sql); - echo "<CENTER>"; $col=0; while($row=DBfetch($result)) { diff --git a/frontends/php/graphs.php b/frontends/php/graphs.php index 460c998a..0b00730b 100644 --- a/frontends/php/graphs.php +++ b/frontends/php/graphs.php @@ -43,16 +43,15 @@ <? show_table_header("GRAPHS"); - echo "<TABLE BORDER=0 COLS=4 WIDTH=\"100%\" BGCOLOR=\"#CCCCCC\" cellspacing=1 cellpadding=3>"; - echo "<TD WIDTH=\"5%\" NOSAVE><B>Id</B></TD>"; - echo "<TD WIDTH=\"10%\" NOSAVE><B>Name</B></TD>"; - echo "<TD WIDTH=\"10%\" NOSAVE><B>Width</B></TD>"; - echo "<TD WIDTH=\"10%\" NOSAVE><B>Height</B></TD>"; - echo "<TD WIDTH=\"10%\" NOSAVE><B>Actions</B></TD>"; + echo "<TABLE BORDER=0 COLS=4 WIDTH=100% BGCOLOR=\"#CCCCCC\" cellspacing=1 cellpadding=3>"; + echo "<TD WIDTH=5% NOSAVE><B>Id</B></TD>"; + echo "<TD WIDTH=10% NOSAVE><B>Name</B></TD>"; + echo "<TD WIDTH=10% NOSAVE><B>Width</B></TD>"; + echo "<TD WIDTH=10% NOSAVE><B>Height</B></TD>"; + echo "<TD WIDTH=10% NOSAVE><B>Actions</B></TD>"; echo "</TR>"; $result=DBselect("select g.graphid,g.name,g.width,g.height from graphs g order by g.name"); - echo "<CENTER>"; $col=0; while($row=DBfetch($result)) { diff --git a/frontends/php/helpdesk.php b/frontends/php/helpdesk.php new file mode 100644 index 00000000..f068eae9 --- /dev/null +++ b/frontends/php/helpdesk.php @@ -0,0 +1,150 @@ +<? + include "include/config.inc.php"; + $page["title"] = "Helpdesk"; + $page["file"] = "helpdesk.php"; + show_header($page["title"],0,0); +?> + +<? + show_table_header_begin(); + echo "IT HELPDESK"; + + show_table_v_delimiter(); +?> + +<? + if(isset($start)&&($start<=0)) + { + unset($start); + } + if(isset($start)) + { + echo "[<A HREF=\"alerts.php?start=".($start-100)."\">"; + echo "Show previous 100</A>] "; + echo "[<A HREF=\"alerts.php?start=".($start+100)."\">"; + echo "Show next 100</A>]"; + } + else + { + echo "[<A HREF=\"alerts.php?start=100\">"; + echo "Show next 100</A>]"; + } + + show_table_header_end(); + echo "<br>"; + + show_table_header("PROBLEMS"); +?> + + +<FONT COLOR="#000000"> +<? + if(!isset($start)) + { + $sql="select problemid,clock,status,description,priority,userid,triggerid,lastupdate,categoryid from problems where status=0 order by clock,priority limit 1000"; + } + else + { + $sql="select a.alertid,a.clock,a.type,a.sendto,a.subject,a.message,ac.triggerid,a.status,a.retries from alerts a,actions ac where a.actionid=ac.actionid order by a.clock desc limit ".($start+1000); + } + $result=DBselect($sql); + + echo "<TABLE WIDTH=100% BORDER=0 align=center BGCOLOR=\"#CCCCCC\" cellspacing=1 cellpadding=3>"; + echo "<TR>"; + echo "<TD WIDTH=10%><b>Registered at</b></TD>"; + echo "<TD WIDTH=10%><b>Priority</b></TD>"; + echo "<TD WIDTH=10%><b>Category</b></TD>"; + echo "<TD WIDTH=10%><b>Description</b></TD>"; + echo "<TD WIDTH=5%><b>Status</b></TD>"; + echo "<TD><b>History</b></TD>"; + echo "</TR>"; + $col=0; + $zzz=0; + while($row=DBfetch($result)) + { + $zzz++; + if(isset($start)&&($zzz<$start)) + { + continue; + } +// if(!check_right_on_trigger("R",$row["triggerid"])) + // { +// continue; +// } + + if($col++%2==0) { echo "<tr bgcolor=#DDDDDD valign=top>"; } + else { echo "<tr bgcolor=#EEEEEE valign=top>"; } + + if($col>100) break; + + echo "<TD><pre>".date("Y.M.d H:i:s",$row["clock"])."</pre></TD>"; + if($row["priority"]==0) echo "<TD ALIGN=CENTER><pre>Not classified</pre></TD>"; + elseif($row["priority"]==1) echo "<TD ALIGN=CENTER><pre>Information</pre></TD>"; + elseif($row["priority"]==2) echo "<TD ALIGN=CENTER><pre>Warning</pre></TD>"; + elseif($row["priority"]==3) echo "<TD ALIGN=CENTER BGCOLOR=#DDAAAA><pre>Average</pre></TD>"; + elseif($row["priority"]==4) echo "<TD ALIGN=CENTER BGCOLOR=#FF8888><pre>High</pre></TD>"; + elseif($row["priority"]==5) echo "<TD ALIGN=CENTER BGCOLOR=RED><pre>Disaster !!!</pre></TD>"; + else echo "<TD ALIGN=CENTER><pre><B>".$row["priority"]."</B></pre></TD>"; + if(isset($row["categoryid"])) + { + echo "<TD align=center><pre>".$row["categoryid"]."</pre></TD>"; + } + else + { + echo "<TD align=center><pre>-</pre></TD>"; + } + echo "<TD><pre>".$row["description"]."</pre></TD>"; + if($row["status"]==0) + { + echo "<TD><pre>Active</pre></TD>"; + } + else + { + echo "<TD><pre>Closed</pre></TD>"; + } + echo "<TD>"; + + $sql="select commentid,problemid,clock,status_before,status_after,comment from problems_comments where problemid=".$row["problemid"]." order by clock"; + $result2=DBselect($sql); + while($row2=DBfetch($result2)) + { + echo "<table WIDTH=100% BORDER=1 BGCOLOR=\"#EEEEEE\" cellspacing=0 cellpadding=1>"; + echo "<tr>"; + echo "<td><b>Registered at:</b></td>"; + echo "<td>".date("Y.M.d H:i:s",$row2["clock"])."</td>"; + echo "</tr>"; + echo "<tr>"; + echo "<td><b>Commented by:</b></td>"; + if(isset($row2["userid"])) + { + $user=get_user_by_userid($row2["userid"]); + echo "<td>".$user["name"]." ".$user["surname"]."</td>"; + } + else + { + echo "<td>Zabbix</td>"; + } + echo "</tr>"; + echo "<tr>"; + echo "<td><pre>".$row2["comment"]."</pre></td>"; + echo "<td><pre>".$row2["comment"]."</pre></td>"; + echo "</tr>"; + echo "<tr>"; + echo "</tr>"; + echo "</table>"; + echo "<hr>"; + } + echo "[<a href=\"helpdesk.php?action=add_comment&problemid=".$row["problemid"]."\">Add comment</a>]"; + echo " [<a href=\"helpdesk.php?action=change_problem&problemid=".$row["problemid"]."\">Change problem</a>]"; + } + echo "</TABLE>"; +?> + +<? + echo "<a name=\"form\"></a>"; + insert_problem_form($problemid); +?> + +<? + show_footer(); +?> diff --git a/frontends/php/history.php b/frontends/php/history.php index 600037aa..d2ba2ff7 100644 --- a/frontends/php/history.php +++ b/frontends/php/history.php @@ -156,7 +156,7 @@ show_table_header("Showing history of $period seconds($hours h)<BR>[from: ".date("Y.M.d H:i:s",$time)."] [till: ".date("Y.M.d H:i:s",$till)."]"); - echo "<TABLE BORDER=0 COLS=2 ALIGN=CENTER WIDTH=\"100%\" BGCOLOR=\"#CCCCCC\" cellspacing=1 cellpadding=3>"; + echo "<TABLE BORDER=0 COLS=2 ALIGN=CENTER WIDTH=100% BGCOLOR=\"#CCCCCC\" cellspacing=1 cellpadding=3>"; echo "<TR>"; echo "<TD><B>Clock</B></TD>"; echo "<TD><B>Value</B></TD>"; @@ -190,10 +190,8 @@ echo "<TD>$value</TD>"; echo "</TR>"; } - echo "</TABLE><CENTER>"; + echo "</TABLE>"; -// echo("</CENTER></BODY></HTML>\n"); - show_footer(); exit; } diff --git a/frontends/php/hosts.php b/frontends/php/hosts.php index 33484e64..cffa7bf9 100644 --- a/frontends/php/hosts.php +++ b/frontends/php/hosts.php @@ -47,17 +47,16 @@ ?> <? - echo "<TABLE BORDER=0 COLS=4 WIDTH=\"100%\" BGCOLOR=\"#CCCCCC\" cellspacing=1 cellpadding=3>"; + echo "<TABLE BORDER=0 COLS=4 align=center WIDTH=100% BGCOLOR=\"#CCCCCC\" cellspacing=1 cellpadding=3>"; echo "<TR>"; - echo "<TD WIDTH=\"3%\" NOSAVE><B>Id</B></TD>"; - echo "<TD WIDTH=\"10%\" NOSAVE><B>Host</B></TD>"; - echo "<TD WIDTH=\"10%\" NOSAVE><B>Port</B></TD>"; - echo "<TD WIDTH=\"10%\" NOSAVE><B>Status</B></TD>"; - echo "<TD WIDTH=\"10%\" NOSAVE><B>Actions</B></TD>"; + echo "<TD WIDTH=3% NOSAVE><B>Id</B></TD>"; + echo "<TD WIDTH=10% NOSAVE><B>Host</B></TD>"; + echo "<TD WIDTH=10% NOSAVE><B>Port</B></TD>"; + echo "<TD WIDTH=10% NOSAVE><B>Status</B></TD>"; + echo "<TD WIDTH=10% NOSAVE><B>Actions</B></TD>"; echo "</TR>"; $result=DBselect("select h.hostid,h.host,h.port,h.status from hosts h order by h.host"); - echo "<CENTER>"; $col=0; while($row=DBfetch($result)) // for($i=0;$i<DBnum_rows($result);$i++) diff --git a/frontends/php/include/config.inc.php b/frontends/php/include/config.inc.php index 8bfc4dad..9588d061 100644 --- a/frontends/php/include/config.inc.php +++ b/frontends/php/include/config.inc.php @@ -5,6 +5,14 @@ $USER_DETAILS =""; $ERROR_MSG =""; + function get_media_count_by_userid($userid) + { + $sql="select count(*) as cnt from media where userid=$userid"; + $result=DBselect($sql); + $row=DBfetch($result); + return $row["cnt"]; + } + function check_right($right,$permission,$id) { global $USER_DETAILS; @@ -586,12 +594,12 @@ where h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=$triggerid"; { ?> - <table border=0 cellspacing=0 cellpadding=0 width="100%" bgcolor=000000> + <table border=0 cellspacing=0 cellpadding=0 width=100% bgcolor=000000> <tr> <td valign="top"> - <table width="100%" border=0 cellspacing=1 cellpadding=3> + <table width=100% border=0 cellspacing=1 cellpadding=3> <tr> - <td colspan=1 bgcolor=FFFFFF align=center valign="top" width="15%"> + <td colspan=1 bgcolor=FFFFFF align=center valign=top width=15%> <font face="Arial,Helvetica" size=2> <? if(check_right("Host","R",0)) @@ -610,7 +618,7 @@ where h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=$triggerid"; ?> </font> </td> - <td colspan=1 bgcolor=FFFFFF align=center valign="top" width="10%"> + <td colspan=1 bgcolor=FFFFFF align=center valign=top width=10%> <font face="Arial,Helvetica" size=2> <? if(check_right("Host","R",0)) @@ -628,7 +636,7 @@ where h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=$triggerid"; ?> </font> </td> - <td colspan=1 bgcolor=FFFFFF align=center valign="top" width="10%"> + <td colspan=1 bgcolor=FFFFFF align=center valign=top width=10%> <font face="Arial,Helvetica" size=2> <? if(check_right("Host","R",0)) @@ -646,7 +654,7 @@ where h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=$triggerid"; ?> </font> </td> - <td colspan=1 bgcolor=FFFFFF align=center valign="top" width="10%"> + <td colspan=1 bgcolor=FFFFFF align=center valign=top width=10%> <font face="Arial,Helvetica" size=2> <a href="latestalarms.php"> <? @@ -662,7 +670,7 @@ where h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=$triggerid"; ?> </font> </td> - <td colspan=1 bgcolor=FFFFFF align=center valign="top" width="15%"> + <td colspan=1 bgcolor=FFFFFF align=center valign=top width=15%> <font face="Arial,Helvetica" size=2> <a href="alerts.php"> <? @@ -677,7 +685,7 @@ where h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=$triggerid"; ?> </font> </td> - <td colspan=1 bgcolor=FFFFFF align=center valign="top" width="15%"> + <td colspan=1 bgcolor=FFFFFF align=center valign=top width=15%> <font face="Arial,Helvetica" size=2> <a href="maps.php"> <? @@ -692,7 +700,7 @@ where h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=$triggerid"; ?> </font> </td> - <td colspan=1 bgcolor=FFFFFF align=center valign="top" width="15%"> + <td colspan=1 bgcolor=FFFFFF align=center valign=top width=15%> <font face="Arial,Helvetica" size=2> <a href="charts.php"> <? @@ -708,7 +716,7 @@ where h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=$triggerid"; </font> </td> - <td colspan=1 bgcolor=FFFFFF align=center valign="top" width="15%"> + <td colspan=1 bgcolor=FFFFFF align=center valign=top width=15%> <font face="Arial,Helvetica" size=2> <? if(check_right("Service","R",0)) @@ -727,9 +735,28 @@ where h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=$triggerid"; </font> </td> + <td colspan=1 bgcolor=FFFFFF align=center valign=top width=15%> + <font face="Arial,Helvetica" size=2> +<? + if(check_right("Helpdesk","R",0)) + { + echo "<a href=\"helpdesk.php\">"; + } + if($page["file"]=="helpdesk.php") + { + echo "<b>[IT HELPDESK]</b></a>"; + } + else + { + echo "IT HELPDESK</a>"; + } +?> + </font> + </td> </tr> + <tr> - <td colspan=2 bgcolor=FFFFFF align=center valign="top" width="15%"> + <td colspan=2 bgcolor=FFFFFF align=center valign=top width=15%> <font face="Arial,Helvetica" size=2> <a href="index.php"> <? @@ -744,7 +771,7 @@ where h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=$triggerid"; ?> </font> </td> - <td colspan=2 bgcolor=FFFFFF align=center valign="top" width="15%"> + <td colspan=2 bgcolor=FFFFFF align=center valign=top width=15%> <font face="Arial,Helvetica" size=2> <a href="about.php"> <? @@ -759,7 +786,7 @@ where h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=$triggerid"; ?> </font> </td> - <td colspan=2 bgcolor=FFFFFF align=center valign="top" width="15%"> + <td colspan=2 bgcolor=FFFFFF align=center valign=top width=15%> <font face="Arial,Helvetica" size=2> <a href="report1.php"> <? @@ -774,7 +801,7 @@ where h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=$triggerid"; ?> </font> </td> - <td colspan=2 bgcolor=FFFFFF align=center valign="top" width="15%"> + <td colspan=3 bgcolor=FFFFFF align=center valign=top width=15%> <font face="Arial,Helvetica" size=2> <a href="report2.php"> <? @@ -808,7 +835,7 @@ where h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=$triggerid"; ?> <tr> - <td colspan=1 bgcolor=FFFFFF align=center valign="top" width="15%"> + <td colspan=1 bgcolor=FFFFFF align=center valign=top width=15%> <font face="Arial,Helvetica" size=2> <? if(check_right("Configuration of Zabbix","U",0)) @@ -826,7 +853,7 @@ where h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=$triggerid"; ?> </font> </td> - <td colspan=1 bgcolor=FFFFFF align=center valign="top" width="10%"> + <td colspan=1 bgcolor=FFFFFF align=center valign=top width=10%> <font face="Arial,Helvetica" size=2> <? if(check_right("User","U",0)) @@ -845,7 +872,7 @@ where h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=$triggerid"; ?> </font> </td> - <td colspan=1 bgcolor=FFFFFF align=center valign="top" width="10%"> + <td colspan=1 bgcolor=FFFFFF align=center valign=top width=10%> <font face="Arial,Helvetica" size=2> <? if(check_right("Host","U",0)) @@ -863,7 +890,7 @@ where h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=$triggerid"; ?> </font> </td> - <td colspan=1 bgcolor=FFFFFF align=center valign="top" width="10%"> + <td colspan=1 bgcolor=FFFFFF align=center valign=top width=10%> <font face="Arial,Helvetica" size=2> <? if(check_right("Host","U",0)) @@ -881,7 +908,7 @@ where h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=$triggerid"; ?> </font> </td> - <td colspan=1 bgcolor=FFFFFF align=center valign="top" width="15%"> + <td colspan=1 bgcolor=FFFFFF align=center valign=top width=15%> <font face="Arial,Helvetica" size=2> <? if(check_right("Host","U",0)) @@ -900,7 +927,7 @@ where h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=$triggerid"; ?> </font> </td> - <td colspan=1 bgcolor=FFFFFF align=center valign="top" width="15%"> + <td colspan=1 bgcolor=FFFFFF align=center valign=top width=15%> <font face="Arial,Helvetica" size=2> <? if(check_right("Network map","U",0)) @@ -919,7 +946,7 @@ where h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=$triggerid"; ?> </font> </td> - <td colspan=1 bgcolor=FFFFFF align=center valign="top" width="15%"> + <td colspan=1 bgcolor=FFFFFF align=center valign=top width=15%> <font face="Arial,Helvetica" size=2> <? if(check_right("Graph","U",0)) @@ -939,7 +966,7 @@ where h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=$triggerid"; </font> </td> - <td colspan=1 bgcolor=FFFFFF align=center valign="top" width="15%"> + <td colspan=1 bgcolor=FFFFFF align=center valign=top width=15%> <font face="Arial,Helvetica" size=2> <? if(check_right("Service","U",0)) @@ -957,6 +984,26 @@ where h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=$triggerid"; ?> </font> </td> + + <td colspan=1 bgcolor=FFFFFF align=center valign=top width=15%> + <font face="Arial,Helvetica" size=2> +<? + if(check_right("Helpdesk","U",0)) + { + echo "<a href=\"helpdesk.php\">"; + } + if($page["file"]=="helpdesk.php") + { + echo "<b>[IT HELPDESK]</b></a>"; + } + else + { + echo "IT HELPDESK</a>"; + } +?> + </font> + </td> + </tr> <? // THird row @@ -1296,6 +1343,39 @@ where h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=$triggerid"; return DBexecute($sql); } + # Return TRUE if triggerid is a reason why the service is not OK + # Warning: recursive function + function does_service_depend_on_the_service($serviceid,$serviceid2) + { +# echo "Serviceid:$serviceid Triggerid:$serviceid2<br>"; + $service=get_service_by_serviceid($serviceid); +# echo "Service status:".$service["status"]."<br>"; + if($service["status"]==0) + { + return FALSE; + } + if($serviceid==$serviceid2) + { + if($service["status"]>0) + { + return TRUE; + } + + } + + $sql="select serviceupid from services_links where servicedownid=$serviceid2 and soft=0"; +# echo $sql."<br>"; + $result=DBselect($sql); + while($row=DBfetch($result)) + { + if(does_service_depend_on_the_service($serviceid,$row["serviceupid"]) == TRUE) + { + return TRUE; + } + } + return FALSE; + } + function service_has_parent($serviceid) { $sql="select count(*) from services_links where servicedownid=$serviceid"; @@ -1366,7 +1446,7 @@ where h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=$triggerid"; function add_host_to_services($hostid,$serviceid) { - $sql="select t.triggerid,t.description from triggers t,hosts h,items i,functions f where h.hostid=$hostid and h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=t.triggerid"; + $sql="select distinct t.triggerid,t.description from triggers t,hosts h,items i,functions f where h.hostid=$hostid and h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=t.triggerid"; $result=DBselect($sql); while($row=DBfetch($result)) { @@ -2300,15 +2380,13 @@ where h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=$triggerid"; function show_table2_header_begin() { - echo "<center>"; - cr(); - echo "<table border=0 cellspacing=0 cellpadding=0 width=\"50%\" bgcolor=000000>"; + echo "<table border=0 align=center cellspacing=0 cellpadding=0 width=50% bgcolor=000000>"; cr(); echo "<tr>"; cr(); echo "<td valign=\"top\">"; cr(); - echo "<table width=\"100%\" border=0 cellspacing=1 cellpadding=3>"; + echo "<table width=100% border=0 cellspacing=1 cellpadding=3>"; cr(); echo "<tr>"; cr(); @@ -2320,13 +2398,13 @@ where h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=$triggerid"; function show_table_header_begin() { - echo "<table border=0 cellspacing=0 cellpadding=0 width=\"100%\" bgcolor=000000>"; + echo "<table border=0 align=center cellspacing=0 cellpadding=0 width=100% bgcolor=000000>"; cr(); echo "<tr>"; cr(); echo "<td valign=\"top\">"; cr(); - echo "<table width=\"100%\" border=0 cellspacing=1 cellpadding=3>"; + echo "<table width=100% border=0 cellspacing=1 cellpadding=3>"; cr(); echo "<tr>"; cr(); @@ -2352,8 +2430,6 @@ where h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=$triggerid"; cr(); echo "</table>"; cr(); - echo "</center>"; - cr(); } function show_table_header_end() @@ -2536,7 +2612,7 @@ where h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=$triggerid"; } // echo("<hr>"); echo "<center>"; - echo "<TABLE BORDER=0 COLS=4 WIDTH=\"100%\" BGCOLOR=\"#CCCCCC\" cellspacing=1 cellpadding=3>"; + echo "<TABLE BORDER=0 COLS=4 WIDTH=100% BGCOLOR=\"#CCCCCC\" cellspacing=1 cellpadding=3>"; echo "<TR BGCOLOR=#EEEEEE>"; echo "<TR BGCOLOR=#DDDDDD>"; echo "<TD ALIGN=CENTER>"; @@ -2922,6 +2998,55 @@ where h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=$triggerid"; show_table2_header_end(); } + # Insert form for Problem + function insert_problem_form($problemid) + { + echo "<br>"; + + show_table2_header_begin(); + echo "Problem definition"; + show_table2_v_delimiter(); + echo "<form method=\"post\" action=\"helpdesk.php\">"; + echo "<input name=\"problemid\" type=hidden value=$problemid size=8>"; + echo "Description"; + show_table2_h_delimiter(); + echo "<input name=\"description\" value=\"$description\" size=70>"; + + show_table2_v_delimiter(); + echo "Priority"; + show_table2_h_delimiter(); + echo "<SELECT NAME=\"priority\" size=\"1\">"; + echo "<OPTION VALUE=\"0\" "; if($priority==0) echo "SELECTED"; echo ">Not classified"; + echo "<OPTION VALUE=\"1\" "; if($priority==1) echo "SELECTED"; echo ">Information"; + echo "<OPTION VALUE=\"2\" "; if($priority==2) echo "SELECTED"; echo ">Warning"; + echo "<OPTION VALUE=\"3\" "; if($priority==3) echo "SELECTED"; echo ">Average"; + echo "<OPTION VALUE=\"4\" "; if($priority==4) echo "SELECTED"; echo ">High"; + echo "<OPTION VALUE=\"5\" "; if($priority==5) echo "SELECTED"; echo ">Disaster"; + echo "</SELECT>"; + + show_table2_v_delimiter(); + echo "Status"; + show_table2_h_delimiter(); + echo "<SELECT NAME=\"status\" value=\"$status\" size=\"1\">"; + echo "<OPTION VALUE=\"0\""; + if($status==0) echo "SELECTED"; + echo ">Opened"; + echo "<OPTION VALUE=\"1\""; + if($status==1) echo "SELECTED"; + echo ">Closed"; + echo "</SELECT>"; + + show_table2_v_delimiter2(); + echo "<input type=\"submit\" name=\"register\" value=\"add\">"; + if(isset($problemid)) + { + echo "<input type=\"submit\" name=\"register\" value=\"update\">"; + echo "<input type=\"submit\" name=\"register\" value=\"delete\">"; + } + + show_table2_header_end(); + } + # Insert form for Trigger function insert_trigger_form($hostid,$triggerid) { @@ -2975,7 +3100,7 @@ where h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=$triggerid"; show_table2_h_delimiter(); echo "<SELECT NAME=\"priority\" size=\"1\">"; echo "<OPTION VALUE=\"0\" "; if($priority==0) echo "SELECTED"; echo ">Not classified"; - echo "<OPTION VALUE=\"1\" "; if($priority==1) echo "SELECTED"; echo ">Just for information"; + echo "<OPTION VALUE=\"1\" "; if($priority==1) echo "SELECTED"; echo ">Information"; echo "<OPTION VALUE=\"2\" "; if($priority==2) echo "SELECTED"; echo ">Warning"; echo "<OPTION VALUE=\"3\" "; if($priority==3) echo "SELECTED"; echo ">Average"; echo "<OPTION VALUE=\"4\" "; if($priority==4) echo "SELECTED"; echo ">High"; @@ -3090,16 +3215,16 @@ where h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=$triggerid"; global $USER_DETAILS; echo "<br>"; - echo "<table border=0 cellpadding=1 cellspacing=0 width=\"100%\" align=center>"; + 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 "<table border=\"0\" cellspacing=\"0\" cellpadding=\"3\" width=100% bgcolor=\"#666666\">"; echo "<tr><td align=center>"; 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 width=\"15%\">"; + echo "<td align=right width=15%>"; echo "<font size=-1>| Connected as ".$USER_DETAILS["alias"]; echo "</td>"; echo "</tr>"; diff --git a/frontends/php/include/db.inc.php b/frontends/php/include/db.inc.php index e3cc63f3..41a2df96 100644 --- a/frontends/php/include/db.inc.php +++ b/frontends/php/include/db.inc.php @@ -28,7 +28,7 @@ { global $DB,$DB_TYPE; -// echo $query,"<br>"; +# echo $query,"<br>"; if($DB_TYPE == "MYSQL") { @@ -46,7 +46,7 @@ { global $DB,$DB_TYPE; -// echo $query,"<br>"; +# echo $query,"<br>"; if($DB_TYPE == "MYSQL") { diff --git a/frontends/php/index.php b/frontends/php/index.php index 3b585223..b906ff30 100644 --- a/frontends/php/index.php +++ b/frontends/php/index.php @@ -39,15 +39,10 @@ } else { - echo "<center>"; + echo "<div align=center>"; echo "Press <a href=\"index.php?reconnect=1\">here</a> to disconnect/reconnect"; - echo "</center>"; + echo "</div>"; } -// echo "<center>"; -// echo "<font face=\"arial,helvetica\" size=2>"; -// echo "Connected as ".$USER_DETAILS["alias"]."</b>"; -// echo "</font>"; -// echo "</center>"; ?> <? diff --git a/frontends/php/items.php b/frontends/php/items.php index d4b31b75..53f5436d 100644 --- a/frontends/php/items.php +++ b/frontends/php/items.php @@ -77,7 +77,6 @@ if(isset($hostid)&&!isset($itemid)) { $result=DBselect("select h.host,i.key_,i.itemid,i.description,h.port,i.delay,i.history,i.lastvalue,i.lastclock,i.status,i.lastdelete,i.nextcheck,h.hostid from hosts h,items i where h.hostid=i.hostid and h.hostid=$hostid order by h.host,i.key_,i.description"); - echo "<CENTER>"; $col=0; while($row=DBfetch($result)) { @@ -93,17 +92,17 @@ } echo "<br>"; show_table_header("<A HREF='items.php?hostid=".$row["hostid"]."'>".$row["host"]."</A>"); - echo "<TABLE BORDER=0 COLS=13 WIDTH=\"100%\" BGCOLOR=\"#CCCCCC\" cellspacing=1 cellpadding=3>"; + echo "<TABLE BORDER=0 COLS=13 align=center WIDTH=100% BGCOLOR=\"#CCCCCC\" cellspacing=1 cellpadding=3>"; echo "<TR>"; - echo "<TD WIDTH=\"3%\" NOSAVE><B>Id</B></TD>"; - echo "<TD WIDTH=\"10%\" NOSAVE><B>Host</B></TD>"; - echo "<TD WIDTH=\"10%\" NOSAVE><B>Key</B></TD>"; - echo "<TD WIDTH=\"10%\" NOSAVE><B>Description</B></TD>"; - echo "<TD WIDTH=\"5%\" NOSAVE><B>Delay</B></TD>"; - echo "<TD WIDTH=\"5%\" NOSAVE><B>History</B></TD>"; + echo "<TD WIDTH=3% NOSAVE><B>Id</B></TD>"; + echo "<TD WIDTH=10% NOSAVE><B>Host</B></TD>"; + echo "<TD WIDTH=10% NOSAVE><B>Key</B></TD>"; + echo "<TD WIDTH=10% NOSAVE><B>Description</B></TD>"; + echo "<TD WIDTH=5% NOSAVE><B>Delay</B></TD>"; + echo "<TD WIDTH=5% NOSAVE><B>History</B></TD>"; echo "<TD><B>Shortname</B></TD>"; - echo "<TD WIDTH=\"5%\" NOSAVE><B>Status</B></TD>"; - echo "<TD WIDTH=\"5%\" NOSAVE><B>Actions</B></TD>"; + echo "<TD WIDTH=5% NOSAVE><B>Status</B></TD>"; + echo "<TD WIDTH=5% NOSAVE><B>Actions</B></TD>"; echo "</TR>"; } $lasthost=$row["host"]; diff --git a/frontends/php/latest.php b/frontends/php/latest.php index b38454f7..81b509da 100644 --- a/frontends/php/latest.php +++ b/frontends/php/latest.php @@ -110,7 +110,7 @@ # echo "<a href=\"latest.php?hostid=$hostid\">$host</a>"; # show_table3_v_delimiter(); - echo "<TABLE BORDER=0 COLS=4 WIDTH=\"100%\" cellspacing=1 cellpadding=3>"; + echo "<TABLE BORDER=0 COLS=4 WIDTH=100% cellspacing=1 cellpadding=3>"; cr(); echo "<TR BGCOLOR=\"CCCCCC\">"; cr(); @@ -135,29 +135,29 @@ } if(isset($sort)&&($sort=="lastcheck")) { - echo "<TD WIDTH=\"12%\"><B>LAST CHECK</B></TD>"; + echo "<TD WIDTH=12%><B>LAST CHECK</B></TD>"; } else { if(isset($select)) { - echo "<TD WIDTH=\"12%\"><B><a href=\"latest.php?select=$select&sort=lastcheck\">Last check</B></TD>"; + 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>"; + 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>"; + echo "<TD WIDTH=10%><B>Last value</B></TD>"; cr(); - echo "<TD WIDTH=\"5%\" NOSAVE><B>Change</B></TD>"; + echo "<TD WIDTH=5%><B>Change</B></TD>"; cr(); - echo "<TD WIDTH=\"5%\" NOSAVE><center><B>History</B></center></TD>"; + echo "<TD WIDTH=5% align=center><B>History</B></TD>"; cr(); - echo "<TD WIDTH=\"5%\" NOSAVE><center><B>Trends</B></center></TD>"; + echo "<TD WIDTH=5% align=center><B>Trends</B></TD>"; cr(); - echo "<TD WIDTH=\"5%\" NOSAVE><center><B>Compare</B></center></TD>"; + echo "<TD WIDTH=5% align=center><B>Compare</B></TD>"; cr(); echo "</TR>"; cr(); @@ -217,12 +217,11 @@ if(!isset($row["lastclock"])) { - echo "<center>-</center>"; + echo "<div align=center>-</div>"; } else { echo date("d M H:i:s",$row["lastclock"]); -// echo date("H:i:s",$row["lastclock"]); } echo "</font></td>"; @@ -246,7 +245,7 @@ } else { - echo "<td><center>-</center></td>"; + echo "<td align=center>-</td>"; } if( isset($row["lastvalue"]) && isset($row["prevvalue"]) && $row["lastvalue"]-$row["prevvalue"] != 0 ) { @@ -254,31 +253,31 @@ } else { - echo "<td><center>-</center></td>"; + echo "<td align=center>-</td>"; } if($row["value_type"]==0) { - echo "<td><center><a href=\"history.php?action=showhistory&itemid=".$row["itemid"]."\">Show</a></center></td>"; + echo "<td align=center><a href=\"history.php?action=showhistory&itemid=".$row["itemid"]."\">Show</a></td>"; } else { - echo "<td><center><a href=\"history.php?action=showvalues&period=3600&itemid=".$row["itemid"]."\">Show</a></center></td>"; + echo "<td align=center><a href=\"history.php?action=showvalues&period=3600&itemid=".$row["itemid"]."\">Show</a></td>"; } if($row["value_type"]==0) { - echo "<td><center><a href=\"trends.php?itemid=".$row["itemid"]."\">Show</a></center></td>"; + echo "<td align=center><a href=\"trends.php?itemid=".$row["itemid"]."\">Show</a></td>"; } else { - echo "<td><center>Show</center></td>"; + echo "<td align=center>Show</td>"; } if($row["value_type"]==0) { - echo "<td><center><a href=\"compare.php?itemid=".$row["itemid"]."\">Show</a></center></td>"; + echo "<td align=center><a href=\"compare.php?itemid=".$row["itemid"]."\">Show</a></td>"; } else { - echo "<td><center>Show</center></td>"; + echo "<td align=center>Show</td>"; } echo "</tr>"; } diff --git a/frontends/php/latestalarms.php b/frontends/php/latestalarms.php index efe89167..37b139bd 100644 --- a/frontends/php/latestalarms.php +++ b/frontends/php/latestalarms.php @@ -49,12 +49,11 @@ } $result=DBselect($sql); - echo "<CENTER>"; - echo "<TABLE WIDTH=100% BORDER=0 BGCOLOR=\"#CCCCCC\" cellspacing=1 cellpadding=3>"; + echo "<TABLE WIDTH=100% align=center BORDER=0 BGCOLOR=\"#CCCCCC\" cellspacing=1 cellpadding=3>"; echo "<TR>"; - echo "<TD width=\"20%\"><b>Time</b></TD>"; + echo "<TD width=20%><b>Time</b></TD>"; echo "<TD><b>Description</b></TD>"; - echo "<TD width=\"10%\"><b>Value</b></TD>"; + echo "<TD width=10%><b>Value</b></TD>"; echo "</TR>"; $col=0; $i=0; @@ -99,7 +98,7 @@ ?> </FONT> </TR> -</TABLE></CENTER> +</TABLE> <? show_footer(); diff --git a/frontends/php/maps.php b/frontends/php/maps.php index 573ace2d..d7b0b3bf 100644 --- a/frontends/php/maps.php +++ b/frontends/php/maps.php @@ -90,7 +90,7 @@ show_table_header($map); - echo "<TABLE BORDER=0 COLS=4 WIDTH=\"100%\" BGCOLOR=\"#CCCCCC\" cellspacing=1 cellpadding=3>"; + echo "<TABLE BORDER=0 COLS=4 align=center WIDTH=100% BGCOLOR=\"#CCCCCC\" cellspacing=1 cellpadding=3>"; echo "<TR BGCOLOR=#EEEEEE>"; echo "<TR BGCOLOR=#DDDDDD>"; echo "<TD ALIGN=CENTER>"; diff --git a/frontends/php/media.php b/frontends/php/media.php index 73572f6b..eed297dd 100644 --- a/frontends/php/media.php +++ b/frontends/php/media.php @@ -16,9 +16,6 @@ } ?> -<? - show_table_header("MEDIA"); -?> <? if(isset($register)) @@ -47,14 +44,16 @@ } ?> +<? + show_table_header("MEDIA"); +?> <FONT COLOR="#000000"> <? $sql="select mediaid,type,sendto,active from media where userid=$userid order by type,sendto"; $result=DBselect($sql); - echo "<CENTER>"; - echo "<TABLE BORDER=0 WIDTH=\"100%\" BGCOLOR=\"#CCCCCC\" cellspacing=1 cellpadding=3>"; + echo "<TABLE BORDER=0 WIDTH=100% align=center BGCOLOR=\"#CCCCCC\" cellspacing=1 cellpadding=3>"; echo "<TR>"; echo "<TD><B>Type</B></TD>"; echo "<TD><B>Send to</B></TD>"; @@ -106,9 +105,8 @@ ?> </FONT> </TR> -</TABLE></CENTER> +</TABLE> -<CENTER> <? echo "<br>"; show_table2_header_begin(); diff --git a/frontends/php/report1.php b/frontends/php/report1.php index 87d50789..7bf036d2 100644 --- a/frontends/php/report1.php +++ b/frontends/php/report1.php @@ -8,9 +8,9 @@ <? show_table_header("STATUS OF ZABBIX"); - echo "<TABLE BORDER=0 WIDTH=\"100%\" BGCOLOR=\"#CCCCCC\" cellspacing=1 cellpadding=3>"; - echo "<TR><TD WIDTH=\"10%\"><B>Parameter</B></TD>"; - echo "<TD WIDTH=\"10%\" NOSAVE><B>Value</B></TD>"; + echo "<TABLE BORDER=0 WIDTH=100% BGCOLOR=\"#CCCCCC\" cellspacing=1 cellpadding=3>"; + echo "<TR><TD WIDTH=10%><B>Parameter</B></TD>"; + echo "<TD WIDTH=10% NOSAVE><B>Value</B></TD>"; echo "</TR>"; $stats=get_stats(); diff --git a/frontends/php/report2.php b/frontends/php/report2.php index 1088d65f..d7b47b6b 100644 --- a/frontends/php/report2.php +++ b/frontends/php/report2.php @@ -46,13 +46,13 @@ 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=$hostid and h.status in (0,2) and i.status=0 order by h.host, t.description"); - echo "<TABLE BORDER=0 COLS=3 WIDTH=\"100%\" BGCOLOR=\"#CCCCCC\" cellspacing=1 cellpadding=3>"; + echo "<TABLE BORDER=0 COLS=3 WIDTH=100% BGCOLOR=\"#CCCCCC\" cellspacing=1 cellpadding=3>"; echo "<TR>"; echo "<TD><B>Description</B></TD>"; echo "<TD><B>Expression</B></TD>"; - echo "<TD WIDTH=\"5%\"><B>True (%)</B></TD>"; - echo "<TD WIDTH=\"5%\"><B>False (%)</B></TD>"; - echo "<TD WIDTH=\"5%\"><B>Unknown (%)</B></TD>"; + echo "<TD WIDTH=5%><B>True (%)</B></TD>"; + echo "<TD WIDTH=5%><B>False (%)</B></TD>"; + echo "<TD WIDTH=5%><B>Unknown (%)</B></TD>"; echo "</TR>\n"; $col=0; while($row=DBfetch($result)) diff --git a/frontends/php/services.php b/frontends/php/services.php index 89fabaea..7e75eae9 100644 --- a/frontends/php/services.php +++ b/frontends/php/services.php @@ -68,8 +68,8 @@ echo "<table border=0 width=100% bgcolor='#CCCCCC' cellspacing=1 cellpadding=3>"; echo "<tr>"; echo "<td><b>Service</b></td>"; - echo "<td width=\"20%\"><b>Status calculation</b></td>"; - echo "<td width=\"10%\"><b>Actions</b></td>"; + echo "<td width=20%><b>Status calculation</b></td>"; + echo "<td width=10%><b>Actions</b></td>"; echo "</tr>"; $col=0; diff --git a/frontends/php/srv_status.php b/frontends/php/srv_status.php index dd052214..eb873bf2 100644 --- a/frontends/php/srv_status.php +++ b/frontends/php/srv_status.php @@ -3,7 +3,7 @@ $page["file"] = "srv_status.php"; include "include/config.inc.php"; - show_header($page["title"],10,0); + show_header($page["title"],30,0); ?> <? @@ -15,7 +15,8 @@ echo "\n"; echo "<tr>"; echo "<td><b>Service</b></td>"; - echo "<td width=\"10%\"><b>Status</b></td>"; + echo "<td width=10%><b>Status</b></td>"; + echo "<td width=20%><b>Reason</b></td>"; echo "</tr>"; echo "\n"; $col=0; @@ -25,6 +26,7 @@ $service=get_service_by_serviceid($serviceid); echo "<td><b><a href=\"srv_status.php?serviceid=".$service["serviceid"]."\">".$service["name"]."</a></b></td>"; echo "<td>".get_service_status_description($service["status"])."</td>"; + echo "<td> </td>"; echo "</tr>"; $col++; } @@ -90,6 +92,30 @@ } } echo "<td>".get_service_status_description($row["status"])."</td>"; + if($row["status"]==0) + { + echo "<td>-</td>"; + } + else + { + echo "<td>"; + $sql="select s.triggerid,s.serviceid from services s, triggers t where s.status>0 and s.triggerid is not NULL and t.triggerid=s.triggerid order by s.status desc,t.description"; + $result2=DBselect($sql); + while($row2=DBfetch($result2)) + { + if(does_service_depend_on_the_service($row["serviceid"],$row2["serviceid"])) + { + $trigger=get_trigger_by_triggerid($row2["triggerid"]); + $description=$trigger["description"]; + if( strstr($description,"%s")) + { + $description=expand_trigger_description($row2["triggerid"]); + } + echo "<li><a href=\"alarms.php?triggerid=".$row2["triggerid"]."\">$description</a></li>"; + } + } + echo "</td>"; + } echo "</tr>"; } echo "</table>"; diff --git a/frontends/php/sysmap.php b/frontends/php/sysmap.php index cb6b23d7..bbd3ccfd 100644 --- a/frontends/php/sysmap.php +++ b/frontends/php/sysmap.php @@ -47,7 +47,7 @@ $result=DBselect("select name from sysmaps where sysmapid=$sysmapid"); $map=DBget_field($result,0,0); show_table_header($map); - echo "<TABLE BORDER=0 COLS=4 WIDTH=\"100%\" BGCOLOR=\"#CCCCCC\" cellspacing=1 cellpadding=3>"; + echo "<TABLE BORDER=0 COLS=4 WIDTH=100% BGCOLOR=\"#CCCCCC\" cellspacing=1 cellpadding=3>"; echo "<TR BGCOLOR=#DDDDDD>"; echo "<TD ALIGN=CENTER>"; if(isset($sysmapid)) @@ -77,17 +77,16 @@ echo "</TABLE>"; show_table_header("DISPLAYED HOSTS"); - echo "<TABLE BORDER=0 COLS=4 WIDTH=\"100%\" BGCOLOR=\"#CCCCCC\" cellspacing=1 cellpadding=3>"; - echo "<TD WIDTH=\"10%\" NOSAVE><B>Host</B></TD>"; - echo "<TD WIDTH=\"10%\" NOSAVE><B>Label</B></TD>"; - echo "<TD WIDTH=\"10%\" NOSAVE><B>X</B></TD>"; - echo "<TD WIDTH=\"10%\" NOSAVE><B>Y</B></TD>"; - echo "<TD WIDTH=\"10%\" NOSAVE><B>Icon</B></TD>"; - echo "<TD WIDTH=\"10%\" NOSAVE><B>Actions</B></TD>"; + echo "<TABLE BORDER=0 COLS=4 align=center WIDTH=100% BGCOLOR=\"#CCCCCC\" cellspacing=1 cellpadding=3>"; + echo "<TD WIDTH=10% NOSAVE><B>Host</B></TD>"; + echo "<TD WIDTH=10% NOSAVE><B>Label</B></TD>"; + echo "<TD WIDTH=10% NOSAVE><B>X</B></TD>"; + echo "<TD WIDTH=10% NOSAVE><B>Y</B></TD>"; + echo "<TD WIDTH=10% NOSAVE><B>Icon</B></TD>"; + echo "<TD WIDTH=10% NOSAVE><B>Actions</B></TD>"; echo "</TR>"; $result=DBselect("select h.host,sh.shostid,sh.sysmapid,sh.hostid,sh.label,sh.x,sh.y,sh.icon from sysmaps_hosts sh,hosts h where sh.sysmapid=$sysmapid and h.hostid=sh.hostid order by h.host"); - echo "<CENTER>"; $col=0; for($i=0;$i<DBnum_rows($result);$i++) { @@ -123,14 +122,13 @@ <? show_table_header("CONNECTORS"); - echo "<TABLE BORDER=0 COLS=4 WIDTH=\"100%\" BGCOLOR=\"#CCCCCC\" cellspacing=1 cellpadding=3>"; - echo "<TD WIDTH=\"10%\" NOSAVE><B>Host 1</B></TD>"; - echo "<TD WIDTH=\"10%\" NOSAVE><B>Host 2</B></TD>"; - echo "<TD WIDTH=\"10%\" NOSAVE><B>Actions</B></TD>"; + echo "<TABLE BORDER=0 COLS=4 align=center WIDTH=100% BGCOLOR=\"#CCCCCC\" cellspacing=1 cellpadding=3>"; + echo "<TD WIDTH=10% NOSAVE><B>Host 1</B></TD>"; + echo "<TD WIDTH=10% NOSAVE><B>Host 2</B></TD>"; + echo "<TD WIDTH=10% NOSAVE><B>Actions</B></TD>"; echo "</TR>"; $result=DBselect("select linkid,shostid1,shostid2 from sysmaps_links where sysmapid=$sysmapid order by linkid"); - echo "<CENTER>"; $col=0; for($i=0;$i<DBnum_rows($result);$i++) { diff --git a/frontends/php/sysmaps.php b/frontends/php/sysmaps.php index 59b21e4d..c663f923 100644 --- a/frontends/php/sysmaps.php +++ b/frontends/php/sysmaps.php @@ -43,16 +43,15 @@ <? show_table_header("NETWORK MAPS"); - echo "<TABLE BORDER=0 COLS=4 WIDTH=\"100%\" BGCOLOR=\"#CCCCCC\" cellspacing=1 cellpadding=3>"; - echo "<TD WIDTH=\"10%\" NOSAVE><B>Id</B></TD>"; - echo "<TD WIDTH=\"10%\" NOSAVE><B>Name</B></TD>"; - echo "<TD WIDTH=\"10%\" NOSAVE><B>Width</B></TD>"; - echo "<TD WIDTH=\"10%\" NOSAVE><B>Height</B></TD>"; - echo "<TD WIDTH=\"10%\" NOSAVE><B>Actions</B></TD>"; + echo "<TABLE BORDER=0 align=center COLS=4 WIDTH=100% BGCOLOR=\"#CCCCCC\" cellspacing=1 cellpadding=3>"; + echo "<TD WIDTH=10% NOSAVE><B>Id</B></TD>"; + echo "<TD WIDTH=10% NOSAVE><B>Name</B></TD>"; + echo "<TD WIDTH=10% NOSAVE><B>Width</B></TD>"; + echo "<TD WIDTH=10% NOSAVE><B>Height</B></TD>"; + echo "<TD WIDTH=10% NOSAVE><B>Actions</B></TD>"; echo "</TR>"; $result=DBselect("select s.sysmapid,s.name,s.width,s.height from sysmaps s order by s.name"); - echo "<CENTER>"; $col=0; while($row=DBfetch($result)) { diff --git a/frontends/php/tr_status.php b/frontends/php/tr_status.php index df6d8ceb..ed0409ec 100644 --- a/frontends/php/tr_status.php +++ b/frontends/php/tr_status.php @@ -239,10 +239,10 @@ if($priority==4) $p4=$count; if($priority==5) $p5=$count; } - echo "\n<TABLE BORDER=0 COLS=6 WIDTH=\"100%\" BGCOLOR=\"#CCCCCC\" cellspacing=1 cellpadding=0>"; + echo "\n<TABLE BORDER=0 COLS=6 align=center WIDTH=100% BGCOLOR=\"#CCCCCC\" cellspacing=1 cellpadding=0>"; echo "<TR ALIGN=CENTER>"; echo "<TD><B>Not classified: $p0</B></TD>"; - echo "<TD><B>Just information: $p1</B></TD>"; + echo "<TD><B>Information: $p1</B></TD>"; echo "<TD><B>Warning: $p2</B></TD>"; echo "<TD BGCOLOR=#DDAAAA><B>Average: $p3</B></TD>"; echo "<TD BGCOLOR=#FF8888><B>High: $p4</B></TD>"; @@ -255,7 +255,7 @@ show_table_header("<A HREF=\"tr_status.php?onlytrue=$onlytrue&noactions=$noactions&compact=$compact&fullscreen=1&sort=$sort\">TRIGGERS $time</A>"); } - echo "<TABLE BORDER=0 COLS=5 WIDTH=\"100%\" BGCOLOR=\"#CCCCCC\" cellspacing=1 cellpadding=3>"; + echo "<TABLE BORDER=0 COLS=5 WIDTH=100% BGCOLOR=\"#CCCCCC\" cellspacing=1 cellpadding=3>"; echo "<TR ALIGN=CENTER>"; if(isset($fullscreen)) @@ -277,20 +277,20 @@ 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>Status</B></TD>"; if(!isset($sort)||(isset($sort) && $sort=="priority")) { - echo "<TD WIDTH=\"9%\" ALIGN=CENTER><B>PRIORITY</B></TD>"; + echo "<TD WIDTH=9% ALIGN=CENTER><B>PRIORITY</B></TD>"; } else { echo "<TD ALIGN=CENTER><B><A HREF=\"tr_status.php?sort=priority&onlytrue=$onlytrue&noactions=$noactions&compact=$compact&select=$select&txt_select=$txt_select$fullscreen$cond\">Priority</a>"; } if($noactions=='true') - echo "<TD WIDTH=\"12%\" ALIGN=CENTER>"; + echo "<TD WIDTH=12% ALIGN=CENTER>"; else - echo "<TD WIDTH=\"5%\" ALIGN=CENTER>"; + echo "<TD WIDTH=5% ALIGN=CENTER>"; if(isset($sort) && $sort=="lastchange") { @@ -304,9 +304,9 @@ if($noactions!='true') { - echo "<TD WIDTH=\"8%\" NOSAVE><B>Actions</B></TD>"; + echo "<TD WIDTH=8% NOSAVE><B>Actions</B></TD>"; } - echo "<TD WIDTH=\"9%\"><B>Comments</B></TD>"; + echo "<TD WIDTH=9%><B>Comments</B></TD>"; echo "</TR>\n"; if(isset($hostid)) @@ -391,15 +391,25 @@ echo "<BR><FONT COLOR=\"#000000\" SIZE=-2>".explode_exp($row["expression"],1)."</FONT>"; } echo "</TD>"; + if( (time(NULL)-$row["lastchange"])<60) + { + $blink1="<blink>"; + $blink2="</blink>"; + } + else + { + $blink1=""; + $blink2=""; + } if($row["value"]==0) - { echo "<TD ALIGN=CENTER><FONT COLOR=\"00AA00\">FALSE</FONT></TD>";} + { echo "<TD ALIGN=CENTER>$blink1<FONT COLOR=\"00AA00\">FALSE</FONT>$blink2</TD>";} else if($row["value"]==2) - { echo "<TD ALIGN=CENTER><FONT COLOR=\"AAAAAA\">UNKNOWN</FONT></TD>"; } + { echo "<TD ALIGN=CENTER>$blink1<FONT COLOR=\"AAAAAA\">UNKNOWN</FONT>$blink2</TD>"; } else - { echo "<TD ALIGN=CENTER><FONT COLOR=\"AA0000\">TRUE</FONT></TD>"; } + { echo "<TD ALIGN=CENTER>$blink1<FONT COLOR=\"AA0000\">TRUE</FONT>$blink2</TD>"; } if($row["priority"]==0) echo "<TD ALIGN=CENTER>Not classified</TD>"; - elseif($row["priority"]==1) echo "<TD ALIGN=CENTER>Just information</TD>"; + elseif($row["priority"]==1) echo "<TD ALIGN=CENTER>Information</TD>"; elseif($row["priority"]==2) echo "<TD ALIGN=CENTER>Warning</TD>"; elseif($row["priority"]==3) echo "<TD ALIGN=CENTER BGCOLOR=#DDAAAA>Average</TD>"; elseif($row["priority"]==4) echo "<TD ALIGN=CENTER BGCOLOR=#FF8888>High</TD>"; diff --git a/frontends/php/trends.php b/frontends/php/trends.php index abcd14db..1df063e9 100644 --- a/frontends/php/trends.php +++ b/frontends/php/trends.php @@ -87,7 +87,7 @@ { show_table_header("Select type of trend"); } - echo "<TABLE BORDER=0 COLS=4 WIDTH=\"100%\" BGCOLOR=\"#CCCCCC\" cellspacing=1 cellpadding=3>"; + echo "<TABLE BORDER=0 COLS=4 align=center WIDTH=100% BGCOLOR=\"#CCCCCC\" cellspacing=1 cellpadding=3>"; echo "<TR BGCOLOR=#EEEEEE>"; echo "<TR BGCOLOR=#DDDDDD>"; echo "<TD ALIGN=CENTER>"; diff --git a/frontends/php/triggers.php b/frontends/php/triggers.php index 643c16f5..fc448b24 100644 --- a/frontends/php/triggers.php +++ b/frontends/php/triggers.php @@ -127,12 +127,12 @@ } echo "<br>"; show_table_header("<A HREF='triggers.php?hostid=".$row["hostid"]."'>".$row["host"]."</A>"); - echo "<TABLE BORDER=0 COLS=3 WIDTH=\"100%\" BGCOLOR=\"#CCCCCC\" cellspacing=1 cellpadding=3>"; + echo "<TABLE BORDER=0 COLS=3 WIDTH=100% BGCOLOR=\"#CCCCCC\" cellspacing=1 cellpadding=3>"; echo "<TR>"; echo "<TD><B>Description</B></TD>"; echo "<TD><B>Expression</B></TD>"; - echo "<TD WIDTH=\"5%\"><B>Status</B></TD>"; - echo "<TD WIDTH=\"15%\" NOSAVE><B>Actions</B></TD>"; + echo "<TD WIDTH=5%><B>Status</B></TD>"; + echo "<TD WIDTH=15% NOSAVE><B>Actions</B></TD>"; echo "</TR>\n"; } $lasthost=$row["host"]; diff --git a/frontends/php/users.php b/frontends/php/users.php index bf75f82e..543bb128 100644 --- a/frontends/php/users.php +++ b/frontends/php/users.php @@ -68,16 +68,15 @@ ?> <? - echo "<TABLE BORDER=0 COLS=4 WIDTH=\"100%\" BGCOLOR=\"#CCCCCC\" cellspacing=1 cellpadding=3>"; - echo "<TR><TD WIDTH=\"3%\"><B>Id</B></TD>"; - echo "<TD WIDTH=\"10%\"><B>Alias</B></TD>"; - echo "<TD WIDTH=\"10%\" NOSAVE><B>Name</B></TD>"; - echo "<TD WIDTH=\"10%\" NOSAVE><B>Surname</B></TD>"; - echo "<TD WIDTH=\"10%\" NOSAVE><B>Actions</B></TD>"; + echo "<TABLE BORDER=0 COLS=4 align=center WIDTH=100% BGCOLOR=\"#CCCCCC\" cellspacing=1 cellpadding=3>"; + echo "<TR><TD WIDTH=3%><B>Id</B></TD>"; + echo "<TD WIDTH=10%><B>Alias</B></TD>"; + echo "<TD WIDTH=10%><B>Name</B></TD>"; + echo "<TD WIDTH=10%><B>Surname</B></TD>"; + echo "<TD WIDTH=10%><B>Actions</B></TD>"; echo "</TR>"; $result=DBselect("select u.userid,u.alias,u.name,u.surname from users u order by u.alias"); - echo "<CENTER>"; $col=0; while($row=DBfetch($result)) { @@ -92,13 +91,21 @@ echo "<TD>".$row["alias"]."</TD>"; echo "<TD>".$row["name"]."</TD>"; echo "<TD>".$row["surname"]."</TD>"; + echo "<TD>"; if(check_right("User","U",$row["userid"])) { - echo "<TD><A HREF=\"users.php?register=change&userid=".$row["userid"]."\">Change</A> - <A HREF=\"media.php?userid=".$row["userid"]."\">Media</A>"; + if(get_media_count_by_userid($row["userid"])>0) + { + echo "<A HREF=\"users.php?register=change&userid=".$row["userid"]."#form\">Change</A> - <A HREF=\"media.php?userid=".$row["userid"]."\"><b>M</b>edia</A>"; + } + else + { + echo "<A HREF=\"users.php?register=change&userid=".$row["userid"]."#form\">Change</A> - <A HREF=\"media.php?userid=".$row["userid"]."\">Media</A>"; + } } else { - echo "<TD>Change - Media"; + echo "Change - Media"; } echo "</TD>"; echo "</TR>"; @@ -109,17 +116,16 @@ <? if(isset($userid)) { - echo "<br>"; + echo "<a name=\"form\"></a>"; show_table_header("USER PERMISSIONS"); - echo "<TABLE BORDER=0 COLS=4 WIDTH=\"100%\" BGCOLOR=\"#CCCCCC\" cellspacing=1 cellpadding=3>"; - echo "<TR><TD WIDTH=\"10%\"><B>Permission</B></TD>"; - echo "<TD WIDTH=\"10%\"><B>Right</B></TD>"; - echo "<TD WIDTH=\"10%\" NOSAVE><B>Resource name</B></TD>"; - echo "<TD WIDTH=\"10%\" NOSAVE><B>Actions</B></TD>"; + echo "<TABLE BORDER=0 align=center COLS=4 WIDTH=100% BGCOLOR=\"#CCCCCC\" cellspacing=1 cellpadding=3>"; + echo "<TR><TD WIDTH=10%><B>Permission</B></TD>"; + echo "<TD WIDTH=10%><B>Right</B></TD>"; + echo "<TD WIDTH=10% NOSAVE><B>Resource name</B></TD>"; + echo "<TD WIDTH=10% NOSAVE><B>Actions</B></TD>"; echo "</TR>"; $result=DBselect("select rightid,name,permission,id from rights where userid=$userid order by name,permission,id"); - echo "<CENTER>"; $col=0; while($row=DBfetch($result)) { |
