snmp-oldswitch2| Stage | Executed by | Model | Cost |
|---|---|---|---|
| Parse MIB | deterministic code | — | |
| Compile artifacts | deterministic code | — | |
| Run + validate | deterministic code | — | 2 run(s), 0 tokens |
| Metric | Type | Observed | Series | Sample | Labels | Note | |
|---|---|---|---|---|---|---|---|
| ✓ | network_interface_count | gauge | gauge | 1 | 2 | — | |
| ✓ | network_interface_admin_status | gauge | gauge | 2 | 1 | ifIndex, interface | |
| ✓ | network_interface_oper_status | gauge | gauge | 2 | 1 | ifIndex, interface | |
| ✓ | network_interface_last_change_seconds | gauge | gauge | 2 | 12 | ifIndex, interface | |
| ✓ | network_interface_speed_bits | gauge | gauge | 2 | 100,000,000 | ifIndex, interface | |
| ✓ | network_interface_receive_bytes_total | counter | counter | 2 | 161,102 | ifIndex, interface | |
| ✓ | network_interface_transmit_bytes_total | counter | counter | 2 | 165,696 | ifIndex, interface | |
| ✓ | network_interface_receive_errors_total | counter | counter | 2 | 12 | ifIndex, interface | |
| ✓ | network_interface_transmit_errors_total | counter | counter | 2 | 3 | ifIndex, interface |
missing_metric ×13| Model | Calls | Tokens in | Tokens out |
|---|---|---|---|
| sonnet | 2 | 21.2K | 3.3K |
| total | 2 | 21.2K | 3.3K |
| validation (2 run(s)) | 0 | 0 | 0 |
auths:
public_v2:
community: oldswitch
security_level: noAuthNoPriv
auth_protocol: MD5
priv_protocol: DES
version: 2
modules:
if_mib:
walk:
- 1.3.6.1.2.1.2.1
- 1.3.6.1.2.1.2.2.1.2
- 1.3.6.1.2.1.2.2.1.5
- 1.3.6.1.2.1.2.2.1.7
- 1.3.6.1.2.1.2.2.1.8
- 1.3.6.1.2.1.2.2.1.9
- 1.3.6.1.2.1.2.2.1.10
- 1.3.6.1.2.1.2.2.1.14
- 1.3.6.1.2.1.2.2.1.16
- 1.3.6.1.2.1.2.2.1.20
metrics:
- name: network_interface_count
oid: 1.3.6.1.2.1.2.1
type: gauge
help: Number of network interfaces present on the system. - ifNumber (1.3.6.1.2.1.2.1)
- name: network_interface_admin_status
oid: 1.3.6.1.2.1.2.2.1.7
type: gauge
help: Desired interface state (1=up, 2=down, 3=testing). - ifAdminStatus (1.3.6.1.2.1.2.2.1.7)
indexes:
- labelname: ifIndex
type: gauge
lookups:
- labels:
- ifIndex
labelname: interface
oid: 1.3.6.1.2.1.2.2.1.2
type: DisplayString
enum_values:
1: up
2: down
3: testing
- name: network_interface_oper_status
oid: 1.3.6.1.2.1.2.2.1.8
type: gauge
help: Current operational state (1=up, 2=down, 3=testing, 4=unknown, 5=dormant, 6=notPresent, 7=lowerLayerDown). - ifOperStatus (1.3.6.1.2.1.2.2.1.8)
indexes:
- labelname: ifIndex
type: gauge
lookups:
- labels:
- ifIndex
labelname: interface
oid: 1.3.6.1.2.1.2.2.1.2
type: DisplayString
enum_values:
1: up
2: down
3: testing
4: unknown
5: dormant
6: notPresent
7: lowerLayerDown
- name: network_interface_last_change_seconds
oid: 1.3.6.1.2.1.2.2.1.9
type: gauge
help: sysUpTime value (in timeticks) when the interface entered its current operational state. - ifLastChange (1.3.6.1.2.1.2.2.1.9)
scale: 0.01
indexes:
- labelname: ifIndex
type: gauge
lookups:
- labels:
- ifIndex
labelname: interface
oid: 1.3.6.1.2.1.2.2.1.2
type: DisplayString
- name: network_interface_speed_bits
oid: 1.3.6.1.2.1.2.2.1.5
type: gauge
help: Estimate of the interface's current bandwidth in bits per second (32-bit ifTable object; ifHighSpeed is not implemented on this device). - ifSpeed (1.3.6.1.2.1.2.2.1.5)
indexes:
- labelname: ifIndex
type: gauge
lookups:
- labels:
- ifIndex
labelname: interface
oid: 1.3.6.1.2.1.2.2.1.2
type: DisplayString
- name: network_interface_receive_bytes_total
oid: 1.3.6.1.2.1.2.2.1.10
type: counter
help: Total octets received on the interface (32-bit counter; ifHCInOctets is not implemented on this device). - ifInOctets (1.3.6.1.2.1.2.2.1.10)
indexes:
- labelname: ifIndex
type: gauge
lookups:
- labels:
- ifIndex
labelname: interface
oid: 1.3.6.1.2.1.2.2.1.2
type: DisplayString
- name: network_interface_transmit_bytes_total
oid: 1.3.6.1.2.1.2.2.1.16
type: counter
help: Total octets transmitted out of the interface (32-bit counter; ifHCOutOctets is not implemented on this device). - ifOutOctets (1.3.6.1.2.1.2.2.1.16)
indexes:
- labelname: ifIndex
type: gauge
lookups:
- labels:
- ifIndex
labelname: interface
oid: 1.3.6.1.2.1.2.2.1.2
type: DisplayString
- name: network_interface_receive_errors_total
oid: 1.3.6.1.2.1.2.2.1.14
type: counter
help: Inbound packets that contained errors preventing delivery to a higher layer. - ifInErrors (1.3.6.1.2.1.2.2.1.14)
indexes:
- labelname: ifIndex
type: gauge
lookups:
- labels:
- ifIndex
labelname: interface
oid: 1.3.6.1.2.1.2.2.1.2
type: DisplayString
- name: network_interface_transmit_errors_total
oid: 1.3.6.1.2.1.2.2.1.20
type: counter
help: Outbound packets that could not be transmitted because of errors. - ifOutErrors (1.3.6.1.2.1.2.2.1.20)
indexes:
- labelname: ifIndex
type: gauge
lookups:
- labels:
- ifIndex
labelname: interface
oid: 1.3.6.1.2.1.2.2.1.2
type: DisplayString
# snmp_exporter generator config, produced by migen.
# MIB modules required: IF-MIB
# Run: generator generate -m <mib-dir> -g generator.yml -o snmp.yml
# NOTE: `rename_to` under overrides is a migen annotation recording the
# intended Prometheus metric name; the upstream generator ignores it.
auths:
public_v2:
community: public
version: 2
modules:
if_mib:
walk:
- ifAdminStatus
- ifDescr
- ifInErrors
- ifInOctets
- ifLastChange
- ifNumber
- ifOperStatus
- ifOutErrors
- ifOutOctets
- ifSpeed
lookups:
- source_indexes:
- ifIndex
lookup: ifDescr
drop_source_indexes: false
overrides:
ifNumber:
rename_to: network_interface_count
ifAdminStatus:
rename_to: network_interface_admin_status
ifOperStatus:
rename_to: network_interface_oper_status
ifLastChange:
rename_to: network_interface_last_change_timeticks_seconds
ifSpeed:
rename_to: network_interface_speed_bits
ifInOctets:
rename_to: network_interface_receive_bytes_total
ifOutOctets:
rename_to: network_interface_transmit_bytes_total
ifInErrors:
rename_to: network_interface_receive_errors_total
ifOutErrors:
rename_to: network_interface_transmit_errors_total
{
"service": "oldswitch",
"kind": "snmp_generator",
"endpoints": [
{
"url": "127.0.0.1:11162",
"method": "GET",
"auth": "none",
"auth_detail": "",
"response_format": "snmp",
"notes": "snmp_exporter module=if_mib, auth=public_v2"
}
],
"metrics": [
{
"name": "network_interface_count",
"type": "gauge",
"help": "Number of network interfaces present on the system.",
"unit": "",
"labels": [],
"value": {
"min": null,
"max": null
},
"source": "SNMP ifNumber oid=1.3.6.1.2.1.2.1 module=IF-MIB",
"required": true
},
{
"name": "network_interface_admin_status",
"type": "gauge",
"help": "Desired interface state (1=up, 2=down, 3=testing).",
"unit": "",
"labels": [
{
"name": "ifIndex",
"description": "table index ifIndex",
"allowed_values": null,
"required": true
},
{
"name": "interface",
"description": "lookup from ifDescr",
"allowed_values": null,
"required": true
}
],
"value": {
"min": null,
"max": null
},
"source": "SNMP ifAdminStatus oid=1.3.6.1.2.1.2.2.1.7 module=IF-MIB",
"required": true
},
{
"name": "network_interface_oper_status",
"type": "gauge",
"help": "Current operational state (1=up, 2=down, 3=testing, 4=unknown, 5=dormant, 6=notPresent, 7=lowerLayerDown).",
"unit": "",
"labels": [
{
"name": "ifIndex",
"description": "table index ifIndex",
"allowed_values": null,
"required": true
},
{
"name": "interface",
"description": "lookup from ifDescr",
"allowed_values": null,
"required": true
}
],
"value": {
"min": null,
"max": null
},
"source": "SNMP ifOperStatus oid=1.3.6.1.2.1.2.2.1.8 module=IF-MIB",
"required": true
},
{
"name": "network_interface_last_change_seconds",
"type": "gauge",
"help": "sysUpTime value (in timeticks) when the interface entered its current operational state.",
"unit": "",
"labels": [
{
"name": "ifIndex",
"description": "table index ifIndex",
"allowed_values": null,
"required": true
},
{
"name": "interface",
"description": "lookup from ifDescr",
"allowed_values": null,
"required": true
}
],
"value": {
"min": null,
"max": null
},
"source": "SNMP ifLastChange oid=1.3.6.1.2.1.2.2.1.9 module=IF-MIB",
"required": true
},
{
"name": "network_interface_speed_bits",
"type": "gauge",
"help": "Estimate of the interface's current bandwidth in bits per second (32-bit ifTable object; ifHighSpeed is not implemented on this device).",
"unit": "",
"labels": [
{
"name": "ifIndex",
"description": "table index ifIndex",
"allowed_values": null,
"required": true
},
{
"name": "interface",
"description": "lookup from ifDescr",
"allowed_values": null,
"required": true
}
],
"value": {
"min": null,
"max": null
},
"source": "SNMP ifSpeed oid=1.3.6.1.2.1.2.2.1.5 module=IF-MIB",
"required": true
},
{
"name": "network_interface_receive_bytes_total",
"type": "counter",
"help": "Total octets received on the interface (32-bit counter; ifHCInOctets is not implemented on this device).",
"unit": "",
"labels": [
{
"name": "ifIndex",
"description": "table index ifIndex",
"allowed_values": null,
"required": true
},
{
"name": "interface",
"description": "lookup from ifDescr",
"allowed_values": null,
"required": true
}
],
"value": {
"min": 0.0,
"max": null
},
"source": "SNMP ifInOctets oid=1.3.6.1.2.1.2.2.1.10 module=IF-MIB",
"required": true
},
{
"name": "network_interface_transmit_bytes_total",
"type": "counter",
"help": "Total octets transmitted out of the interface (32-bit counter; ifHCOutOctets is not implemented on this device).",
"unit": "",
"labels": [
{
"name": "ifIndex",
"description": "table index ifIndex",
"allowed_values": null,
"required": true
},
{
"name": "interface",
"description": "lookup from ifDescr",
"allowed_values": null,
"required": true
}
],
"value": {
"min": 0.0,
"max": null
},
"source": "SNMP ifOutOctets oid=1.3.6.1.2.1.2.2.1.16 module=IF-MIB",
"required": true
},
{
"name": "network_interface_receive_errors_total",
"type": "counter",
"help": "Inbound packets that contained errors preventing delivery to a higher layer.",
"unit": "",
"labels": [
{
"name": "ifIndex",
"description": "table index ifIndex",
"allowed_values": null,
"required": true
},
{
"name": "interface",
"description": "lookup from ifDescr",
"allowed_values": null,
"required": true
}
],
"value": {
"min": 0.0,
"max": null
},
"source": "SNMP ifInErrors oid=1.3.6.1.2.1.2.2.1.14 module=IF-MIB",
"required": true
},
{
"name": "network_interface_transmit_errors_total",
"type": "counter",
"help": "Outbound packets that could not be transmitted because of errors.",
"unit": "",
"labels": [
{
"name": "ifIndex",
"description": "table index ifIndex",
"allowed_values": null,
"required": true
},
{
"name": "interface",
"description": "lookup from ifDescr",
"allowed_values": null,
"required": true
}
],
"value": {
"min": 0.0,
"max": null
},
"source": "SNMP ifOutErrors oid=1.3.6.1.2.1.2.2.1.20 module=IF-MIB",
"required": true
}
],
"notes": "Device implements only ifNumber and a subset of ifTable; ifXTable (1.3.6.1.2.1.31.1.1) returned nothing, so all ifHC* counters and ifHighSpeed were replaced by 32-bit equivalents where present (ifInOctets, ifOutOctets, ifSpeed). ifSpeed is reported in bits per second, so the metric is named _bits rather than _megabits. Dropped with no working equivalent in the walk: unicast/multicast/broadcast packet counters (ifInUcastPkts, ifOutUcastPkts, ifHC*), ifInDiscards, ifOutDiscards, ifInUnknownProtos, ifOutQLen. Counters are 32-bit and may wrap on fast links; at 100 Mbps this is acceptable with rate() at typical scrape intervals. Lookup remains ifIndex -> ifDescr, which returned values."
}{
"module_name": "if_mib",
"metrics": [
{
"mib_object": "ifNumber",
"metric_name": "network_interface_count",
"help": "Number of network interfaces present on the system."
},
{
"mib_object": "ifAdminStatus",
"metric_name": "network_interface_admin_status",
"help": "Desired interface state (1=up, 2=down, 3=testing)."
},
{
"mib_object": "ifOperStatus",
"metric_name": "network_interface_oper_status",
"help": "Current operational state (1=up, 2=down, 3=testing, 4=unknown, 5=dormant, 6=notPresent, 7=lowerLayerDown)."
},
{
"mib_object": "ifLastChange",
"metric_name": "network_interface_last_change_timeticks",
"help": "sysUpTime value (in timeticks) when the interface entered its current operational state."
},
{
"mib_object": "ifSpeed",
"metric_name": "network_interface_speed_bits",
"help": "Estimate of the interface's current bandwidth in bits per second (32-bit ifTable object; ifHighSpeed is not implemented on this device)."
},
{
"mib_object": "ifInOctets",
"metric_name": "network_interface_receive_bytes_total",
"help": "Total octets received on the interface (32-bit counter; ifHCInOctets is not implemented on this device)."
},
{
"mib_object": "ifOutOctets",
"metric_name": "network_interface_transmit_bytes_total",
"help": "Total octets transmitted out of the interface (32-bit counter; ifHCOutOctets is not implemented on this device)."
},
{
"mib_object": "ifInErrors",
"metric_name": "network_interface_receive_errors_total",
"help": "Inbound packets that contained errors preventing delivery to a higher layer."
},
{
"mib_object": "ifOutErrors",
"metric_name": "network_interface_transmit_errors_total",
"help": "Outbound packets that could not be transmitted because of errors."
}
],
"lookups": [
{
"index_labels": [
"ifIndex"
],
"source_object": "ifDescr",
"label_name": "interface"
}
],
"notes": "Device implements only ifNumber and a subset of ifTable; ifXTable (1.3.6.1.2.1.31.1.1) returned nothing, so all ifHC* counters and ifHighSpeed were replaced by 32-bit equivalents where present (ifInOctets, ifOutOctets, ifSpeed). ifSpeed is reported in bits per second, so the metric is named _bits rather than _megabits. Dropped with no working equivalent in the walk: unicast/multicast/broadcast packet counters (ifInUcastPkts, ifOutUcastPkts, ifHC*), ifInDiscards, ifOutDiscards, ifInUnknownProtos, ifOutQLen. Counters are 32-bit and may wrap on fast links; at 100 Mbps this is acceptable with rate() at typical scrape intervals. Lookup remains ifIndex -> ifDescr, which returned values."
}