Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    How to discover SNMP OID information for Home Assistant

    Scheduled Pinned Locked Moved SNMP
    3 Posts 3 Posters 2.1k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      SOUK
      last edited by SOUK

      Is their any way to obtain or discover PfSense OID's for things like:

      cpuLoad
      users
      processes
      disk-size
      disk-usage

      Or 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-usage

      But 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?

      johnpozJ D 2 Replies Last reply Reply Quote 0
      • johnpozJ
        johnpoz LAYER 8 Global Moderator @SOUK
        last edited by

        @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

        An intelligent man is sometimes forced to be drunk to spend time with his fools
        If you get confused: Listen to the Music Play
        Please don't Chat/PM me for help, unless mod related
        SG-4860 24.11 | Lab VMs 2.7.2, 24.11

        1 Reply Last reply Reply Quote 1
        • D
          disi1 @SOUK
          last edited by disi1

          @SOUK Home Assistant has an active Integration for pfSense via HACS.
          https://github.com/travisghansen/hass-pfsense

          It gives CPU, Memory, Leases, Disk etc.
          HA_pfsense.png

          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 number

          sensor:
          # 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
          
          1 Reply Last reply Reply Quote 0
          • First post
            Last post
          Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.