Canaan's weblog

Notes

Saturday 23 March 2024 : Parsing SNMP traffic with Perl. The end goal being that I can move a pfSense firewall on to my RMM platform.

123#!/usr/bin/perl 
use v5.38; 
say "hello, world!";

...just warming up. alright so starting with a basic csv of SNMP traffic (this is some random data i generated.)

Timestamp,Source IP,Destination IP,Community,Request Type,OID,Response
2024-03-23 08:00:00,192.168.1.100,192.168.1.1,public,GET,1.3.6.1.2.1.1.1.0,"SNMPv2-MIB::sysDescr.0 = STRING: pfSense Firewall"
2024-03-23 08:01:00,192.168.1.101,192.168.1.1,public,GET,1.3.6.1.2.1.1.3.0,"SNMPv2-MIB::sysUpTime.0 = Timeticks: (123456789) 14 days, 6:56:07.89"
2024-03-23 08:02:00,192.168.1.102,192.168.1.1,public,GET,1.3.6.1.2.1.2.2.1.10.1,"IF-MIB::ifInOctets.1 = Counter32: 123456789"
2024-03-23 08:03:00,192.168.1.103,192.168.1.1,public,GET,1.3.6.1.2.1.2.2.1.16.1,"IF-MIB::ifOutOctets.1 = Counter32: 987654321"
2024-03-23 08:04:00,192.168.1.104,192.168.1.1,public,GET,1.3.6.1.2.1.2.2.1.2.1,"IF-MIB::ifDescr.1 = STRING: WAN Interface"
2024-03-23 08:05:00,192.168.1.105,192.168.1.1,public,GET,1.3.6.1.2.1.2.2.1.2.2,"IF-MIB::ifDescr.2 = STRING: LAN Interface"