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 | |
| 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
44 files changed, 1017 insertions, 270 deletions
@@ -1,10 +1,58 @@ Not ready yet: - - startup scripts - - permissions for charts, graphs ,etc etc + DISTRIBUTED MONITORING: + + - leave for 1.0beta7 + + IT HELPDESK: + + - responsible person (group of persons) for each problem + - update patch and schema for PostgreSQL. Test it! + - IT Helpdesk's problems to be connected to Services only (?) + - module structure for Zabbix. Some modules (as Services, Helpdesk) should be + made separate. + + IT SERVICES: + + - make IT Services stable + - think about service node types (some nodes will automatically register + problem) + + OTHER: + + - make links different if something is already registered (as for medias, + actions, etc) + - get rid of problems with ' and " + - add host groups (one to one or one to many?) + - add user groups + - high level Zabbix schema on paper ! + - permissions for all *.php (charts, graphs , hosts, etc etc ) + - add numeric constants to trigger expressions + - show who is online somewhere (in User config form?) Changes for 1.0beta6: + - 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) - changed definition of functions.lastvalue to allow NULL (Alexei) - added upgrades/dbpatches/1.0beta5_to_1.0beta6/ with patches (Alexei) - added misc/init.d/debian/zabbix_agent (Alexei) @@ -1,3 +1,6 @@ +/* Define if you havnt socklen_t type */ +#undef socklen_t + /* Define if filesystem /proc exists */ #undef HAVE_PROC diff --git a/configure.in b/configure.in index be5a0569..2d9979f1 100644 --- a/configure.in +++ b/configure.in @@ -15,7 +15,6 @@ AC_CHECK_LIB(crypto, main) AC_CHECK_LIB(snmp, main, LIBS="-lsnmp $LIBS") AC_CHECK_LIB(socket, main) AC_CHECK_LIB(nsl, main) -AC_CHECK_LIB(z, main) dnl Checks for header files. AC_HEADER_STDC @@ -33,6 +32,17 @@ dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_TYPE_PID_T +dnl Check for socklen_t +AC_MSG_CHECKING(for socklen_t) +AC_TRY_COMPILE( +[#include <sys/types.h> +#include <unistd.h> +#include <sys/socket.h>], +[socklen_t s;], +AC_MSG_RESULT(yes), +AC_DEFINE(socklen_t, int) +AC_MSG_RESULT(no)) + dnl Check for /proc filesystem AC_MSG_CHECKING(for /proc filesystem) if test -d /proc; then @@ -395,7 +405,9 @@ What DBMS do you want to use (please select only one): dnl MySQL requires -lm sometime AC_CHECK_FUNC(floor, , AC_CHECK_LIB(m, floor, MYSQL_LFLAGS="$MYSQL_LFLAGS -lm")) dnl MySQL 3.23 requires -lz sometime - AC_CHECK_FUNC(compress, , AC_CHECK_LIB(z, compress, MYSQL_LFLAGS="$MYSQL_LFLAGS -lz")) +dnl This does not work for some reason +dnl AC_CHECK_FUNC(compress, , AC_CHECK_LIB(z, compress, MYSQL_LFLAGS="$MYSQL_LFLAGS -lz")) +AC_CHECK_LIB(z, compress, MYSQL_LFLAGS="$MYSQL_LFLAGS -lz") else AC_MSG_RESULT(no) diff --git a/create/mysql/schema.sql b/create/mysql/schema.sql index 2c34f449..a2d5e3d5 100644 --- a/create/mysql/schema.sql +++ b/create/mysql/schema.sql @@ -361,3 +361,48 @@ CREATE TABLE rights ( id int(4), PRIMARY KEY (rightid) ); + +-- +-- Table structure for table 'problems' +-- + +CREATE TABLE problems ( + problemid int(4) NOT NULL auto_increment, + userid int(4) DEFAULT '0' NOT NULL, + triggerid int(4), + lastupdate int(4) DEFAULT '0' NOT NULL, + clock int(4) DEFAULT '0' NOT NULL, + status int(1) DEFAULT '0' NOT NULL, + description varchar(255) DEFAULT '' NOT NULL, + categoryid int(4), + priority int(1) DEFAULT '0' NOT NULL, + PRIMARY KEY (problemid), + KEY (status), + KEY (categoryid), + KEY (priority) +); + +-- +-- Table structure for table 'categories' +-- + +CREATE TABLE categories ( + categoryid int(4) NOT NULL auto_increment, + descripion varchar(64) DEFAULT '' NOT NULL, + PRIMARY KEY (categoryid) +); + +-- +-- Table structure for table 'problems_categories' +-- + +CREATE TABLE problems_comments ( + commentid int(4) NOT NULL auto_increment, + problemid int(4) DEFAULT '0' NOT NULL, + clock int(4), + status_before int(1) DEFAULT '0' NOT NULL, + status_after int(1) DEFAULT '0' NOT NULL, + comment blob, + PRIMARY KEY (commentid), + KEY (problemid,clock) +); diff --git a/doc/manual.lyx b/doc/manual.lyx index 37a01355..f2dc9b6c 100644 --- a/doc/manual.lyx +++ b/doc/manual.lyx @@ -722,7 +722,7 @@ A connection to ISP provider \layout Enumerate -disk space o volume /data on server +disk space on volume /data on server \series bold A \layout Enumerate @@ -801,6 +801,9 @@ AIX 4.3 \layout Itemize FreeBSD 4.3 +\layout Itemize + +SCO OpenServer 5.0.5 \layout Standard Note that @@ -11163,61 +11166,145 @@ The menu item is used to set global Zabbix \series default parameters. -\layout Description +\layout Standard + + +\begin_inset Tabular +<lyxtabular version="2" rows="4" columns="3"> +<features rotate="false" islongtable="false" endhead="0" endfirsthead="0" endfoot="0" endlastfoot="0"> +<column alignment="center" valignment="top" leftline="true" rightline="false" width="" special=""> +<column alignment="center" valignment="top" leftline="true" rightline="true" width="" special=""> +<column alignment="left" valignment="top" leftline="false" rightline="true" width="10cm" special=""> +<row topline="true" bottomline="true" newpage="false"> +<cell multicolumn="0" alignment="center" valignment="top" topline="true" bottomline="false" leftline="true" rightline="false" rotate="false" usebox="none" width="" special=""> +\begin_inset Text -SMTP\SpecialChar ~ -SERVER \layout Standard -Host name or IP address of SMTP server that will be used for sending emails. -\layout Description +Field +\end_inset +</cell> +<cell multicolumn="0" alignment="center" valignment="top" topline="true" bottomline="false" leftline="true" rightline="true" rotate="false" usebox="none" width="" special=""> +\begin_inset Text -Value\SpecialChar ~ -for\SpecialChar ~ -SMTP\SpecialChar ~ -HELO\SpecialChar ~ -authentification \layout Standard -Usually address of +Mandatory +\end_inset +</cell> +<cell multicolumn="0" alignment="left" valignment="top" topline="true" bottomline="false" leftline="true" rightline="true" rotate="false" usebox="none" width="" special=""> +\begin_inset Text + +\layout Standard + +Description +\end_inset +</cell> +</row> +<row topline="true" bottomline="false" newpage="false"> +<cell multicolumn="0" alignment="center" valignment="top" topline="true" bottomline="false" leftline="true" rightline="false" rotate="false" usebox="none" width="" special=""> +\begin_inset Text + +\layout Standard + +SMTP server +\end_inset +</cell> +<cell multicolumn="0" alignment="center" valignment="top" topline="true" bottomline="false" leftline="true" rightline="true" rotate="false" usebox="none" width="" special=""> +\begin_inset Text + +\layout Standard + +Yes +\end_inset +</cell> +<cell multicolumn="0" alignment="center" valignment="top" topline="true" bottomline="false" leftline="true" rightline="true" rotate="false" usebox="none" width="" special=""> +\begin_inset Text + +\layout Standard + +IP address or name of SMTP server. + \series bold -Zabbix +Zabbix \series default - server. +sends all messages via this server. +\end_inset +</cell> +</row> +<row topline="true" bottomline="false" newpage="false"> +<cell multicolumn="0" alignment="center" valignment="top" topline="true" bottomline="false" leftline="true" rightline="false" rotate="false" usebox="none" width="" special=""> +\begin_inset Text + \layout Standard -Example: -\emph on -zabbix.sf.net -\layout Description +Value for SMTP HELO auth. +\end_inset +</cell> +<cell multicolumn="0" alignment="center" valignment="top" topline="true" bottomline="false" leftline="true" rightline="true" rotate="false" usebox="none" width="" special=""> +\begin_inset Text -Zabbix\SpecialChar ~ -email\SpecialChar ~ -address\SpecialChar ~ -to\SpecialChar ~ -send\SpecialChar ~ -emals\SpecialChar ~ -from \layout Standard -Email address which will be used to fill field From: for all emails that - +No +\end_inset +</cell> +<cell multicolumn="0" alignment="center" valignment="top" topline="true" bottomline="false" leftline="true" rightline="true" rotate="false" usebox="none" width="" special=""> +\begin_inset Text + +\layout Standard + +Usually set to domain name. + If not specified, \series bold Zabbix \series default - will send. -\layout Description + will not use HELO authentification. + Example: +\emph on +sourceforge.net. +\end_inset +</cell> +</row> +<row topline="true" bottomline="true" newpage="false"> +<cell multicolumn="0" alignment="center" valignment="top" topline="true" bottomline="false" leftline="true" rightline="false" rotate="false" usebox="none" width="" special=""> +\begin_inset Text -Password\SpecialChar ~ -required? \layout Standard -If checked, user authorisation will be required for accessing any menu item - of + \series bold Zabbix \series default - WEB front-end. + email address +\end_inset +</cell> +<cell multicolumn="0" alignment="center" valignment="top" topline="true" bottomline="false" leftline="true" rightline="true" rotate="false" usebox="none" width="" special=""> +\begin_inset Text + +\layout Standard + +Yes +\end_inset +</cell> +<cell multicolumn="0" alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" rotate="false" usebox="none" width="" special=""> +\begin_inset Text + +\layout Standard +\align left + +\series bold +Zabbix +\series default +uses this address as source address for all emails. +\end_inset +</cell> +</row> +</lyxtabular> + +\end_inset + + \layout Subsubsection Reports @@ -15976,6 +16063,62 @@ Browser should be configured to accept cookies. Zabbix \series default uses cookies to store session-related information. +\layout Subsection + +Undefined references to +\emph on +compress +\emph default +and +\emph on +uncompress +\layout Standard + + +\family typewriter +\emph on +/usr/lib/libmysqlclient.a(my_compress.o): In function `my_uncompress': +\layout Standard + + +\family typewriter +\emph on +my_compress.o(.text+0xa1): undefined reference to `uncompress' +\layout Standard + + +\family typewriter +\emph on +/usr/lib/libmysqlclient.a(my_compress.o): In function `my_compress_alloc': +\layout Standard + + +\family typewriter +\emph on +my_compress.o(.text+0x138): undefined reference to `compress' +\newline + +\layout Itemize + +These messages indicate that +\emph on +./configure +\emph default + is unable to find +\emph on +libz +\emph default + installed. + The problem should appear only in case if flag +\emph on +--enable-static +\emph default +is specified. + Install package +\emph on +libz-dev +\emph default +package to ged rid of the problem. \layout Section How Zabbix Compares to Other Monitoring Software @@ -16049,6 +16192,12 @@ Improved WEB interface TODO (1.0 stable) \layout Itemize +support for IT helpdesk +\layout Itemize + +timeout for sending alerts +\layout Itemize + \emph on ./configure @@ -16319,6 +16468,18 @@ Help with various issues related to C, C functions, etc \noun on +ALEXANDER KIRHENSTEIN +\layout Standard + +Suggested fixes to make +\series bold +Zabbix +\series default +work under SCO. +\layout Itemize + + +\noun on ARTURS ABOLTINS \layout Standard 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)) { diff --git a/include/common.h b/include/common.h index 3018a20e..ad841c77 100644 --- a/include/common.h +++ b/include/common.h @@ -1,5 +1,7 @@ /*#define TESTTEST*/ +#define IT_HELPDESK + #ifndef ZABBIX_COMMON_H #define ZABBIX_COMMON_H diff --git a/include/db.c b/include/db.c index 90e6451b..b397b92c 100644 --- a/include/db.c +++ b/include/db.c @@ -354,7 +354,7 @@ int latest_alarm(int triggerid, int status) return ret; } -int DBadd_alarm(int triggerid,int status,int clock) +int add_alarm(int triggerid,int status,int clock) { char sql[MAX_STRING_LEN+1]; @@ -374,17 +374,26 @@ int DBadd_alarm(int triggerid,int status,int clock) return SUCCEED; } -int update_trigger_value(int triggerid,int value,int clock) +#ifdef IT_HELPDESK +void update_problems(int triggerid, int value, int clock) +{ +} +#endif + +int DBupdate_trigger_value(int triggerid,int value,int clock) { char sql[MAX_STRING_LEN+1]; zabbix_log(LOG_LEVEL_DEBUG,"In update_trigger_value()"); - DBadd_alarm(triggerid,value,clock); + add_alarm(triggerid,value,clock); - sprintf(sql,"update triggers set value=%d where triggerid=%d",value,triggerid); - zabbix_log(LOG_LEVEL_DEBUG,"SQL [%s]",sql); + sprintf(sql,"update triggers set value=%d,lastchange=%d where triggerid=%d",value,clock,triggerid); DBexecute(sql); +#ifdef IT_HELPDESK + update_problems(triggerid,value,clock); +#endif + zabbix_log(LOG_LEVEL_DEBUG,"End of update_trigger_value()"); return SUCCEED; } @@ -406,7 +415,7 @@ void update_triggers_status_to_unknown(int hostid,int clock) for(i=0;i<DBnum_rows(result);i++) { triggerid=atoi(DBget_field(result,i,0)); - update_trigger_value(triggerid,TRIGGER_VALUE_UNKNOWN,clock); + DBupdate_trigger_value(triggerid,TRIGGER_VALUE_UNKNOWN,clock); } DBfree_result(result); @@ -450,7 +459,7 @@ void DBupdate_triggers_status_after_restart(void) lastchange=atoi(DBget_field(result2,0,0)); DBfree_result(result2); - update_trigger_value(triggerid,TRIGGER_VALUE_UNKNOWN,lastchange); + DBupdate_trigger_value(triggerid,TRIGGER_VALUE_UNKNOWN,lastchange); } DBfree_result(result); diff --git a/include/db.h b/include/db.h index cb0d4901..d553c912 100644 --- a/include/db.h +++ b/include/db.h @@ -131,9 +131,10 @@ void DBupdate_host_status(int hostid,int status,int clock); int DBupdate_item_status_to_notsupported(int itemid); int DBadd_history(int itemid, double value); int DBadd_history_str(int itemid, char *value); -int DBadd_alarm(int triggerid, int status,int clock); +/*int DBadd_alarm(int triggerid, int status,int clock);*/ int DBadd_alert(int actionid, char *type, char *sendto, char *subject, char *message); void DBupdate_triggers_status_after_restart(void); int DBget_prev_trigger_value(int triggerid); +int DBupdate_trigger_value(int triggerid,int value,int clock); #endif diff --git a/include/functions.c b/include/functions.c index 1e9f7212..450c2792 100644 --- a/include/functions.c +++ b/include/functions.c @@ -240,7 +240,7 @@ void update_functions(DB_ITEM *item) /* * Send email */ -int send_mail(char *smtp_server,char *smtp_helo,char *smtp_email,char *mailto,char *mailsubject,char *mailbody) +int send_email(char *smtp_server,char *smtp_helo,char *smtp_email,char *mailto,char *mailsubject,char *mailbody) { int s; int i,e; @@ -728,10 +728,11 @@ void update_triggers( int suckers, int flag, int sucker_num, int lastclock ) if(trigger.value != TRIGGER_VALUE_TRUE) { now = time(NULL); - sprintf(sql,"update triggers set value=%d, lastchange=%d where triggerid=%d",TRIGGER_VALUE_TRUE,now,trigger.triggerid); + DBupdate_trigger_value(trigger.triggerid,TRIGGER_VALUE_TRUE,now); +/* sprintf(sql,"update triggers set value=%d, lastchange=%d where triggerid=%d",TRIGGER_VALUE_TRUE,now,trigger.triggerid); DBexecute(sql); - DBadd_alarm(trigger.triggerid, TRIGGER_VALUE_TRUE, now); + DBadd_alarm(trigger.triggerid, TRIGGER_VALUE_TRUE, now);*/ } if((trigger.value == TRIGGER_VALUE_FALSE) || @@ -755,10 +756,12 @@ void update_triggers( int suckers, int flag, int sucker_num, int lastclock ) if(trigger.value != TRIGGER_VALUE_FALSE) { now = time(NULL); - sprintf(sql,"update triggers set value=%d, lastchange=%d where triggerid=%d",TRIGGER_VALUE_FALSE,now,trigger.triggerid); + DBupdate_trigger_value(trigger.triggerid,TRIGGER_VALUE_FALSE,now); + +/* sprintf(sql,"update triggers set value=%d, lastchange=%d where triggerid=%d",TRIGGER_VALUE_FALSE,now,trigger.triggerid); DBexecute(sql); - DBadd_alarm(trigger.triggerid, TRIGGER_VALUE_FALSE,now); + DBadd_alarm(trigger.triggerid, TRIGGER_VALUE_FALSE,now);*/ } if((trigger.value == TRIGGER_VALUE_TRUE) diff --git a/include/functions.h b/include/functions.h index 33052d6a..58f20ce6 100644 --- a/include/functions.h +++ b/include/functions.h @@ -7,6 +7,6 @@ void update_triggers (int suckers, int flag,int sucker_num,int lastclock); int get_lastvalue(char *value,char *host,char *key,char *function,char *parameter); int process_data(int sockfd,char *server,char *key, char *value); void process_new_value(DB_ITEM *item,char *value); -int send_mail(char *smtp_server,char *smtp_helo,char *smtp_email,char *mailto,char *mailsubject,char *mailbody); +int send_email(char *smtp_server,char *smtp_helo,char *smtp_email,char *mailto,char *mailsubject,char *mailbody); #endif diff --git a/misc/init.d/debian/zabbix-server b/misc/init.d/debian/zabbix-suckerd index 26e78305..26e78305 100755 --- a/misc/init.d/debian/zabbix-server +++ b/misc/init.d/debian/zabbix-suckerd diff --git a/misc/init.d/debian/zabbix-trapperd b/misc/init.d/debian/zabbix-trapperd new file mode 100755 index 00000000..06ef9048 --- /dev/null +++ b/misc/init.d/debian/zabbix-trapperd @@ -0,0 +1,51 @@ +#! /bin/sh +# +# Zabbix daemon start/stop script. +# +# Written by Alexei Vladishev <alex@gobbo.caves.lv>. + +PATH=/bin:/usr/bin:/sbin:/usr/sbin:/home/zabbix/bin +DAEMON=/home/zabbix/bin/zabbix_trapperd +NAME=zabbix_trapperd +DESC="Zabbix trapper daemon" + +test -f $DAEMON || exit 0 + +set -e + +case "$1" in + start) + echo "Starting $DESC: $NAME" + start-stop-daemon --oknodo --start --pidfile /tmp/$NAME.pid \ + --exec $DAEMON + ;; + stop) + echo "Stopping $DESC: $NAME" + start-stop-daemon --oknodo --stop --pidfile /tmp/$NAME.pid \ + --exec $DAEMON + ;; + restart|force-reload) + # + # If the "reload" option is implemented, move the "force-reload" + # option to the "reload" entry above. If not, "force-reload" is + # just the same as "restart". + # +# echo -n "Restarting $DESC: zabbix_suckerd" + $0 stop + $0 start +# start-stop-daemon --stop --quiet --pidfile \ +# /tmp/$NAME.pid --user zabbix --exec $DAEMON +# sleep 1 +# start-stop-daemon --start --quiet --pidfile \ +# /tmp/$NAME.pid --user zabbix --exec $DAEMON +# echo "$NAME." + ;; + *) + N=/etc/init.d/$NAME + # echo "Usage: $N {start|stop|restart|force-reload}" >&2 + echo "Usage: $N {start|stop|restart|force-reload}" >&2 + exit 1 + ;; +esac + +exit 0 diff --git a/src/zabbix_sucker/zabbix_sucker.c b/src/zabbix_sucker/zabbix_sucker.c index 5e5e756a..78435403 100644 --- a/src/zabbix_sucker/zabbix_sucker.c +++ b/src/zabbix_sucker/zabbix_sucker.c @@ -785,10 +785,17 @@ int housekeeping_history(int now) item.lastdelete=atoi(DBget_field(result,i,1)); item.history=atoi(DBget_field(result,i,2)); -/* To be rewritten. Only one delete depending on item.value_type */ +#ifdef HAVE_MYSQL + sprintf (sql,"delete from history where itemid=%d and clock<%d limit %d",item.itemid,now-24*3600*item.history,CONFIG_HOUSEKEEPING_FREQUENCY*3600); +#else sprintf (sql,"delete from history where itemid=%d and clock<%d",item.itemid,now-24*3600*item.history); +#endif DBexecute(sql); +#ifdef HAVE_MYSQL + sprintf (sql,"delete from history_str where itemid=%d and clock<%d limit %d",item.itemid,now-24*3600*item.history,CONFIG_HOUSEKEEPING_FREQUENCY*3600); +#else sprintf (sql,"delete from history_str where itemid=%d and clock<%d",item.itemid,now-24*3600*item.history); +#endif DBexecute(sql); sprintf(sql,"update items set lastdelete=%d where itemid=%d",now,item.itemid); @@ -798,6 +805,16 @@ int housekeeping_history(int now) return SUCCEED; } +int housekeeping_sessions(int now) +{ + char sql[MAX_STRING_LEN+1]; + + sprintf (sql,"delete from sessions where lastaccess<%d",now-24*3600); + DBexecute(sql); + + return SUCCEED; +} + int housekeeping_alerts(int now) { char sql[MAX_STRING_LEN+1]; @@ -859,7 +876,7 @@ int main_alerter_loop() char sql[MAX_STRING_LEN+1]; - int i; + int i,res; DB_RESULT *result; DB_ALERT alert; @@ -899,7 +916,11 @@ int main_alerter_loop() if(strcmp(alert.type,ALERT_TYPE_EMAIL)==0) { - if(FAIL == send_mail(smtp_server,smtp_helo,smtp_email,alert.sendto,alert.subject,alert.message)) + /* Hardcoded value */ + alarm(10); + res = send_email(smtp_server,smtp_helo,smtp_email,alert.sendto,alert.subject,alert.message); + alarm(0); + if(FAIL == res) { zabbix_log( LOG_LEVEL_ERR, "Error sending email to '%s' Subject:'%s'", alert.sendto, alert.subject); sprintf(sql,"update alerts set retries=retries+1 where alertid=%d", alert.alertid); @@ -958,20 +979,23 @@ int main_housekeeping_loop() #ifdef HAVE_FUNCTION_SETPROCTITLE setproctitle("housekeeper [removing old values]"); #endif - housekeeping_history(now); #ifdef HAVE_FUNCTION_SETPROCTITLE setproctitle("housekeeper [removing old alarms]"); #endif - housekeeping_alarms(now); #ifdef HAVE_FUNCTION_SETPROCTITLE setproctitle("housekeeper [removing old alerts]"); #endif - housekeeping_alerts(now); + +#ifdef HAVE_FUNCTION_SETPROCTITLE + setproctitle("housekeeper [removing old sessions]"); +#endif + housekeeping_sessions(now); + zabbix_log( LOG_LEVEL_DEBUG, "Sleeping for %d hours", CONFIG_HOUSEKEEPING_FREQUENCY); #ifdef HAVE_FUNCTION_SETPROCTITLE diff --git a/upgrades/dbpatches/1.0beta5_to_1.0beta6/mysql/patch.sql b/upgrades/dbpatches/1.0beta5_to_1.0beta6/mysql/patch.sql index 17a5ba09..6b5c5281 100644 --- a/upgrades/dbpatches/1.0beta5_to_1.0beta6/mysql/patch.sql +++ b/upgrades/dbpatches/1.0beta5_to_1.0beta6/mysql/patch.sql @@ -1 +1,47 @@ alter table functions modify lastvalue varchar(255); + + +-- +-- Table structure for table 'problems' +-- + +CREATE TABLE problems ( + problemid int(4) NOT NULL auto_increment, + userid int(4) DEFAULT '0' NOT NULL, + triggerid int(4), + lastupdate int(4) DEFAULT '0' NOT NULL, + clock int(4) DEFAULT '0' NOT NULL, + status int(1) DEFAULT '0' NOT NULL, + description varchar(255) DEFAULT '' NOT NULL, + categoryid int(4), + priority int(1) DEFAULT '0' NOT NULL, + PRIMARY KEY (problemid), + KEY (status), + KEY (categoryid), + KEY (priority) +); + +-- +-- Table structure for table 'categories' +-- + +CREATE TABLE categories ( + categoryid int(4) NOT NULL auto_increment, + descripion varchar(64) DEFAULT '' NOT NULL, + PRIMARY KEY (categoryid) +); + +-- +-- Table structure for table 'problems_comments' +-- + +CREATE TABLE problems_comments ( + commentid int(4) NOT NULL auto_increment, + problemid int(4) DEFAULT '0' NOT NULL, + clock int(4), + status_before int(1) DEFAULT '0' NOT NULL, + status_after int(1) DEFAULT '0' NOT NULL, + comment blob, + PRIMARY KEY (commentid), + KEY (problemid,clock) +); diff --git a/upgrades/dbpatches/1.0beta5_to_1.0beta6/postgresql/patch.sql b/upgrades/dbpatches/1.0beta5_to_1.0beta6/postgresql/patch.sql index 17a5ba09..5962ac0c 100644 --- a/upgrades/dbpatches/1.0beta5_to_1.0beta6/postgresql/patch.sql +++ b/upgrades/dbpatches/1.0beta5_to_1.0beta6/postgresql/patch.sql @@ -1 +1,47 @@ -alter table functions modify lastvalue varchar(255); +alter table functions alter lastvalue varchar(255); + + +-- +-- Table structure for table 'problems' +-- + +CREATE TABLE problems ( + problemid int4 NOT NULL auto_increment, + userid int4 DEFAULT '0' NOT NULL, + triggerid int4, + lastupdate int4 DEFAULT '0' NOT NULL, + clock int4 DEFAULT '0' NOT NULL, + status int1 DEFAULT '0' NOT NULL, + descripion varchar(255) DEFAULT '' NOT NULL, + categoryid int4, + priority int1 DEFAULT '0' NOT NULL, + PRIMARY KEY (problemid), + KEY (status), + KEY (categoryid), + KEY (priority) +); + +-- +-- Table structure for table 'categories' +-- + +CREATE TABLE categories ( + categoryid int(4) NOT NULL auto_increment, + descripion varchar(64) DEFAULT '' NOT NULL, + PRIMARY KEY (categoryid) +); + +-- +-- Table structure for table 'problems_comments' +-- + +CREATE TABLE problems_comments ( + commentid int(4) NOT NULL auto_increment, + problemid int(4) DEFAULT '0' NOT NULL, + clock int(4), + status_before int(1) DEFAULT '0' NOT NULL, + status_after int(1) DEFAULT '0' NOT NULL, + comment blob, + PRIMARY KEY (commentid), + KEY (problemid,clock) +); |
