summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorhugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2002-03-22 19:05:33 +0000
committerhugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2002-03-22 19:05:33 +0000
commit2df01e808f9caf6847dbab29214135b532ea82b0 (patch)
treedd2a3594327708c5d37d311eb262ff5af01fedb4 /include
parent5c6297d5fc9e9ee39c32bab2a7e12dc08e907d62 (diff)
downloadzabbix-2df01e808f9caf6847dbab29214135b532ea82b0.tar.gz
zabbix-2df01e808f9caf6847dbab29214135b532ea82b0.tar.xz
zabbix-2df01e808f9caf6847dbab29214135b532ea82b0.zip
- parameter Server can consist of list of Zabbix servers (Alexei)
- SO_LINGER is default socket option for zabbix_sender (Alexei) - added support of NoTimeWait for zabbix_trapperd (Alexei) - fixed schema for PostgreSQL, column disable_until (Alexei) git-svn-id: svn://svn.zabbix.com/trunk@340 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'include')
-rw-r--r--include/common.h2
-rw-r--r--include/db.c7
2 files changed, 8 insertions, 1 deletions
diff --git a/include/common.h b/include/common.h
index ee09d99b..fd057420 100644
--- a/include/common.h
+++ b/include/common.h
@@ -1,6 +1,8 @@
#ifndef ZABBIX_COMMON_H
#define ZABBIX_COMMON_H
+#define PERF
+
#define SUCCEED 0
#define FAIL (-1)
#define NOTSUPPORTED (-2)
diff --git a/include/db.c b/include/db.c
index 193e0f9a..65e6281e 100644
--- a/include/db.c
+++ b/include/db.c
@@ -36,7 +36,8 @@ void DBconnect( char *dbname, char *dbuser, char *dbpassword, char *dbsocket)
#endif
#ifdef HAVE_PGSQL
/* conn = PQsetdb(pghost, pgport, pgoptions, pgtty, dbName); */
- conn = PQsetdb(NULL, NULL, NULL, NULL, dbname);
+/* conn = PQsetdb(NULL, NULL, NULL, NULL, dbname);*/
+ conn = PQsetdbLogin(NULL, NULL, NULL, NULL, dbname, dbuser, dbpassword );
/* check to see that the backend connection was successfully made */
if (PQstatus(conn) == CONNECTION_BAD)
@@ -75,12 +76,14 @@ int DBexecute(char *query)
if( result==NULL)
{
+ zabbix_log( LOG_LEVEL_ERR, "Query::%s",query);
zabbix_log(LOG_LEVEL_ERR, "Query failed:%s", "Result is NULL" );
PQclear(result);
return FAIL;
}
if( PQresultStatus(result) != PGRES_COMMAND_OK)
{
+ zabbix_log( LOG_LEVEL_ERR, "Query::%s",query);
zabbix_log(LOG_LEVEL_ERR, "Query failed:%s", PQresStatus(PQresultStatus(result)) );
PQclear(result);
return FAIL;
@@ -116,11 +119,13 @@ DB_RESULT *DBselect(char *query)
if( result==NULL)
{
+ zabbix_log( LOG_LEVEL_ERR, "Query::%s",query);
zabbix_log(LOG_LEVEL_ERR, "Query failed:%s", "Result is NULL" );
exit( FAIL );
}
if( PQresultStatus(result) != PGRES_TUPLES_OK)
{
+ zabbix_log( LOG_LEVEL_ERR, "Query::%s",query);
zabbix_log(LOG_LEVEL_ERR, "Query failed:%s", PQresStatus(PQresultStatus(result)) );
exit( FAIL );
}