Skip to main content

SNMP Querying

Examples of querying AthenaBNG via SNMP. All OIDs are under enterprise prefix 1.3.6.1.4.1.65245. Replace my-community with your configured community string.

Session Queries​

Get Active Session Count​

snmpget -v2c -c my-community localhost 1.3.6.1.4.1.65245.2.1.0

Output:

ATHENA-BNG-MIB::abngSessionsActive.0 = Gauge32: 1234

Get PPPoE / DHCP Split​

snmpget -v2c -c my-community localhost \
1.3.6.1.4.1.65245.2.2.0 \
1.3.6.1.4.1.65245.2.3.0

Get Authenticating Sessions​

snmpget -v2c -c my-community localhost 1.3.6.1.4.1.65245.2.4.0

Traffic Queries​

Aggregate Bytes In/Out​

These aggregate byte totals are now populated from real per-session usage — the agent sums the per-session bytes/packets reported by show subscribers, so they are no longer zero.

snmpget -v2c -c my-community localhost \
1.3.6.1.4.1.65245.2.6.0 \
1.3.6.1.4.1.65245.2.7.0

Total Provisioned Bandwidth​

snmpget -v2c -c my-community localhost \
1.3.6.1.4.1.65245.2.10.0 \
1.3.6.1.4.1.65245.2.11.0

QoS Queries​

# Sessions with CAKE applied vs pending
snmpget -v2c -c my-community localhost \
1.3.6.1.4.1.65245.3.1.0 \
1.3.6.1.4.1.65245.3.2.0 \
1.3.6.1.4.1.65245.3.3.0

CGNAT Queries​

# CGNAT vs public session split
snmpget -v2c -c my-community localhost \
1.3.6.1.4.1.65245.4.1.0 \
1.3.6.1.4.1.65245.4.2.0

Service Health Checks​

TruthValue: 1 = up, 2 = down.

# Check all services
snmpwalk -v2c -c my-community localhost 1.3.6.1.4.1.65245.6
# Check abngd specifically
snmpget -v2c -c my-community localhost 1.3.6.1.4.1.65245.6.1.0

Walk Queries​

Walk All Metrics​

snmpwalk -v2c -c my-community localhost 1.3.6.1.4.1.65245

Walk Subscriber Group Only​

snmpwalk -v2c -c my-community localhost 1.3.6.1.4.1.65245.2

Bulk Queries​

snmpbulkget -v2c -c my-community -Cr28 localhost 1.3.6.1.4.1.65245

Monitoring Tools​

Nagios/Icinga​

# Alert on session count
check_snmp -H localhost -C my-community -o 1.3.6.1.4.1.65245.2.1.0 -w 4000 -c 5000

# Alert if abngd is down
check_snmp -H localhost -C my-community -o 1.3.6.1.4.1.65245.6.1.0 -c 1:1

# Alert if QoS pending > 0
check_snmp -H localhost -C my-community -o 1.3.6.1.4.1.65245.3.3.0 -w 1 -c 10

Prometheus SNMP Exporter​

Configure snmp.yml:

athenabng:
walk:
- 1.3.6.1.4.1.65245
metrics:
- name: athenabng_sessions_active
oid: 1.3.6.1.4.1.65245.2.1
type: gauge
- name: athenabng_sessions_pppoe
oid: 1.3.6.1.4.1.65245.2.2
type: gauge
- name: athenabng_sessions_dhcp
oid: 1.3.6.1.4.1.65245.2.3
type: gauge
- name: athenabng_total_bytes_in
oid: 1.3.6.1.4.1.65245.2.6
type: counter
- name: athenabng_total_bytes_out
oid: 1.3.6.1.4.1.65245.2.7
type: counter
- name: athenabng_qos_sessions_active
oid: 1.3.6.1.4.1.65245.3.1
type: gauge
- name: athenabng_cgnat_sessions
oid: 1.3.6.1.4.1.65245.4.1
type: gauge
- name: athenabng_dynamic_vlans
oid: 1.3.6.1.4.1.65245.5.1
type: gauge
- name: athenabng_service_abngd
oid: 1.3.6.1.4.1.65245.6.1
type: gauge

Troubleshooting​

SNMP Not Responding​

  1. Check SNMP agent is running:

    sudo systemctl status snmpd
  2. Check SNMP port is listening:

    sudo ss -ulnp | grep :161
  3. Check firewall allows UDP 161:

    sudo nft list ruleset | grep 161

Wrong Community String​

snmpget -v2c -c wrong localhost 1.3.6.1.4.1.65245.2.1.0

Error:

No SNMP response received before timeout

Solution: Use the community string from your snmp: config section.

MIB Not Found​

snmpget -v2c -c my-community localhost ATHENA-BNG-MIB::abngSessionsActive.0

Error:

Unknown Object Identifier (ATHENA-BNG-MIB::abngSessionsActive.0)

Solution: Install the MIB file:

sudo cp /opt/athena-bng/snmp/ATHENA-BNG-MIB.txt /usr/share/snmp/mibs/

Next Steps​