summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2001-11-24 14:20:36 +0000
committerhugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2001-11-24 14:20:36 +0000
commit772e6d0f37d4533b39a51f7b5c42c618e6af7c13 (patch)
treed49130bb4b0f06ab440dd288cabeccfb5918a94b
parent3013847c08c1b9c6e8941cbaeb0d2da7cdb002b5 (diff)
downloadzabbix-772e6d0f37d4533b39a51f7b5c42c618e6af7c13.tar.gz
zabbix-772e6d0f37d4533b39a51f7b5c42c618e6af7c13.tar.xz
zabbix-772e6d0f37d4533b39a51f7b5c42c618e6af7c13.zip
- added columns alert_history and alarm_history to table config (Alexei)
- added link from graphs to trends and vs (Alexei) - housekeeping process in zabbix_suckerd will also delete old records from tables alerts and alarms (Alexei) - added directory upgrades/dbpatches/1.0alpha11_to_1.0alpha12 (Alexei) - added index on column "clock" for table alarms (Alexei) git-svn-id: svn://svn.zabbix.com/trunk@252 97f52cf1-0a1b-0410-bd0e-c28be96e8082
-rw-r--r--ChangeLog8
-rw-r--r--create/mysql/schema.sql7
-rw-r--r--create/postgresql/schema.sql5
-rw-r--r--doc/manual.lyx302
-rw-r--r--frontends/php/config.html26
-rw-r--r--frontends/php/history.html2
-rw-r--r--frontends/php/include/config.inc27
-rw-r--r--frontends/php/trends.html8
-rw-r--r--include/common.h6
-rw-r--r--src/zabbix_sucker/zabbix_sucker.c53
-rw-r--r--src/zabbix_trapper/zabbix_trapperd.c2
-rw-r--r--upgrades/dbpatches/1.0alpha11_to_1.0alpha12/mysql/patch.sql3
-rw-r--r--upgrades/dbpatches/1.0alpha11_to_1.0alpha12/postgresql/patch.sql3
13 files changed, 422 insertions, 30 deletions
diff --git a/ChangeLog b/ChangeLog
index 6441e3ed..bcf363e6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,10 +1,16 @@
Changes for 1.0alpha12:
+ - added columns alert_history and alarm_history to table config (Alexei)
+ - added link from graphs to trends and vs (Alexei)
+ - housekeeping process in zabbix_suckerd will also delete old records from tables
+ alerts and alarms (Alexei)
+ - added directory upgrades/dbpatches/1.0alpha11_to_1.0alpha12 (Alexei)
+ - added index on column "clock" for table alarms (Alexei)
+
- cleanup of all *.html files (Alexei)
- removed doc/dbstructure (Alexei)
- removed doc/manual.txt (Alexei)
- minor changes in manual.lyx (Alexei)
-
- added version (draft 1.01) to manual.lyx
- character '-' can be used to form server name (Alexei)
- fixed dependencies in functions that delete information for zabbix tables (Alexei)
diff --git a/create/mysql/schema.sql b/create/mysql/schema.sql
index 8e445c5a..926e93c1 100644
--- a/create/mysql/schema.sql
+++ b/create/mysql/schema.sql
@@ -73,7 +73,9 @@ CREATE TABLE config (
smtp_server varchar(255) DEFAULT '' NOT NULL,
smtp_helo varchar(255) DEFAULT '' NOT NULL,
smtp_email varchar(255) DEFAULT '' NOT NULL,
- password_required int(1) DEFAULT '0' NOT NULL
+ password_required int(1) DEFAULT '0' NOT NULL,
+ alert_history int(4) DEFAULT '0' NOT NULL,
+ alarm_history int(4) DEFAULT '0' NOT NULL
);
#
@@ -131,7 +133,8 @@ CREATE TABLE alarms (
clock int(4) DEFAULT '0' NOT NULL,
istrue int(4) DEFAULT '0' NOT NULL,
PRIMARY KEY (alarmid),
- KEY (triggerid,clock)
+ KEY (triggerid,clock),
+ KEY (clock)
);
#
diff --git a/create/postgresql/schema.sql b/create/postgresql/schema.sql
index bf7913ac..504dac74 100644
--- a/create/postgresql/schema.sql
+++ b/create/postgresql/schema.sql
@@ -53,7 +53,9 @@ CREATE TABLE config (
smtp_server varchar(255) DEFAULT '' NOT NULL,
smtp_helo varchar(255) DEFAULT '' NOT NULL,
smtp_email varchar(255) DEFAULT '' NOT NULL,
- password_required int4 DEFAULT '0' NOT NULL
+ password_required int4 DEFAULT '0' NOT NULL,
+ alert_history int4 DEFAULT '0' NOT NULL,
+ alarm_history int4 DEFAULT '0' NOT NULL
);
--
@@ -165,6 +167,7 @@ CREATE TABLE alarms (
);
CREATE INDEX alarms_triggerid_clock on alarms (triggerid, clock);
+CREATE INDEX alarms_clock on alarms (clock);
--
-- Table structure for table 'functions'
diff --git a/doc/manual.lyx b/doc/manual.lyx
index 39b5b1fd..c7f05c6d 100644
--- a/doc/manual.lyx
+++ b/doc/manual.lyx
@@ -24,7 +24,7 @@
\layout Title
\added_space_top vfill
-Zabbix Reference Manual for version 1.0 (draft v1.02)
+Zabbix Reference Manual for version 1.0 (draft v1.03)
\layout Author
ALEXEI VLADISHEV
@@ -1199,6 +1199,53 @@ IMPORTANT.
tcp_count
\series default
is not supported anymore.
+\layout Subsubsection
+
+Zabbix 1.0alpha12
+\layout Itemize
+
+Do not forget to apply DB patches
+\layout Itemize
+
+Note that character '-' can be used in host names
+\layout Itemize
+
+Note that if parameter is defined as
+\series bold
+parameter[*]
+\series default
+, you can pass any string as
+\series bold
+'*'
+\series default
+.
+\layout Itemize
+
+Note that new parameter
+\series bold
+check_port[*]
+\series default
+ added.
+
+\series bold
+'*'
+\series default
+ is any port number.
+\layout Itemize
+
+Note that new operator
+\series bold
+'='
+\series default
+ added.
+\layout Itemize
+
+Note that Zabbix manual will be distributed in the followinf formats: LyX,
+ PS, PDF and plain text.
+\layout Itemize
+
+Zabbix 1.0alpha12 is latest alpha version.
+ Next Zabbix version will be called 1.0beta1.
\layout Subsection
ChangeLog
@@ -1631,7 +1678,51 @@ h.
One zabbix_suckerd process is used for housekeeping purposes only.\SpecialChar ~
The housekeepi
ng process periodically (hourly, by default) deletes outdated information
- from table history.
+ from
+\latex default
+the following tables:
+\series bold
+history
+\series default
+,
+\series bold
+alarms
+\series default
+ and
+\series bold
+alerts
+\series default
+\latex no_latex
+.
+\layout Standard
+
+Constant SUCKER_HK from
+\shape italic
+include/common.h
+\shape default
+ defines how often housekeping process executes.
+\layout Standard
+
+Housekeeping process will delete all records from table
+\series bold
+alarms
+\series default
+ older than value defined in Zabbix configuration.
+
+\layout Standard
+
+Housekeeping process will delete all records from table
+\series bold
+alerts
+\series default
+ older than value defined in Zabbix configuration.
+
+\layout Standard
+
+
+\latex no_latex
+\SpecialChar ~
+
\layout Standard
@@ -5976,6 +6067,213 @@ Database structure
The section describes structure of tables of Zabbix database.
\layout Description
+CONFIG The table contains global configuration parameters.
+\layout Description
+
+
+\begin_inset Tabular
+<lyxtabular version="2" rows="7" 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="false" width="" special="">
+<column alignment="center" valignment="top" leftline="true" rightline="true" width="" 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
+
+\layout Standard
+
+Column name
+\end_inset
+</cell>
+<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
+
+Type
+\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
+
+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="false" rotate="false" usebox="none" width="" special="">
+\begin_inset Text
+
+\layout Standard
+
+varchar
+\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
+
+Name of SMTP 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
+
+smtp_helo
+\end_inset
+</cell>
+<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
+
+varchar
+\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
+
+HELO string used for SMTP 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
+
+smtp_email
+\end_inset
+</cell>
+<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
+
+varchar
+\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
+
+Email address used by Zabbix
+\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
+
+password_required
+\end_inset
+</cell>
+<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
+
+int
+\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
+
+Is password required for non-admin menu items
+\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
+
+alarm_history
+\end_inset
+</cell>
+<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
+
+int
+\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
+
+Zabbix will not store records in table
+\series bold
+ alarms
+\series default
+ older than this value
+\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
+
+\layout Standard
+
+alert_history
+\end_inset
+</cell>
+<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
+
+int
+\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
+
+Zabbix will not store records in table
+\series bold
+alerts
+\series default
+ older than this value
+\end_inset
+</cell>
+</row>
+</lyxtabular>
+
+\end_inset
+
+
+\layout Description
+
GRAPHS_ITEMS The table contains list of monitored items belonging to graph.
\layout Description
diff --git a/frontends/php/config.html b/frontends/php/config.html
index 3d2f0756..e18cde9a 100644
--- a/frontends/php/config.html
+++ b/frontends/php/config.html
@@ -17,7 +17,7 @@
{
$password_required="0";
}
- $result=update_config($smtp_server,$smtp_helo,$smtp_email,$password_required);
+ $result=update_config($smtp_server,$smtp_helo,$smtp_email,$password_required,$alarm_history,$alert_history);
show_messages($result, "Configuration updated", "Configuation was NOT updated");
}
?>
@@ -28,11 +28,7 @@
?>
<?
- $result=DBselect("select smtp_server,smtp_helo,smtp_email,password_required from config");
- $smtp_server=DBget_field($result,0,0);
- $smtp_helo=DBget_field($result,0,1);
- $smtp_email=DBget_field($result,0,2);
- $password_required=DBget_field($result,0,3);
+ $config=select_config();
?>
<?
@@ -43,25 +39,35 @@
echo "<form method=\"post\" action=\"config.html\">";
echo "SMTP server";
show_table2_h_delimiter();
- echo "<input name=\"smtp_server\" value=\"$smtp_server\"size=40>";
+ echo "<input name=\"smtp_server\" value=\"".$config["smtp_server"]."\"size=40>";
show_table2_v_delimiter();
echo "Value from SMTP HELO authentification";
show_table2_h_delimiter();
- echo "<input name=\"smtp_helo\" value=\"$smtp_helo\"size=40>";
+ echo "<input name=\"smtp_helo\" value=\"".$config["smtp_helo"]."\"size=40>";
show_table2_v_delimiter();
echo "ZABBIX email address to send alarms from";
show_table2_h_delimiter();
- echo "<input name=\"smtp_email\" value=\"$smtp_email\"size=40>";
+ echo "<input name=\"smtp_email\" value=\"".$config["smtp_email"]."\"size=40>";
show_table2_v_delimiter();
echo "Password required ?";
show_table2_h_delimiter();
echo "<input type=\"checkbox\" ";
- if($password_required==1) { echo "checked "; }
+ if($config["password_required"]==1) { echo "checked "; }
echo "name=\"password_required\" VALUE=\"true\">";
+ show_table2_v_delimiter();
+ echo "Do not keep alerts older than (in sec)";
+ show_table2_h_delimiter();
+ echo "<input name=\"alert_history\" value=\"".$config["alert_history"]."\"size=8>";
+
+ show_table2_v_delimiter();
+ echo "Do not keep alarms older than (in sec)";
+ show_table2_h_delimiter();
+ echo "<input name=\"alarm_history\" value=\"".$config["alarm_history"]."\"size=8>";
+
show_table2_v_delimiter2();
echo "<input type=\"submit\" name=\"register\" value=\"update\">";
diff --git a/frontends/php/history.html b/frontends/php/history.html
index 44f87333..cba219b5 100644
--- a/frontends/php/history.html
+++ b/frontends/php/history.html
@@ -46,7 +46,7 @@
<?
show_table_header_begin();
- echo "<A HREF='latest.html?hostid=$hostid'>$host</A> : $description";
+ echo "<A HREF='latest.html?hostid=$hostid'>$host</A> : <a href='trends.html?itemid=$itemid'>$description</a>";
show_table_v_delimiter();
echo("<DIV ALIGN=CENTER>");
if($action =="showhistory")
diff --git a/frontends/php/include/config.inc b/frontends/php/include/config.inc
index 2ee62b0f..5780bd3b 100644
--- a/frontends/php/include/config.inc
+++ b/frontends/php/include/config.inc
@@ -28,6 +28,29 @@
return $trigger;
}
+ function select_config()
+ {
+ global $ERROR_MSG;
+
+ $sql="select smtp_server,smtp_helo,smtp_email,password_required,alarm_history,alert_history from config";
+ $result=DBselect($sql);
+
+ if(DBnum_rows($result) == 1)
+ {
+ $config["smtp_server"]=DBget_field($result,0,0);
+ $config["smtp_helo"]=DBget_field($result,0,1);
+ $config["smtp_email"]=DBget_field($result,0,2);
+ $config["password_required"]=DBget_field($result,0,3);
+ $config["alarm_history"]=DBget_field($result,0,4);
+ $config["alert_history"]=DBget_field($result,0,5);
+ }
+ else
+ {
+ $ERROR_MSG="Unable to select configuration";
+ }
+ return $config;
+ }
+
function select_host_by_hostid($hostid)
{
global $ERROR_MSG;
@@ -1355,9 +1378,9 @@
# Update configuration
- function update_config($smtp_server,$smtp_helo,$smtp_email,$password_required)
+ function update_config($smtp_server,$smtp_helo,$smtp_email,$password_required,$alarm_history,$alert_history)
{
- $sql="update config set smtp_server='$smtp_server',smtp_helo='$smtp_helo',smtp_email='$smtp_email',password_required=$password_required";
+ $sql="update config set smtp_server='$smtp_server',smtp_helo='$smtp_helo',smtp_email='$smtp_email',password_required=$password_required,alarm_history=$alarm_history,alert_history=$alert_history";
return DBexecute($sql);
}
diff --git a/frontends/php/trends.html b/frontends/php/trends.html
index f53addc1..3c127332 100644
--- a/frontends/php/trends.html
+++ b/frontends/php/trends.html
@@ -7,8 +7,12 @@
<?
show_table_header_begin();
- $result=DBselect("select i.description,h.host from items i,hosts h where i.hostid=h.hostid and i.itemid=$itemid");
- echo "TRENDS [",DBget_field($result,0,1),":",DBget_field($result,0,0),"]";
+ $result=DBselect("select i.description,h.host,h.hostid from items i,hosts h where i.hostid=h.hostid and i.itemid=$itemid");
+ $description=DBget_field($result,0,0);
+ $host=DBget_field($result,0,1);
+ $hostid=DBget_field($result,0,2);
+
+ echo "<A HREF='latest.html?hostid=$hostid'>$host</A> : <a href='history.html?action=showhistory&itemid=$itemid'>$description</a>";
show_table_v_delimiter();
diff --git a/include/common.h b/include/common.h
index c3badf18..0b85252b 100644
--- a/include/common.h
+++ b/include/common.h
@@ -22,6 +22,12 @@
/* Housekeeping frequency */
#define SUCKER_HK 3600
+/* Keep alrt history (in sec) */
+#define ALERT_HISTORY 12*31*24*3600
+
+/* Keep alarm history (in sec) */
+#define ALARM_HISTORY 12*31*24*3600
+
#define SUCKER_TIMEOUT 5
#define AGENT_TIMEOUT 3
diff --git a/src/zabbix_sucker/zabbix_sucker.c b/src/zabbix_sucker/zabbix_sucker.c
index 58595286..423df632 100644
--- a/src/zabbix_sucker/zabbix_sucker.c
+++ b/src/zabbix_sucker/zabbix_sucker.c
@@ -283,7 +283,7 @@ int get_value_zabbix(double *result,DB_ITEM *item)
}
if( *result<0 )
{
- if( *result == NOTSUPPORTED)
+ if( cmp_double(*result,NOTSUPPORTED) == 0)
{
return SUCCEED;
}
@@ -454,7 +454,7 @@ int get_values(void)
return SUCCEED;
}
-int housekeeping_items()
+int housekeeping_items(int now)
{
char c[1024];
DB_ITEM item;
@@ -462,9 +462,6 @@ int housekeeping_items()
DB_RESULT *result;
int i,rows;
- int now;
-
- now = time(NULL);
sprintf(c,"select i.itemid,i.lastdelete,i.history from items i where i.lastdelete<=%d", now);
result = DBselect(c);
@@ -483,11 +480,9 @@ int housekeeping_items()
item.lastdelete=atoi(DBget_field(result,i,1));
item.history=atoi(DBget_field(result,i,2));
- now = time(NULL);
sprintf (c,"delete from history where ItemId=%d and Clock<%d",item.itemid,now-item.history);
DBexecute(c);
- now = time(NULL);
sprintf(c,"update items set LastDelete=%d where ItemId=%d",now,item.itemid);
DBexecute(c);
}
@@ -495,11 +490,53 @@ int housekeeping_items()
return SUCCEED;
}
+int housekeeping_alerts(int now)
+{
+ char c[1024];
+ int alert_history;
+ DB_RESULT *result;
+
+ sprintf(c,"select alert_history from config");
+ result = DBselect(c);
+
+ alert_history=atoi(DBget_field(result,0,0));
+
+ sprintf (c,"delete from alerts where clock<%d",now-alert_history);
+ DBexecute(c);
+
+ DBfree_result(result);
+ return SUCCEED;
+}
+
+int housekeeping_alarms(int now)
+{
+ char c[1024];
+ int alarm_history;
+ DB_RESULT *result;
+
+ sprintf(c,"select alarm_history from config");
+ result = DBselect(c);
+
+ alarm_history=atoi(DBget_field(result,0,0));
+
+ sprintf (c,"delete from alarms where clock<%d",now-alarm_history);
+ DBexecute(c);
+
+ DBfree_result(result);
+ return SUCCEED;
+}
+
int main_housekeeping_loop()
{
+ int now;
+
+ now = time(NULL);
+
for(;;)
{
- housekeeping_items();
+ housekeeping_items(now);
+ housekeeping_alarms(now);
+ housekeeping_alerts(now);
syslog( LOG_DEBUG, "Sleeping for %d seconds", SUCKER_HK);
sleep(SUCKER_HK);
}
diff --git a/src/zabbix_trapper/zabbix_trapperd.c b/src/zabbix_trapper/zabbix_trapperd.c
index d4036767..acbdcfcd 100644
--- a/src/zabbix_trapper/zabbix_trapperd.c
+++ b/src/zabbix_trapper/zabbix_trapperd.c
@@ -132,7 +132,7 @@ void process_child(int sockfd)
{
if(errno == EINTR)
{
- syslog( LOG_DEBUG, "Timeout while waiting for parameter");
+ syslog( LOG_WARNING, "Timeout while waiting for parameter");
}
else
{
diff --git a/upgrades/dbpatches/1.0alpha11_to_1.0alpha12/mysql/patch.sql b/upgrades/dbpatches/1.0alpha11_to_1.0alpha12/mysql/patch.sql
new file mode 100644
index 00000000..28e835bd
--- /dev/null
+++ b/upgrades/dbpatches/1.0alpha11_to_1.0alpha12/mysql/patch.sql
@@ -0,0 +1,3 @@
+alter table alarms add key (clock);
+alter table config add alert_history int(4) DEFAULT '0' NOT NULL;
+alter table config add alarm_history int(4) DEFAULT '0' NOT NULL;
diff --git a/upgrades/dbpatches/1.0alpha11_to_1.0alpha12/postgresql/patch.sql b/upgrades/dbpatches/1.0alpha11_to_1.0alpha12/postgresql/patch.sql
new file mode 100644
index 00000000..1056a5c5
--- /dev/null
+++ b/upgrades/dbpatches/1.0alpha11_to_1.0alpha12/postgresql/patch.sql
@@ -0,0 +1,3 @@
+CREATE INDEX alarms_clock on alarms (clock);
+alter table config add alert_history int4 DEFAULT '0' NOT NULL;
+alter table config add alert_history int4 DEFAULT '0' NOT NULL;