diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2008-12-21 19:47:03 +0100 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2008-12-21 19:47:03 +0100 |
commit | 3641d2351ab42bef56e341ccca007331410822f2 (patch) | |
tree | 23ed80337fed1e57af1199da4a11238a32ffeab4 /include/conntrackd.h | |
parent | 036a0a65c6a3ba95cff48035a25e0bdba6aa0452 (diff) | |
download | conntrack-tools-3641d2351ab42bef56e341ccca007331410822f2.tar.gz conntrack-tools-3641d2351ab42bef56e341ccca007331410822f2.zip |
src: add run-time statistics via `-s runtime'
This patch adds run-time statistics that you can check via
`conntrackd -s runtime'. This information is useful for
trouble-shooting.
This patch replaces several log messages that can be triggered in
runtime. The idea behind this patch is to avoid log message flooding
under errors.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'include/conntrackd.h')
-rw-r--r-- | include/conntrackd.h | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/include/conntrackd.h b/include/conntrackd.h index 98934ce..df36ec4 100644 --- a/include/conntrackd.h +++ b/include/conntrackd.h @@ -28,6 +28,7 @@ #define DEBUG_INFO 27 /* show debug info (if any) */ #define STATS_NETWORK 28 /* extended network stats */ #define STATS_CACHE 29 /* extended cache stats */ +#define STATS_RUNTIME 30 /* extended runtime stats */ #define DEFAULT_CONFIGFILE "/etc/conntrackd/conntrackd.conf" #define DEFAULT_LOCKFILE "/var/lock/conntrackd.lock" @@ -111,8 +112,32 @@ struct ct_general_state { struct fds *fds; /* statistics */ - uint64_t bytes[NFCT_DIR_MAX]; - uint64_t packets[NFCT_DIR_MAX]; + struct { + uint64_t bytes[NFCT_DIR_MAX]; + uint64_t packets[NFCT_DIR_MAX]; + + time_t daemon_start_time; + + uint64_t nl_events_received; + uint64_t nl_events_filtered; + uint32_t nl_events_unknown_type; + uint32_t nl_catch_event_failed; + uint32_t nl_overrun; + uint32_t nl_dump_unknown_type; + uint32_t nl_kernel_table_flush; + uint32_t nl_kernel_table_resync; + + uint32_t child_process_failed; + uint32_t child_process_error_segfault; + uint32_t child_process_error_term; + + uint32_t select_failed; + uint32_t wait_failed; + + uint32_t local_read_failed; + uint32_t local_unknown_request; + + } stats; }; #define STATE_SYNC(x) state.sync->x |