Hello all, I'm trying to write a script for SNMP consumption to count the concurrent connections in connection tracking in the Mikrotik router using the following lines
/ip firewall connection print count-only where protocol=icmp # counts ICMP connections
/ip firewall connection print count-only where protocol=tcp # counts ICMP connections
/ip firewall connection print count-only where protocol=udp # counts ICMP connections
/ip firewall connection print count-only where protocol!=icmp && protocol!=udp && protocol!=tcp # counts other connection types
However, this script significantly increases the execution time by upto 20 seconds on my Hex, especially when the concurrent connections are around 7,000+ and CPU usage increases significantly as well compared to just simply counting all connections using the code below
/ip firewall connection print count-only # counts all types of connection
Is there any work around this? I didn't expect the performance hit to be that much signifant, the requirement is I have to count the ICMP, TCP and UDP connections and have it available in SNMP, perhaps there is another OID to access with less significant performance hit?