Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int main ( int argc, char **argv )
- {
- PGconn *psql;
- PGresult *res;
- int flag = 0;
- openlog ( "postgres", LOG_NDELAY, LOG_SYSLOG );
- psql = PQconnectdb("hostaddr = '127.0.0.0' port = '5432' dbname = 'RtpDb' user = 'rtp_user_99' password = 'rtp_user' connect_timeout = '10'");
- if ( PQstatus(psql) != CONNECTION_OK )
- {
- //Send an event to syslog for DB Connection Failure
- syslog (LOG_EMERG, "%s", PQerrorMessage(psql) )
- }
- closelog ();
- PQclear(res);
- PQfinish(psql);
- }
- Broadcast message from systemd-journald@blr09 (Tue 2017-01-03 05:24:46 EST):
- postgres[40933]: could not connect to server: Network is unreachable
- Is the server running on host "127.0.0.0" and accepting
- TCP/IP connections on port 5432?
- Message from syslogd@blr09 at Jan 3 05:24:46 ...
- postgres:could not connect to server: Network is unreachable#012#011Is the server running on host "127.0.0.0" and accepting#012#011TCP/IP connections on port 5432?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement