diff options
author | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2002-03-22 19:05:33 +0000 |
---|---|---|
committer | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2002-03-22 19:05:33 +0000 |
commit | 2df01e808f9caf6847dbab29214135b532ea82b0 (patch) | |
tree | dd2a3594327708c5d37d311eb262ff5af01fedb4 /include/db.c | |
parent | 5c6297d5fc9e9ee39c32bab2a7e12dc08e907d62 (diff) | |
download | zabbix-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/db.c')
-rw-r--r-- | include/db.c | 7 |
1 files changed, 6 insertions, 1 deletions
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 ); } |