How to discover SNMP OID information for Home Assistant
-
Is their any way to obtain or discover PfSense OID's for things like:
cpuLoad
users
processes
disk-size
disk-usageOr any others that are useful or worth monitoring and displaying in Home Assistant setup?
I've followed the Home Assistant notes and have entered some code like it suggested to add in to the /config/configuration.yaml file on my Home Assistant server. (code is below).
I did that and it appears to at the very least now detected or formed some form of communication between Home Assistant and Pfsense, which is cool:
The code below was what I entered.
# Example configuration.yaml entry for SNMP version 1 or 2c device_tracker: - platform: snmp host: 192.168.1.1 community: public baseoid: 1.3.6.1.2.1.4.22.1.2
So far all that basically pulls in though is my network device status, showing whether it detects my mac addresses online or offline status.
I'm now trying to work out how to pull in the other information like:
cpuLoad
users
processes
disk-size
disk-usageBut to do that I need to discover all the OID's used I guess. So my primary question is, is their any commands i can run in pfsense to obtain OID details or are their any websites i can visit to establish them?
-
@souk said in How to discover SNMP OID information for Home Assistant:
is their any commands i can run in pfsense to obtain OID details
You could just do a snmpwalk this would list out everything..
This might be helpful
https://www.youtube.com/watch?v=CKPbIeiJ2AQ
Monitoring pfSense 2.4 with SNMP -
@SOUK Home Assistant has an active Integration for pfSense via HACS.
https://github.com/travisghansen/hass-pfsenseIt gives CPU, Memory, Leases, Disk etc.
What it doesn't give is in/out on an interface. I get this via snmp:
in OiD
1.3.6.1.2.1.2.2.1.10.6 where .6 is the interface number
out OiD
1.3.6.1.2.1.2.2.1.16.6 where .6 is the interface numbersensor: # read the Bytes in/out on an interface in an interval - platform: snmp name: asa5512x1_wan6_in host: 10.10.10.1 community: dom baseoid: 1.3.6.1.2.1.2.2.1.10.6 accept_errors: true version: 2c scan_interval: 20 - platform: snmp name: asa5512x1_wan6_out host: 10.10.10.1 community: dom baseoid: 1.3.6.1.2.1.2.2.1.16.6 accept_errors: true version: 2c scan_interval: 20 # calculate the gradiant of the bandwith of the asa5512x - platform: derivative source: sensor.asa5512x1_wan6_in unit_time: s unit: B name: asa5512x1_wan6_in_der - platform: derivative source: sensor.asa5512x1_wan6_out unit_time: s unit: B name: asa5512x1_wan6_out_der # calculate MBps and MiB between intervals of the asa5512x - platform: template sensors: asa5512x1_wan6_in_mbps: value_template: "{{ (states('sensor.asa5512x1_wan6_in_der')|float*8/1000000)|round(2) }}" unit_of_measurement: 'Mbps' friendly_name: Internet in Mbps asa5512x1_wan6_out_mbps: value_template: "{{ (states('sensor.asa5512x1_wan6_out_der')|float*8/1000000)|round(2) }}" unit_of_measurement: 'Mbps' friendly_name: Internet out Mbps asa5512x1_wan6_in_mib: value_template: "{{ (states('sensor.asa5512x1_wan6_in')|float/1000000)|round(2) }}" unit_of_measurement: 'MiB' friendly_name: Internet in MiB asa5512x1_wan6_out_mib: value_template: "{{ (states('sensor.asa5512x1_wan6_out')|float/1000000)|round(2) }}" unit_of_measurement: 'MiB' friendly_name: Internet out MiB asa5512x1_wan6_in_gib: value_template: "{{ (states('sensor.asa5512x1_wan6_in')|float/1000000000)|round(2) }}" unit_of_measurement: 'GiB' friendly_name: Internet in GiB asa5512x1_wan6_out_gib: value_template: "{{ (states('sensor.asa5512x1_wan6_out')|float/1000000000)|round(2) }}" unit_of_measurement: 'GiB' friendly_name: Internet out GiB
And for the totals (day/month):
utility_meter: # asa5512x1 wan usage asa5512x1_wan6_in_gib_monthly: source: sensor.asa5512x1_wan6_in_gib cycle: monthly name: Internet in monthly asa5512x1_wan6_in_gib_daily: source: sensor.asa5512x1_wan6_in_gib cycle: daily name: Internet in daily asa5512x1_wan6_out_gib_monthly: source: sensor.asa5512x1_wan6_out_gib cycle: monthly name: Internet out monthly asa5512x1_wan6_out_gib_daily: source: sensor.asa5512x1_wan6_out_gib cycle: daily name: Internet out daily