不確定是不是因為 LibreNMS 版本太舊,還是 MIB 檔沒更新,導致無法讓 LibreNMS 無法識別出
Ubiquiti Unifi WiFi-AP / Switch , 也可能設備太新導致.經過一番 google 後,有看到相關資訊,如下
URL https://community.librenms.org/t/ubiquiti-devices/11341
官方相關的 URL為 https://docs.librenms.org/Developing/os/Initial-Detection/
看了一下目前設定,並修改如下:
[root@LibreNMS definitions]# pwd
/opt/librenms/includes/definitions
[root@LibreNMS definitions]#
[root@LibreNMS definitions]# cat unifi.yaml
os: unifi
text: 'Ubiquiti UniFi'
type: wireless
icon: ubiquiti
mib_dir: ubnt
over:
- { graph: device_bits, text: 'Device Traffic' }
- { graph: device_wireless_clients, text: 'Connected Clients' }
- { graph: device_wireless_ccq, text: 'Connection Quality' }
discovery:
-
sysObjectID:
- .1.3.6.1.4.1.41112
- .1.3.6.1.4.1.8072.3.2.10
sysDescr_regex:
- '/^UAP/'
- '/^U6/'
- '/^U7-Pro/'
-
sysObjectID: .1.3.6.1.4.1.10002.1
sysDescr: Linux
snmpwalk:
oid: 'IEEE802dot11-MIB::dot11manufacturerProductName'
op: 'contains'
value: 'UAP'
[root@LibreNMS definitions]# cat edgeswitch.yaml
os: edgeswitch
text: EdgeSwitch
type: network
icon: ubiquiti
ifname: true
bad_snmpEngineTime: true
over:
- { graph: device_bits, text: 'Device Traffic' }
- { graph: device_processor, text: 'CPU Usage' }
- { graph: device_mempool, text: 'Memory Usage' }
discovery:
-
sysObjectID:
- .1.3.6.1.2.1.1.1.0
- .1.3.6.1.4.1.4413
- .1.3.6.1.4.1.41112
- .1.3.6.1.4.1.10002
sysDescr_regex:
- '/^EdgeSwitch/'
- '/^EdgePoint/'
- '/^USW[ -]/'
- '/^UBNT US/'
- '/^US[ -]/'
-
sysObjectID:
- .1.3.6.1.4.1.8072.3.2.10
- .1.3.6.1.4.1.27282.3.2.10
sysDescr_regex:
- '/^Linux UBNT/'
- '/^RTL8380/'
- '/^Linux.* 4.4.153/'
- '/^Linux.* 3.18.24/'
以上檔案的內容定義可能會跟所使用的 LibreNMS 的版本不同,而有所不一樣.
如 LibreNMS Version 24.11.0-66-g47a9e2b7d
[root@node1 definitions]# cat unifi.yaml
os: unifi
text: 'Ubiquiti UniFi'
type: wireless
icon: ubiquiti
mib_dir: ubnt
over:
- { graph: device_bits, text: 'Device Traffic' }
- { graph: device_wireless_clients, text: 'Connected Clients' }
- { graph: device_wireless_ccq, text: 'Connection Quality' }
discovery:
-
sysObjectID:
- .1.3.6.1.4.1.41112
- .1.3.6.1.4.1.8072.3.2.10
sysDescr_regex:
- '/^UAP/'
- '/^U6/'
- '/^U7/'
- '/^U-LTE/'
-
sysObjectID: .1.3.6.1.4.1.10002.1
sysDescr: Linux
snmpwalk:
oid: 'IEEE802dot11-MIB::dot11manufacturerProductName'
op: 'contains'
value: 'UAP'
[root@node1 definitions]#
[root@node1 definitions]# cat edgeswitch.yaml
os: edgeswitch
text: EdgeSwitch
type: network
icon: ubiquiti
ifname: true
bad_snmpEngineTime: true
over:
- { graph: device_bits, text: 'Device Traffic' }
- { graph: device_processor, text: 'CPU Usage' }
- { graph: device_mempool, text: 'Memory Usage' }
discovery:
-
sysObjectID:
- .1.3.6.1.4.1.4413
- .1.3.6.1.4.1.41112
- .1.3.6.1.4.1.10002
- .1.3.6.1.4.1.8072
- .1.3.6.1.4.1
sysDescr_regex:
- '/^EdgeSwitch/'
- '/^EdgePoint/'
- '/^USW[ -]/'
- '/^UBNT US/'
- '/^US[ -]/'
-
sysObjectID:
- .1.3.6.1.4.1.8072.3.2.10
- .1.3.6.1.4.1.27282.3.2.10
sysDescr_regex:
- '/^Linux UBNT/'
- '/^RTL8380/'
[root@node1 definitions]#
另外有一個地方的設定,也是相關的.
[root@node1 discovery]# pwd
/opt/librenms/includes/definitions/discovery
[root@node1 discovery]#
[root@node1 discovery]# cat unifi.yaml
modules:
mempools:
data:
-
total: FROGFOOT-RESOURCES-MIB::memTotal
free: FROGFOOT-RESOURCES-MIB::memFree
precision: 1024
[root@node1 discovery]#
[root@node1 discovery]# cat edgeswitch.yaml
mib: EdgeSwitch-BOXSERVICES-PRIVATE-MIB
modules:
mempools:
data:
-
total: EdgeSwitch-SWITCHING-MIB::agentSwitchCpuProcessMemAvailable
free: EdgeSwitch-SWITCHING-MIB::agentSwitchCpuProcessMemFree
precision: 1024
os:
sysDescr_regex: '/^(?<hardware>EdgeSwitch[ \d\w\-]*|EdgePoint Switch[ \d\w\-]*|US[ \d\w\-]*)(,)* (firmware )*(?<version>\S*)(, Linux .*)*$/'
serial: ENTITY-MIB::entPhysicalSerialNum.1
sensors:
state:
data:
-
oid: boxServicesTempUnitEntry
value: boxServicesTempUnitState
num_oid: '.1.3.6.1.4.1.4413.1.1.43.1.15.1.2.{{ $index }}'
descr: 'Chassis state'
index: 'boxServicesTempUnitState.{{ $index }}'
states:
- { value: 0, descr: low, graph: 1, generic: 1 }
- { value: 1, descr: normal, graph: 1, generic: 0 }
- { value: 2, descr: warning, graph: 1, generic: 1 }
- { value: 3, descr: critical, graph: 1, generic: 2 }
- { value: 4, descr: shutdown, graph: 1, generic: 2 }
- { value: 5, descr: notpresent, graph: 1, generic: 3 }
- { value: 6, descr: notoperational, graph: 1, generic: 2 }
-
oid: boxServicesTempSensorsEntry
value: boxServicesTempSensorState
num_oid: '.1.3.6.1.4.1.4413.1.1.43.1.8.1.4.{{ $index }}'
descr: 'Temp Sensor {{ $index }}'
index: 'boxServicesTempSensorState.{{ $index }}'
states:
- { value: 0, descr: low, graph: 1, generic: 1 }
- { value: 1, descr: normal, graph: 1, generic: 0 }
- { value: 2, descr: warning, graph: 1, generic: 1 }
- { value: 3, descr: critical, graph: 1, generic: 2 }
- { value: 4, descr: shutdown, graph: 1, generic: 2 }
- { value: 5, descr: notpresent, graph: 1, generic: 3 }
- { value: 6, descr: notoperational, graph: 1, generic: 2 }
-
oid: boxServicesFansEntry
value: boxServicesFanItemState
num_oid: '.1.3.6.1.4.1.4413.1.1.43.1.6.1.3.{{ $index }}'
descr: 'Fan {{ $index }}'
index: 'boxServicesFanItemState.{{ $index }}'
states:
- { value: 1, descr: notpresent, graph: 1, generic: 3 }
- { value: 2, descr: operational, graph: 1, generic: 0 }
- { value: 3, descr: failed, graph: 1, generic: 2 }
- { value: 4, descr: powering, graph: 1, generic: 0 }
- { value: 5, descr: nopower, graph: 1, generic: 2 }
- { value: 6, descr: notpowering, graph: 1, generic: 2 }
- { value: 7, descr: incompatible, graph: 1, generic: 1 }
fanspeed:
data:
-
oid: boxServicesFansEntry
value: boxServicesFanSpeed
num_oid: '.1.3.6.1.4.1.4413.1.1.43.1.6.1.4.{{ $index }}'
index: 'boxServicesFanSpeed.{{ $index }}'
descr: 'Fan {{ $index }}'
temperature:
data:
-
oid: boxServicesTempSensorsEntry
value: boxServicesTempSensorTemperature
num_oid: '.1.3.6.1.4.1.4413.1.1.43.1.8.1.5.{{ $index }}'
index: 'boxServicesTempSensorTemperature.{{ $index }}'
descr: 'Temperature {{ $index }}'
[root@node1 discovery]#
[root@LibreNMS definitions]# snmpwalk -Os -c public -v 2c UniFi-Switch system
sysDescr.0 = STRING: Linux UniFi-Switch 4.4.153 #0 Thu Aug 30 12:10:54 2018 mips
sysObjectID.0 = OID: netSnmpAgentOIDs.10
sysUpTimeInstance = Timeticks: (213856100) 24 days, 18:02:41.00
sysContact.0 = STRING: Default
sysName.0 = STRING: UniFi-Switch
sysLocation.0 = STRING: Default
[root@LibreNMS definitions]#