Hi - I was trying to crate a script to show the last time iptables had seen a given IP address (contained in the ipt_recent kernel hook -- my user-defined table name is 'iplist'). The ipt_recent table yields the following information (IPv4 addresses masked for paranoid reasons):
The attempted command used was:Code:src=www.xxx.yyy.zzz ttl: 114 last_seen: 9355600126 oldest_pkt: 1 9355600126 src=www.xxx.yyy.zzz ttl: 109 last_seen: 10020040763 oldest_pkt: 1 10020040763 src=www.xxx.yyy.zzz ttl: 111 last_seen: 8106864077 oldest_pkt: 3 8103790647, 8106530788, 8106864077 src=www.xxx.yyy.zzz ttl: 109 last_seen: 9937861664 oldest_pkt: 1 9937861664 src=www.xxx.yyy.zzz ttl: 115 last_seen: 8244867102 oldest_pkt: 1 8244867102
Such command yields the following (I'm willing to live with the trailing zero):Code:cat /proc/net/ipt_recent/iplist | awk '{print ($1 ,system("date -d @" $5));}'
I presume the ipt_recent table uses the standard UNIX epoch timestamp. Am I using the date command syntax incorrectly, is this a 32-bit vs 64-bit break, or it is something else? Please note that I am using FC10, and I have double-checked my system clock settings (both BIOS and OS). The system has only been running during 2009 (no reboot yet).Code:Wed Jun 20 05:48:46 EDT 2266 src=www.xxx.yyy.zzz 0 Sun Jul 10 12:39:23 EDT 2287 src=www.xxx.yyy.zzz 0 Fri Nov 24 05:41:17 EST 2226 src=www.xxx.yyy.zzz 0 Mon Dec 1 08:07:44 EST 2284 src=www.xxx.yyy.zzz 0 Sat Apr 9 12:51:42 EDT 2231 src=www.xxx.yyy.zzz 0
Thanks!


Reply With Quote
