Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How get named counter in pyroute2 #1160

Open
Rycroft-Philostrate opened this issue Jan 16, 2024 · 0 comments
Open

How get named counter in pyroute2 #1160

Rycroft-Philostrate opened this issue Jan 16, 2024 · 0 comments

Comments

@Rycroft-Philostrate
Copy link

There are named counters in the table:

table ip t_nat_100 { # handle 10
        counter counter_prerouting { # handle 3
                packets 272 bytes 17304
        }
        counter counter_postrouting { # handle 4
                packets 6746 bytes 325668

When using the "get_tables()" function in pyroute2, the output is:

{'nfgen_family': 2, 'version': 0, 'res_id': 8, 'attrs': [('NFTA_TABLE_NAME', 't_nat_100'), ('NFTA_TABLE_FLAGS', "), ('NFTA_TABLE_USE', 5), ('NFTA_TABLE_HANDLE', 10)], 'header': {'length': 64, 'type': 2560, 'flags': 2, 'sequence number': 255, 'pid': 98281, 'error': None, 'target': 'local host', 'statistics': Statistics(qsize=0, delta=0, delay=0)}}

How do I get the data of these counters using pyroute2?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant