summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorosmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2007-01-08 16:13:49 +0000
committerosmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2007-01-08 16:13:49 +0000
commitea6bdbcf952e5ac4696cb91364c1923f6ab96321 (patch)
tree06184b10a3e0231b7c18d9cf6a66f2a3a6f97f8c /src
parent8f08a8271468cf8285f000ac4c0b25e12f1d596b (diff)
downloadzabbix-ea6bdbcf952e5ac4696cb91364c1923f6ab96321.tar.gz
zabbix-ea6bdbcf952e5ac4696cb91364c1923f6ab96321.tar.xz
zabbix-ea6bdbcf952e5ac4696cb91364c1923f6ab96321.zip
- improved databases determination of configuration script (Eugene)
git-svn-id: svn://svn.zabbix.com/trunk@3664 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'src')
-rw-r--r--src/libs/zbxdbhigh/Makefile.am2
-rw-r--r--src/libs/zbxdbhigh/db.c30
-rw-r--r--src/zabbix_server/Makefile.am8
-rw-r--r--src/zabbix_server/alerter/Makefile.am2
-rw-r--r--src/zabbix_server/housekeeper/Makefile.am2
-rw-r--r--src/zabbix_server/housekeeper/housekeeper.c2
-rw-r--r--src/zabbix_server/httppoller/Makefile.am2
-rw-r--r--src/zabbix_server/httppoller/httptest.c6
-rw-r--r--src/zabbix_server/nodewatcher/Makefile.am2
-rw-r--r--src/zabbix_server/pinger/Makefile.am2
-rw-r--r--src/zabbix_server/poller/Makefile.am2
-rw-r--r--src/zabbix_server/timer/Makefile.am2
-rw-r--r--src/zabbix_server/timer/timer.c2
-rw-r--r--src/zabbix_server/trapper/Makefile.am2
-rw-r--r--src/zabbix_server/utils/Makefile.am2
15 files changed, 37 insertions, 31 deletions
diff --git a/src/libs/zbxdbhigh/Makefile.am b/src/libs/zbxdbhigh/Makefile.am
index 78c15843..f6d3f9e2 100644
--- a/src/libs/zbxdbhigh/Makefile.am
+++ b/src/libs/zbxdbhigh/Makefile.am
@@ -1,5 +1,5 @@
SUBDIRS=
-INCLUDES=-I@top_srcdir@/include @MYSQL_INCLUDE@ @PGSQL_INCLUDE@ @ORACLE_INCLUDE@
+INCLUDES=-I@top_srcdir@/include @MYSQL_CFLAGS@ @POSTGRESQL_CFLAGS@ @ORACLE_INCLUDE@
libzbxdbhigh_a_SOURCES=action.c graph.c item.c trigger.c host.c db.c
lib_LIBRARIES=libzbxdbhigh.a
#libzbxdbhigh_a_LIBADD = ../zbxcommon/libzbxcommon.a
diff --git a/src/libs/zbxdbhigh/db.c b/src/libs/zbxdbhigh/db.c
index 8bea76c7..3924fa61 100644
--- a/src/libs/zbxdbhigh/db.c
+++ b/src/libs/zbxdbhigh/db.c
@@ -43,7 +43,7 @@
MYSQL mysql;
#endif
-#ifdef HAVE_PGSQL
+#ifdef HAVE_POSTGRESQL
PGconn *conn;
#endif
@@ -61,7 +61,7 @@ void DBclose(void)
#ifdef HAVE_MYSQL
mysql_close(&mysql);
#endif
-#ifdef HAVE_PGSQL
+#ifdef HAVE_POSTGRESQL
PQfinish(conn);
#endif
#ifdef HAVE_ORACLE
@@ -108,7 +108,7 @@ void DBconnect(void)
exit(FAIL);
}
#endif
-#ifdef HAVE_PGSQL
+#ifdef HAVE_POSTGRESQL
/* conn = PQsetdb(pghost, pgport, pgoptions, pgtty, dbName); */
/* conn = PQsetdb(NULL, NULL, NULL, NULL, CONFIG_DBNAME);*/
conn = PQsetdbLogin(CONFIG_DBHOST, NULL, NULL, NULL, CONFIG_DBNAME, CONFIG_DBUSER, CONFIG_DBPASSWORD );
@@ -287,7 +287,7 @@ int DBexecute(const char *fmt, ...)
char sql[ZBX_MAX_SQL_LEN];
va_list args;
-#ifdef HAVE_PGSQL
+#ifdef HAVE_POSTGRESQL
PGresult *result;
#endif
#ifdef HAVE_ORACLE
@@ -315,7 +315,7 @@ int DBexecute(const char *fmt, ...)
}
return (long)mysql_affected_rows(&mysql);
#endif
-#ifdef HAVE_PGSQL
+#ifdef HAVE_POSTGRESQL
result = PQexec(conn,sql);
if( result==NULL)
@@ -389,7 +389,7 @@ int DBis_null(char *field)
return ret;
}
-#ifdef HAVE_PGSQL
+#ifdef HAVE_POSTGRESQL
/* in db.h - #define DBfree_result PG_DBfree_result */
void PG_DBfree_result(DB_RESULT result)
{
@@ -427,7 +427,7 @@ DB_ROW DBfetch(DB_RESULT result)
#ifdef HAVE_MYSQL
return mysql_fetch_row(result);
#endif
-#ifdef HAVE_PGSQL
+#ifdef HAVE_POSTGRESQL
int i;
@@ -505,7 +505,7 @@ DB_RESULT DBselect(const char *fmt, ...)
char sql[ZBX_MAX_SQL_LEN];
va_list args;
-#if defined(HAVE_PGSQL) || defined(HAVE_SQLITE3)
+#if defined(HAVE_POSTGRESQL) || defined(HAVE_SQLITE3)
DB_RESULT result;
#endif
#ifdef HAVE_ORACLE
@@ -534,7 +534,7 @@ DB_RESULT DBselect(const char *fmt, ...)
}
return mysql_store_result(&mysql);
#endif
-#ifdef HAVE_PGSQL
+#ifdef HAVE_POSTGRESQL
result = malloc(sizeof(ZBX_PG_DB_RESULT));
result->pg_result = PQexec(conn,sql);
result->values = NULL;
@@ -610,7 +610,7 @@ DB_RESULT DBselectN(char *query, int n)
#ifdef HAVE_MYSQL
return DBselect("%s limit %d", query, n);
#endif
-#ifdef HAVE_PGSQL
+#ifdef HAVE_POSTGRESQL
return DBselect("%s limit %d", query, n);
#endif
#ifdef HAVE_ORACLE
@@ -640,7 +640,7 @@ char *DBget_field(DB_RESULT result, int rownum, int fieldnum)
}
return row[fieldnum];
#endif
-#ifdef HAVE_PGSQL
+#ifdef HAVE_POSTGRESQL
return PQgetvalue(result, rownum, fieldnum);
#endif
#ifdef HAVE_ORACLE
@@ -662,7 +662,7 @@ zbx_uint64_t DBinsert_id(int exec_result, const char *table, const char *field)
return mysql_insert_id(&mysql);
#endif
-#ifdef HAVE_PGSQL
+#ifdef HAVE_POSTGRESQL
DB_RESULT tmp_res;
zbx_uint64_t id_res = FAIL;
@@ -718,7 +718,7 @@ long DBaffected_rows()
#ifdef HAVE_MYSQL
return (long)mysql_affected_rows(&mysql);
#endif
-#ifdef HAVE_PGSQL
+#ifdef HAVE_POSTGRESQL
NOT IMPLEMENTED YET
#endif
#ifdef HAVE_ORACLE
@@ -781,7 +781,7 @@ int DBnum_rows(DB_RESULT result)
zabbix_log(LOG_LEVEL_DEBUG, "Result of DBnum_rows [%d]", rows);
return rows;
#endif
-#ifdef HAVE_PGSQL
+#ifdef HAVE_POSTGRESQL
zabbix_log(LOG_LEVEL_DEBUG, "In DBnum_rows");
return PQntuples(result);
#endif
@@ -1898,7 +1898,7 @@ int DBadd_alert(zbx_uint64_t actionid, zbx_uint64_t userid, zbx_uint64_t trigger
void DBvacuum(void)
{
-#ifdef HAVE_PGSQL
+#ifdef HAVE_POSTGRESQL
char *table_for_housekeeping[]={"services", "services_links", "graphs_items", "graphs", "sysmaps_links",
"sysmaps_elements", "sysmaps", "config", "groups", "hosts_groups", "alerts",
"actions", "events", "functions", "history", "history_str", "hosts", "trends",
diff --git a/src/zabbix_server/Makefile.am b/src/zabbix_server/Makefile.am
index c2583ee7..3c9fbcca 100644
--- a/src/zabbix_server/Makefile.am
+++ b/src/zabbix_server/Makefile.am
@@ -1,14 +1,14 @@
SUBDIRS = alerter housekeeper pinger poller httppoller timer trapper nodewatcher utils
-INCLUDES=-I@top_srcdir@/include @MYSQL_INCLUDE@ @ORACLE_INCLUDE@ @SNMP_INCLUDE@ @PGSQL_INCLUDE@ @SQLITE3_INCLUDE@ @LIBCURL_CPPFLAGS@
+INCLUDES=-I@top_srcdir@/include @ORACLE_INCLUDE@ @SNMP_INCLUDE@
bin_PROGRAMS = zabbix_server
zabbix_server_SOURCES = evalfunc.c expression.c actions.c events.c zlog.c functions.c server.c
-zabbix_server_CPPFLAGS = -DZABBIX_DAEMON
+zabbix_server_CPPFLAGS = -DZABBIX_DAEMON @MYSQL_CFLAGS@ @POSTGRESQL_CFLAGS@ @SQLITE3_CFLAGS@ @LIBCURL_CPPFLAGS@
zabbix_server_LDADD = ../libs/zbxsysinfo/libzbxsysinfo.a ../libs/zbxsysinfo/@ARCH@/libzbxsysinfo2.a \
../libs/zbxlog/libzbxlog.a ../libs/zbxnix/libzbxnix.a ../libs/zbxsys/libzbxsys.a ../libs/zbxconf/libzbxconf.a \
../libs/zbxnet/libzbxnet.a pinger/libzbxpinger.a poller/libzbxpoller.a housekeeper/libzbxhousekeeper.a \
alerter/libzbxalerter.a timer/libzbxtimer.a trapper/libzbxtrapper.a nodewatcher/libzbxnodewatcher.a \
../libs/zbxemail/libzbxemail.a utils/libzbxutils.a httppoller/libzbxhttppoller.a \
../libs/zbxsms/libzbxsms.a ../libs/zbxdbhigh/libzbxdbhigh.a ../libs/zbxcommon/libzbxcommon.a \
-../libs/zbxcrypto/libzbxcrypto.a @MYSQL_LIBS@ @PGSQL_LIBS@ @ORACLE_LIBS@ @SQLITE3_LIBS@ @LDAP_LIBS@ @SNMP_LIBS@ @LIBCURL@
-zabbix_server_LDFLAGS=@MYSQL_LFLAGS@ @PGSQL_LFLAGS@ @ORACLE_LFLAGS@ @SQLITE3_LFLAGS@ @LDAP_LFLAGS@ @SNMP_LFLAGS@
+../libs/zbxcrypto/libzbxcrypto.a @ORACLE_LIBS@ @LDAP_LIBS@ @SNMP_LIBS@ @LIBCURL@
+zabbix_server_LDFLAGS=@MYSQL_LDFLAGS@ @POSTGRESQL_LDFLAGS@ @ORACLE_LFLAGS@ @SQLITE3_LDFLAGS@ @LDAP_LFLAGS@ @SNMP_LFLAGS@
diff --git a/src/zabbix_server/alerter/Makefile.am b/src/zabbix_server/alerter/Makefile.am
index 6a21dfd9..efc70d14 100644
--- a/src/zabbix_server/alerter/Makefile.am
+++ b/src/zabbix_server/alerter/Makefile.am
@@ -1,5 +1,5 @@
SUBDIRS=
-INCLUDES=-I@top_srcdir@/include @MYSQL_INCLUDE@ @ORACLE_INCLUDE@ @PGSQL_INCLUDE@
+INCLUDES=-I@top_srcdir@/include @MYSQL_CFLAGS@ @ORACLE_INCLUDE@ @POSTGRESQL_CFLAGS@
lib_LIBRARIES=libzbxalerter.a
libzbxalerter_a_SOURCES=alerter.c
libzbxalerter_a_LIBADD = ../../libs/zbxemail/libzbxemail.a
diff --git a/src/zabbix_server/housekeeper/Makefile.am b/src/zabbix_server/housekeeper/Makefile.am
index 94f5ea6e..59a8cf3a 100644
--- a/src/zabbix_server/housekeeper/Makefile.am
+++ b/src/zabbix_server/housekeeper/Makefile.am
@@ -1,4 +1,4 @@
SUBDIRS=
-INCLUDES=-I@top_srcdir@/include @MYSQL_INCLUDE@ @ORACLE_INCLUDE@ @PGSQL_INCLUDE@
+INCLUDES=-I@top_srcdir@/include @MYSQL_CFLAGS@ @ORACLE_INCLUDE@ @POSTGRESQL_CFLAGS@
lib_LIBRARIES=libzbxhousekeeper.a
libzbxhousekeeper_a_SOURCES=housekeeper.c
diff --git a/src/zabbix_server/housekeeper/housekeeper.c b/src/zabbix_server/housekeeper/housekeeper.c
index 42389718..01b686a6 100644
--- a/src/zabbix_server/housekeeper/housekeeper.c
+++ b/src/zabbix_server/housekeeper/housekeeper.c
@@ -90,7 +90,7 @@ static int housekeeping_process_log()
#ifdef HAVE_ORACLE
deleted = DBexecute("delete from %s where %s=" ZBX_FS_UI64 " and rownum<500",housekeeper.tablename, housekeeper.field,housekeeper.value);
-#elif defined(HAVE_PGSQL)
+#elif defined(HAVE_POSTGRESQL)
deleted = DBexecute("delete from %s where oid in (select oid from %s where %s=" ZBX_FS_UI64 " limit 500)",
housekeeper.tablename,
housekeeper.tablename,
diff --git a/src/zabbix_server/httppoller/Makefile.am b/src/zabbix_server/httppoller/Makefile.am
index 19d1a9bc..90ce0fd6 100644
--- a/src/zabbix_server/httppoller/Makefile.am
+++ b/src/zabbix_server/httppoller/Makefile.am
@@ -1,4 +1,4 @@
SUBDIRS=
-INCLUDES=-I@top_srcdir@/include @MYSQL_INCLUDE@ @ORACLE_INCLUDE@ @PGSQL_INCLUDE@ @SNMP_INCLUDE@
+INCLUDES=-I@top_srcdir@/include @MYSQL_CFLAGS@ @ORACLE_INCLUDE@ @POSTGRESQL_CFLAGS@ @SNMP_INCLUDE@
lib_LIBRARIES=libzbxhttppoller.a
libzbxhttppoller_a_SOURCES=httptest.c httppoller.c
diff --git a/src/zabbix_server/httppoller/httptest.c b/src/zabbix_server/httppoller/httptest.c
index dc98eef2..e01d2528 100644
--- a/src/zabbix_server/httppoller/httptest.c
+++ b/src/zabbix_server/httppoller/httptest.c
@@ -51,6 +51,7 @@ size_t HEADERFUNCTION( void *ptr, size_t size, size_t nmemb, void *stream)
void process_http_data()
{
+#ifdef HAVE_LIBCURL
DB_RESULT result;
DB_ROW row;
char server_esc[MAX_STRING_LEN];
@@ -77,6 +78,7 @@ void process_http_data()
DBfree_result(result);
DBfree_result(result);
+#endif /* HAVE_LIBCURL */
}
@@ -98,6 +100,7 @@ void process_http_data()
******************************************************************************/
int process_httptest(zbx_uint64_t httptestid)
{
+#ifdef HAVE_LIBCURL
DB_RESULT result;
DB_ROW row;
int ret = SUCCEED;
@@ -199,6 +202,7 @@ int process_httptest(zbx_uint64_t httptestid)
(void)curl_easy_cleanup(easyhandle);
return ret;
+#endif /* HAVE_LIBCURL */
}
/******************************************************************************
@@ -218,6 +222,7 @@ int process_httptest(zbx_uint64_t httptestid)
******************************************************************************/
void process_httptests(int now)
{
+#ifdef HAVE_LIBCURL
DB_RESULT result;
DB_ROW row;
@@ -234,4 +239,5 @@ void process_httptests(int now)
DBexecute("update httptest set nextcheck=%d+delay where httptestid=" ZBX_FS_UI64, now, httptestid);
}
DBfree_result(result);
+#endif /* HAVE_LIBCURL */
}
diff --git a/src/zabbix_server/nodewatcher/Makefile.am b/src/zabbix_server/nodewatcher/Makefile.am
index dd144c9c..2440379b 100644
--- a/src/zabbix_server/nodewatcher/Makefile.am
+++ b/src/zabbix_server/nodewatcher/Makefile.am
@@ -1,4 +1,4 @@
SUBDIRS=
-INCLUDES=-I@top_srcdir@/include @MYSQL_INCLUDE@ @ORACLE_INCLUDE@ @PGSQL_INCLUDE@
+INCLUDES=-I@top_srcdir@/include @MYSQL_CFLAGS@ @ORACLE_INCLUDE@ @POSTGRESQL_CFLAGS@
lib_LIBRARIES=libzbxnodewatcher.a
libzbxnodewatcher_a_SOURCES=nodewatcher.c nodesender.c nodecomms.c events.c history.c
diff --git a/src/zabbix_server/pinger/Makefile.am b/src/zabbix_server/pinger/Makefile.am
index 0983d715..fca06bd3 100644
--- a/src/zabbix_server/pinger/Makefile.am
+++ b/src/zabbix_server/pinger/Makefile.am
@@ -1,4 +1,4 @@
SUBDIRS=
-INCLUDES=-I@top_srcdir@/include @MYSQL_INCLUDE@ @ORACLE_INCLUDE@ @PGSQL_INCLUDE@ @SNMP_INCLUDE@
+INCLUDES=-I@top_srcdir@/include @MYSQL_CFLAGS@ @ORACLE_INCLUDE@ @POSTGRESQL_CFLAGS@ @SNMP_INCLUDE@
lib_LIBRARIES=libzbxpinger.a
libzbxpinger_a_SOURCES=pinger.c
diff --git a/src/zabbix_server/poller/Makefile.am b/src/zabbix_server/poller/Makefile.am
index dbdaa84c..669e9971 100644
--- a/src/zabbix_server/poller/Makefile.am
+++ b/src/zabbix_server/poller/Makefile.am
@@ -1,4 +1,4 @@
SUBDIRS=
-INCLUDES=-I@top_srcdir@/include @MYSQL_INCLUDE@ @ORACLE_INCLUDE@ @PGSQL_INCLUDE@ @SNMP_INCLUDE@
+INCLUDES=-I@top_srcdir@/include @MYSQL_CFLAGS@ @ORACLE_INCLUDE@ @POSTGRESQL_CFLAGS@ @SNMP_INCLUDE@
lib_LIBRARIES=libzbxpoller.a
libzbxpoller_a_SOURCES=checks_agent.c checks_internal.c checks_simple.c checks_snmp.c checks_aggregate.c poller.c
diff --git a/src/zabbix_server/timer/Makefile.am b/src/zabbix_server/timer/Makefile.am
index 1a9efcc2..338d5e3a 100644
--- a/src/zabbix_server/timer/Makefile.am
+++ b/src/zabbix_server/timer/Makefile.am
@@ -1,4 +1,4 @@
SUBDIRS=
-INCLUDES=-I@top_srcdir@/include @MYSQL_INCLUDE@ @ORACLE_INCLUDE@ @PGSQL_INCLUDE@
+INCLUDES=-I@top_srcdir@/include @MYSQL_CFLAGS@ @ORACLE_INCLUDE@ @POSTGRESQL_CFLAGS@
lib_LIBRARIES=libzbxtimer.a
libzbxtimer_a_SOURCES=timer.c
diff --git a/src/zabbix_server/timer/timer.c b/src/zabbix_server/timer/timer.c
index 6a08fbb6..a5ff96db 100644
--- a/src/zabbix_server/timer/timer.c
+++ b/src/zabbix_server/timer/timer.c
@@ -83,7 +83,7 @@ void main_timer_loop()
now=time(NULL);
/*
-#ifdef HAVE_PGSQL
+#ifdef HAVE_POSTGRESQL
zbx_snprintf(sql,sizeof(sql),"select distinct f.itemid,f.functionid,f.parameter from functions f, items i,hosts h where h.hostid=i.hostid and h.status=%d and i.itemid=f.itemid and f.function in ('nodata','date','dayofweek','time','now') and i.lastclock+f.parameter::text::integer<=%d and i.status=%d", HOST_STATUS_MONITORED, now, ITEM_STATUS_ACTIVE);
#else
zbx_snprintf(sql,sizeof(sql),"select distinct f.itemid,f.functionid,f.parameter,f.function from functions f, items i,hosts h where h.hostid=i.hostid and h.status=%d and i.itemid=f.itemid and f.function in ('nodata','date','dayofweek','time','now') and i.lastclock+f.parameter<=%d and i.status=%d", HOST_STATUS_MONITORED, now, ITEM_STATUS_ACTIVE);
diff --git a/src/zabbix_server/trapper/Makefile.am b/src/zabbix_server/trapper/Makefile.am
index 14ef010b..a4fee911 100644
--- a/src/zabbix_server/trapper/Makefile.am
+++ b/src/zabbix_server/trapper/Makefile.am
@@ -1,5 +1,5 @@
SUBDIRS=
-INCLUDES=-I@top_srcdir@/include @MYSQL_INCLUDE@ @ORACLE_INCLUDE@ @PGSQL_INCLUDE@
+INCLUDES=-I@top_srcdir@/include @MYSQL_CFLAGS@ @ORACLE_INCLUDE@ @POSTGRESQL_CFLAGS@
lib_LIBRARIES=libzbxtrapper.a
libzbxtrapper_a_SOURCES=active.c autoregister.h autoregister.c trapper.c nodesync.c nodeevents.c nodehistory.c
libzbxtrapper_a_LIBADD = ../../libs/zbxdbhigh/libzbxdbhigh.a
diff --git a/src/zabbix_server/utils/Makefile.am b/src/zabbix_server/utils/Makefile.am
index c0e8882c..472c6a85 100644
--- a/src/zabbix_server/utils/Makefile.am
+++ b/src/zabbix_server/utils/Makefile.am
@@ -1,4 +1,4 @@
SUBDIRS=
-INCLUDES=-I@top_srcdir@/include @MYSQL_INCLUDE@ @ORACLE_INCLUDE@ @PGSQL_INCLUDE@
+INCLUDES=-I@top_srcdir@/include @MYSQL_CFLAGS@ @ORACLE_INCLUDE@ @POSTGRESQL_CFLAGS@
lib_LIBRARIES=libzbxutils.a
libzbxutils_a_SOURCES=nodechange.c