Route count

Grant Taylor <[email protected]> Mon, 08 Feb 2021 17:10:05 +0000
Newsgroups org.kernel.vger.lartc
Message-ID <[email protected]>
Hi,

Does anyone know a more efficient way to get a count of the number of 
routes than to do something like the following?

    # ip route show table $TABLE | wc -l

I'm doing something where I'd like to instrument the number of 
(unreachable / null) routes once a minute and I'd like to avoid 
unnecessary load on the system.

It seems to me like there should be a counter somewhere that I can just 
read instead of needing to enumerate every single route in the table.



-- 
Grant. . . .
unix || die
smime.p7s (application/pkcs7-signature, 3.9 KB) - not displayed