I would like to know if you have any tips on how to configure Cisco routers to monitor them with PRTG.
This article applies to PRTG Network Monitor 19 or later
Configuration tips for Cisco routers and PRTG
This article includes several tips and tricks for your Cisco router configuration when using PRTG with SNMP or NetFlow.
The following command makes sure that the router does not change the numbering of the interfaces when interfaces are added or removed so you do not have to edit your PRTG sensor setup:
snmp-server ifindex persist
Setting up NetFlow version 5, version 9, or IPFIX on Cisco routers for PRTG
Using the NetFlow protocol, you can monitor the bandwidth usage of all packets going through a router. For each flow of data, the router sends a NetFlow packet with connection and bandwidth information to a monitoring system that is running PRTG. In PRTG, you must create a collector that accepts these packets and does the accounting.
The advantage of using NetFlow is that it only requires little CPU load on the router itself (for example, 10,000 active flows create about 7% additional CPU load, and 45,000 active flows account for about 20% additional CPU load) and also on the machine that is running PRTG. This is much less than a Packet Sniffer sensor requires.
You must edit your router's setup and save it as the new startup configuration:
- Log in to the router.
- Run the command enable that gives you admin access.
- Run the command configure.
Enabling NetFlow for each interface
The following command must be repeated for each single interface to enable NetFlow for each one (replace FastEthernet 0/1 with the names of the interfaces on your router):
interface FastEthernet 0/1 ip route-cache flow exit
Setting NetFlow options
See the code section below. You may want to copy the script, edit it with your IPs, and paste it into your router telnet session. When you are done and have tested the new configuration, remember to copy the new configuration to the startup configuration.
copy running-config startup-config
This command will tell the router not to send any NetFlow packets to the specified address:
no ip flow-export destination (address) (port)
To disable NetFlow for a specific interface, use these commands:
interface (interface) (interface number) no ip route-cache flow Exit
Sample NetFlow code
! ! Step 1: enabling NetFlow ! ! Note: For PRTG we need NetFlow versions 5 or 9 or IPFIX, ! no other NetFlow version is supported currently ! ip flow-export version 5 ! or ! ip flow-export version 9 ! ! Note: We recommend these values for the timeouts: ! ! timeout active value is in minutes ip flow-cache timeout active 5 ! ! timeout inactive value is in seconds ip flow-cache timeout inactive 10 ! ! Step 2: setting the target address for NetFlow packets: ! ! Replace 10.0.0.200 with the IP address of your machine running PRTG ! Replace 9991 with another port number of your choice if desired ! ip flow-export destination 10.0.0.200 9991 ! ! Step 3: you can optionally send all NetFlow packets to one other machine, too ! ip flow-export destination 10.0.0.201 9991 ! ! Step 4: create a "NetFlow Sensor" in PRTG (V7 or later) and enter the port number set above ! ! That's it
- For more information on the performance and CPU load situation when enabling NetFlow on various Cisco hardware, see the Cisco white paper NetFlow Performance Analysis.
- For more information on configuring NetFlow, see the Cisco website: Configuring NetFlow and NetFlow Data Export Format
In case you need to send netflows over ipsec tunnels to the collecting probe, you might need to configure Flexible Netflows. This is described pretty well here:
If you have the condition that you see the flows get generated on the cisco device but do not reach the pingable probe machine (check by wireshark) via an ipsec tunnel, try this.
Also check the netflow version of the Cisco device. Some older firmwares seem to uses v9 by default while newer versions seem to use v5.
I created a device template for Cisco Routers and, with the exception of one of the items below, all of the following items are preconfigured. I have been able to use this on all IOS devices, irrespective of their model number, which was really nice. The device template was created on Version 18.104.22.16814 as 22.214.171.12410 lacked some functionality for creating device templates. This has worked very well with auto discover using a device template.
Ping Sensor: Send multiple ping requests, ping count = 10 Channel: Packet Loss, Enable Limits, Warning Upper = 20 (%) All Interface Sensors: Additional channels, Errors In & Out = True; Connection state handling = Show alarnm when disconnected Channel: Total Traffic, Show in charts = disabled, Show in tables = disabled Channel: Errors In, Enable Limits, Warning Upper = 0.1 Channel: Errors Out, Enable Limits, Warning Upper = 0.1 Uptime Sensor: Channel: System Uptime, Enable Limits, Warning Lower = 86400 (1 day) System Health CPU: Channel: CPU 1, Enable Limits, Warning Upper = 90
EDIT: I forgot to mention that I manually edited the device template file for a couple of tweaks. Nothing that was rocket science, albeit those files get slightly scary when you really start digging throuhg them.
The solution mentioned from maengling saved my day.
Here is the code I used
flow exporter FlowExporter1
destination <PRTG Server IP>
transport udp 9991
flow monitor FlowMonitor1
record netflow ipv4 original-input
cache timeout active 5
ip flow monitor FlowMonitor1 input
ip flow monitor FlowMonitor1 input
Have a look here and see if it helps: https://www.nazaudy.com/index.php/12-technology/cisco/34-enable-netflow-v9-in-cisco-switches-with-prtg