Advertisement
Guest User

Untitled

a guest
Jan 3rd, 2017
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. int main ( int argc, char **argv )
  2. {
  3. PGconn *psql;
  4. PGresult *res;
  5. int flag = 0;
  6.  
  7. openlog ( "postgres", LOG_NDELAY, LOG_SYSLOG );
  8.  
  9. psql = PQconnectdb("hostaddr = '127.0.0.0' port = '5432' dbname = 'RtpDb' user = 'rtp_user_99' password = 'rtp_user' connect_timeout = '10'");
  10. if ( PQstatus(psql) != CONNECTION_OK )
  11. {
  12. //Send an event to syslog for DB Connection Failure
  13. syslog (LOG_EMERG, "%s", PQerrorMessage(psql) )
  14. }
  15. closelog ();
  16. PQclear(res);
  17. PQfinish(psql);
  18. }
  19.  
  20. Broadcast message from systemd-journald@blr09 (Tue 2017-01-03 05:24:46 EST):
  21. postgres[40933]: could not connect to server: Network is unreachable
  22. Is the server running on host "127.0.0.0" and accepting
  23. TCP/IP connections on port 5432?
  24. Message from syslogd@blr09 at Jan 3 05:24:46 ...
  25. 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