mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Added PSU state to Netgear discovery definition (#10150)
* Add PSU state to Netgear discovery definition * Add tests for Netgear PSU
This commit is contained in:
@@ -35,4 +35,18 @@ modules:
|
||||
- { value: 5, generic: 3, graph: 0, descr: nopower }
|
||||
- { value: 6, generic: 3, graph: 0, descr: notpowering }
|
||||
- { value: 7, generic: 1, graph: 0, descr: incompatible }
|
||||
|
||||
-
|
||||
oid: boxServicesPowSuppliesTable
|
||||
value: boxServicesPowSupplyItemState
|
||||
num_oid: '.1.3.6.1.4.1.4526.10.43.1.7.1.3.{{ $index }}'
|
||||
descr: 'PSU {{ $subindex0 }} State'
|
||||
index: 'boxServicesPowSupplyItemState.{{ $index }}'
|
||||
state_name: boxServicesPowSupplyItemState
|
||||
states:
|
||||
- { value: 1, generic: 0, graph: 0, descr: notpresent }
|
||||
- { value: 2, generic: 0, graph: 0, descr: operational }
|
||||
- { value: 3, generic: 2, graph: 0, descr: failed }
|
||||
- { value: 4, generic: 3, graph: 0, descr: powering }
|
||||
- { value: 5, generic: 3, graph: 0, descr: nopower }
|
||||
- { value: 6, generic: 3, graph: 0, descr: notpowering }
|
||||
- { value: 7, generic: 1, graph: 0, descr: incompatible }
|
||||
|
146
tests/data/netgear_3.json
Normal file
146
tests/data/netgear_3.json
Normal file
@@ -0,0 +1,146 @@
|
||||
{
|
||||
"sensors": {
|
||||
"discovery": {
|
||||
"sensors": [
|
||||
{
|
||||
"sensor_deleted": 0,
|
||||
"sensor_class": "state",
|
||||
"poller_type": "snmp",
|
||||
"sensor_oid": ".1.3.6.1.4.1.4526.10.43.1.7.1.3.0",
|
||||
"sensor_index": "boxServicesPowSupplyItemState.0",
|
||||
"sensor_type": "boxServicesPowSupplyItemState",
|
||||
"sensor_descr": "PSU 0 State",
|
||||
"group": "",
|
||||
"sensor_divisor": 1,
|
||||
"sensor_multiplier": 1,
|
||||
"sensor_current": 2,
|
||||
"sensor_limit": null,
|
||||
"sensor_limit_warn": null,
|
||||
"sensor_limit_low": null,
|
||||
"sensor_limit_low_warn": null,
|
||||
"sensor_alert": 1,
|
||||
"sensor_custom": "No",
|
||||
"entPhysicalIndex": null,
|
||||
"entPhysicalIndex_measured": null,
|
||||
"sensor_prev": null,
|
||||
"user_func": null,
|
||||
"state_name": "boxServicesPowSupplyItemState"
|
||||
},
|
||||
{
|
||||
"sensor_deleted": 0,
|
||||
"sensor_class": "temperature",
|
||||
"poller_type": "snmp",
|
||||
"sensor_oid": ".1.3.6.1.4.1.4526.10.43.1.8.1.5.1.0",
|
||||
"sensor_index": "boxServicesTempSensorTemperature.1.0",
|
||||
"sensor_type": "netgear",
|
||||
"sensor_descr": "Switch 1 Sensor 0 Temperature",
|
||||
"group": "",
|
||||
"sensor_divisor": 1,
|
||||
"sensor_multiplier": 1,
|
||||
"sensor_current": 47,
|
||||
"sensor_limit": 67,
|
||||
"sensor_limit_warn": null,
|
||||
"sensor_limit_low": 37,
|
||||
"sensor_limit_low_warn": null,
|
||||
"sensor_alert": 1,
|
||||
"sensor_custom": "No",
|
||||
"entPhysicalIndex": null,
|
||||
"entPhysicalIndex_measured": null,
|
||||
"sensor_prev": null,
|
||||
"user_func": null,
|
||||
"state_name": null
|
||||
}
|
||||
],
|
||||
"state_indexes": [
|
||||
{
|
||||
"state_name": "boxServicesPowSupplyItemState",
|
||||
"state_descr": "notpresent",
|
||||
"state_draw_graph": 0,
|
||||
"state_value": 1,
|
||||
"state_generic_value": 0
|
||||
},
|
||||
{
|
||||
"state_name": "boxServicesPowSupplyItemState",
|
||||
"state_descr": "operational",
|
||||
"state_draw_graph": 0,
|
||||
"state_value": 2,
|
||||
"state_generic_value": 0
|
||||
},
|
||||
{
|
||||
"state_name": "boxServicesPowSupplyItemState",
|
||||
"state_descr": "failed",
|
||||
"state_draw_graph": 0,
|
||||
"state_value": 3,
|
||||
"state_generic_value": 2
|
||||
},
|
||||
{
|
||||
"state_name": "boxServicesPowSupplyItemState",
|
||||
"state_descr": "powering",
|
||||
"state_draw_graph": 0,
|
||||
"state_value": 4,
|
||||
"state_generic_value": 3
|
||||
},
|
||||
{
|
||||
"state_name": "boxServicesPowSupplyItemState",
|
||||
"state_descr": "nopower",
|
||||
"state_draw_graph": 0,
|
||||
"state_value": 5,
|
||||
"state_generic_value": 3
|
||||
},
|
||||
{
|
||||
"state_name": "boxServicesPowSupplyItemState",
|
||||
"state_descr": "notpowering",
|
||||
"state_draw_graph": 0,
|
||||
"state_value": 6,
|
||||
"state_generic_value": 3
|
||||
},
|
||||
{
|
||||
"state_name": "boxServicesPowSupplyItemState",
|
||||
"state_descr": "incompatible",
|
||||
"state_draw_graph": 0,
|
||||
"state_value": 7,
|
||||
"state_generic_value": 1
|
||||
}
|
||||
]
|
||||
},
|
||||
"poller": "matches discovery"
|
||||
},
|
||||
"os": {
|
||||
"discovery": {
|
||||
"devices": [
|
||||
{
|
||||
"sysName": "<private>",
|
||||
"sysObjectID": ".1.3.6.1.4.1.4526.100.11.22",
|
||||
"sysDescr": "M4100-D12G ProSafe 12-port Gigabit L2+ Intelligent Edge Desktop Managed Switch, 10.0.2.26, B1.0.1.1",
|
||||
"sysContact": null,
|
||||
"version": null,
|
||||
"hardware": null,
|
||||
"features": null,
|
||||
"os": "netgear",
|
||||
"type": "network",
|
||||
"serial": null,
|
||||
"icon": "netgear.svg",
|
||||
"location": null
|
||||
}
|
||||
]
|
||||
},
|
||||
"poller": {
|
||||
"devices": [
|
||||
{
|
||||
"sysName": "<private>",
|
||||
"sysObjectID": ".1.3.6.1.4.1.4526.100.11.22",
|
||||
"sysDescr": "M4100-D12G ProSafe 12-port Gigabit L2+ Intelligent Edge Desktop Managed Switch, 10.0.2.26, B1.0.1.1",
|
||||
"sysContact": "<private>",
|
||||
"version": " 10.0.2.26",
|
||||
"hardware": "M4100-D12G",
|
||||
"features": null,
|
||||
"os": "netgear",
|
||||
"type": "network",
|
||||
"serial": null,
|
||||
"icon": "netgear.svg",
|
||||
"location": "<private>"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
44
tests/snmpsim/netgear_3.snmprec
Normal file
44
tests/snmpsim/netgear_3.snmprec
Normal file
@@ -0,0 +1,44 @@
|
||||
1.3.6.1.2.1.1.1.0|4|M4100-D12G ProSafe 12-port Gigabit L2+ Intelligent Edge Desktop Managed Switch, 10.0.2.26, B1.0.1.1
|
||||
1.3.6.1.2.1.1.2.0|6|1.3.6.1.4.1.4526.100.11.22
|
||||
1.3.6.1.2.1.1.3.0|67|59442200
|
||||
1.3.6.1.2.1.1.4.0|4|<private>
|
||||
1.3.6.1.2.1.1.5.0|4|<private>
|
||||
1.3.6.1.2.1.1.6.0|4|<private>
|
||||
1.3.6.1.2.1.47.1.1.1.1.2.1|4|M4100-D12G ProSafe 12-port Gigabit L2+ Intelligent Edge Desktop Managed Switch
|
||||
1.3.6.1.2.1.47.1.1.1.1.2.2|4|Broadcom BCM56144 - 12 GE Port Dedicated Ethernet Line Card
|
||||
1.3.6.1.2.1.47.1.1.1.1.2.3|4|Slot: 0 Port: 1 Gigabit - Level
|
||||
1.3.6.1.2.1.47.1.1.1.1.2.4|4|Slot: 0 Port: 2 Gigabit - Level
|
||||
1.3.6.1.2.1.47.1.1.1.1.2.5|4|Slot: 0 Port: 3 Gigabit - Level
|
||||
1.3.6.1.2.1.47.1.1.1.1.2.6|4|Slot: 0 Port: 4 Gigabit - Level
|
||||
1.3.6.1.2.1.47.1.1.1.1.2.7|4|Slot: 0 Port: 5 Gigabit - Level
|
||||
1.3.6.1.2.1.47.1.1.1.1.2.8|4|Slot: 0 Port: 6 Gigabit - Level
|
||||
1.3.6.1.2.1.47.1.1.1.1.2.9|4|Slot: 0 Port: 7 Gigabit - Level
|
||||
1.3.6.1.2.1.47.1.1.1.1.2.10|4|Slot: 0 Port: 8 Gigabit - Level
|
||||
1.3.6.1.2.1.47.1.1.1.1.2.11|4|Slot: 0 Port: 9 Gigabit - Level
|
||||
1.3.6.1.2.1.47.1.1.1.1.2.12|4|Slot: 0 Port: 10 Gigabit - Level
|
||||
1.3.6.1.2.1.47.1.1.1.1.2.13|4|Slot: 0 Port: 11 Gigabit - Level
|
||||
1.3.6.1.2.1.47.1.1.1.1.2.14|4|Slot: 0 Port: 12 Gigabit - Level
|
||||
1.3.6.1.2.1.47.1.1.1.1.7.1|4|Unit 1
|
||||
1.3.6.1.2.1.47.1.1.1.1.7.2|4|Slot 1.0
|
||||
1.3.6.1.2.1.47.1.1.1.1.7.3|4|0/1
|
||||
1.3.6.1.2.1.47.1.1.1.1.7.4|4|0/2
|
||||
1.3.6.1.2.1.47.1.1.1.1.7.5|4|0/3
|
||||
1.3.6.1.2.1.47.1.1.1.1.7.6|4|0/4
|
||||
1.3.6.1.2.1.47.1.1.1.1.7.7|4|0/5
|
||||
1.3.6.1.2.1.47.1.1.1.1.7.8|4|0/6
|
||||
1.3.6.1.2.1.47.1.1.1.1.7.9|4|0/7
|
||||
1.3.6.1.2.1.47.1.1.1.1.7.10|4|0/8
|
||||
1.3.6.1.2.1.47.1.1.1.1.7.11|4|0/9
|
||||
1.3.6.1.2.1.47.1.1.1.1.7.12|4|0/10
|
||||
1.3.6.1.2.1.47.1.1.1.1.7.13|4|0/11
|
||||
1.3.6.1.2.1.47.1.1.1.1.7.14|4|0/12
|
||||
1.3.6.1.4.1.4526.10.43.1.1.0|2|0
|
||||
1.3.6.1.4.1.4526.10.43.1.2.0|2|90
|
||||
1.3.6.1.4.1.4526.10.43.1.7.1.1.0|2|0
|
||||
1.3.6.1.4.1.4526.10.43.1.7.1.2.0|2|1
|
||||
1.3.6.1.4.1.4526.10.43.1.7.1.3.0|2|2
|
||||
1.3.6.1.4.1.4526.10.43.1.8.1.1.1.0|2|1
|
||||
1.3.6.1.4.1.4526.10.43.1.8.1.2.1.0|2|0
|
||||
1.3.6.1.4.1.4526.10.43.1.8.1.3.1.0|2|1
|
||||
1.3.6.1.4.1.4526.10.43.1.8.1.4.1.0|2|1
|
||||
1.3.6.1.4.1.4526.10.43.1.8.1.5.1.0|2|47
|
Reference in New Issue
Block a user