I'd like to do the same thing - monitor and trend the number of NAT translations on my edge router. I can "show ip nat translatiions" and it gives me a total. I've opened a case with Cisco TAC, to ask them what the MIB is. I'll post here if I hear anything. I have a ISR Gen2 4451 router.
1 of 1 people found this helpful
TAC said it's in development, but not supported at the moment.
In the meantime, I found a script to run cli commands, export it to a MIB which NPM should be able to read and chart:
It seems to be working on my ISR 4451 with code:
Cisco IOS XE Software, Version 03.16.02.S - Extended Support Release
Cisco IOS Software, ISR Software (X86_64_LINUX_IOSD-UNIVERSALK9-M), Version 15.5(3)S2, RELEASE SOFTWARE (fc2)
I'm going to copy and paste, in case this page disappears:
And there are at least two methods for a manipulating expression-MIB
1) With EEM Tcl script (The right way)
I.e this Tcl script: Cli Value 2 Snmp Expr MIB
2) With EEM CLI applet (Simple, but potentially can conflict with other EEM applets).
Below lab config (Use at your own risk!):
1. Create expression owner
snmp mib expression owner nat name 1
description Total active translations
value type integer32
2. EEM applet
Every 10 minutes the applet sets the total number of translations to expression MIB.
The SNMP OID for pullig 126.96.36.199.188.8.131.52.184.108.40.206.220.127.116.11.1.49
How to calculate OID: Custom MIB (page10)
no event manager applet test
event manager applet test
event timer watchdog time 600 maxrun 60
action 010 cli command "enable"
action 030 cli command "configure terminal"
action 040 cli command "do-exec show ip nat translations total"
action 090 regexp "^.+\s([0-9]+)" "$_cli_result" match total_translations
action 100 cli command "snmp mib expression owner nat name 1"
action 110 if $_regexp_result eq "1"
action 120 cli command "expression $total_translations"
action 130 else
action 140 cli command "expression 0"
action 150 cli command "exit"
action 160 end