Hello,
While debugging an issue with nfacctd (I am running nfacctd 1.5.0rc3) I
noticed that the pgsql debug messages are incomplete as they don't show
when a transaction fails. An example:

Jul 22 12:05:01 INFO ( flows/pgsql ): *** Purging cache - START (PID:
25911) ***
Jul 22 12:05:01 DEBUG ( flows/pgsql ): COPY acct_bgp (stamp_updated,
stamp_inserted, as_src, as_dst, as_path, peer_ip_src, peer_ip_dst,
packets, bytes) FROM STDIN DELIMITER ','
Jul 22 12:05:01 DEBUG ( flows/pgsql ): 2014-07-22 12:05:01,2014-07-22
12:00:00,0,0,,64.230.15.243,64.230.200.186,2282,3292100
Jul 22 12:05:01 DEBUG ( flows/pgsql ): 2014-07-22 12:05:01,2014-07-22
12:00:00,0,0,,64.230.15.243,64.230.193.172,3533,5096589
<snip>
Jul 22 12:05:01 DEBUG ( flows/pgsql ): 2014-07-22 12:05:01,2014-07-22
12:00:00,2906,5690,5690 5690 5690 5690 5690 5690 5690 5690 5690 5690
5690 5690 5690,64.230.15.243,64.230.194.232,1591,2045887
Jul 22 12:05:01 INFO ( flows/pgsql ): *** Purging cache - END (PID:
25911, QN: 874, ET: 0) ***

and from Postgres logs:

2014-07-22 12:05:01 EDT ERROR:  value too long for type character(50)
2014-07-22 12:05:01 EDT CONTEXT:  COPY acct_bgp, line 559, column
as_path: "5690 5690 5690 5690 5690 5690 5690 5690 5690 5690 5690 5690 5690"
2014-07-22 12:05:01 EDT STATEMENT:  COPY acct_bgp (stamp_updated,
stamp_inserted, as_src, as_dst, as_path, peer_ip_src, peer_ip_dst,
packets, bytes) FROM STDIN DELIMITER ','

I fixed the problem by altering the comms and as_path columns to
character_varying but it took me a while to think to check the Postgres
logs as the nfacctd logs for pgsql inserts look the same whether the
insert is successful or fails. Is there a configuration directive for
nfacctd that I am missing that would show these failures in the nfacctd
debug log?

Pat

_______________________________________________
pmacct-discussion mailing list
http://www.pmacct.net/#mailinglists

Reply via email to