Add sensors to Infoblox discovery (nios.yaml) (#11043)

* Update nios.yaml

I tried to pull them all in using {{ index }}, but it didn't actually work.....
This adds the DHCP, DNS and NTP service statuses.

* Dynamic service discovery

* typo

* Create nios_status.snmprec

* Create nios_status.json

* Array

* Typo, more

Co-authored-by: PipoCanaja <38363551+PipoCanaja@users.noreply.github.com>
This commit is contained in:
JohnSPeach
2020-01-23 18:33:41 -05:00
committed by PipoCanaja
parent 68419b1130
commit 2960fc10f5
3 changed files with 398 additions and 1 deletions

View File

@@ -1,6 +1,13 @@
mib: IB-PLATFORMONE-MIB
modules:
sensors:
pre-cache:
data:
-
oid:
- ibServiceName
snmp_flags: ['-OQUsb']
state:
data:
-
@@ -18,4 +25,16 @@ modules:
descr: HA Status
states:
- { value: 1, generic: 0, graph: 1, descr: Active }
- { value: 2, generic: 0, graph: 1, descr: Passive }
- { value: 2, generic: 0, graph: 1, descr: Passive }
-
oid: ibServiceStatus
num_oid: '.1.3.6.1.4.1.7779.3.1.1.2.1.9.1.2.{{ $index }}'
index: 'ibServiceStatus.{{ $index }}'
descr: '{{ $ibServiceName }} Status'
snmp_flags: ['-OQUsbe', '-Pu']
states:
- { value: 1, generic: 0, graph: 0, descr: Working }
- { value: 2, generic: 1, graph: 0, descr: Warning }
- { value: 3, generic: 2, graph: 0, descr: Failed }
- { value: 4, generic: 2, graph: 0, descr: Inactive }
- { value: 5, generic: 3, graph: 0, descr: Unknown }

352
tests/data/nios_status.json Normal file
View File

@@ -0,0 +1,352 @@
{
"os": {
"discovery": {
"devices": [
{
"sysName": "<private>",
"sysObjectID": ".1.3.6.1.4.1.7779.1.1404",
"sysDescr": "Linux dcs-blox01.mountsinai.org 3.14.25 #1 SMP Fri Jan 25 03:42:05 EST 2019 x86_64",
"sysContact": null,
"version": null,
"hardware": null,
"features": null,
"os": "nios",
"type": "appliance",
"serial": null,
"icon": "infoblox.svg",
"location": null
}
]
},
"poller": {
"devices": [
{
"sysName": "<private>",
"sysObjectID": ".1.3.6.1.4.1.7779.1.1404",
"sysDescr": "Linux dcs-blox01.mountsinai.org 3.14.25 #1 SMP Fri Jan 25 03:42:05 EST 2019 x86_64",
"sysContact": "<private>",
"version": null,
"hardware": null,
"features": null,
"os": "nios",
"type": "appliance",
"serial": null,
"icon": "infoblox.svg",
"location": "<private>"
}
]
}
},
"sensors": {
"discovery": {
"sensors": [
{
"sensor_deleted": 0,
"sensor_class": "state",
"poller_type": "snmp",
"sensor_oid": ".1.3.6.1.4.1.7779.3.1.1.2.1.12.0",
"sensor_index": "ibGridStatus.0",
"sensor_type": "ibGridStatus",
"sensor_descr": "Grid Status",
"group": null,
"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": "ibGridStatus"
},
{
"sensor_deleted": 0,
"sensor_class": "state",
"poller_type": "snmp",
"sensor_oid": ".1.3.6.1.4.1.7779.3.1.1.2.1.13.0",
"sensor_index": "ibHaStatus.0",
"sensor_type": "ibHaStatus",
"sensor_descr": "HA Status",
"group": null,
"sensor_divisor": 1,
"sensor_multiplier": 1,
"sensor_current": 1,
"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": "ibHaStatus"
},
{
"sensor_deleted": 0,
"sensor_class": "state",
"poller_type": "snmp",
"sensor_oid": ".1.3.6.1.4.1.7779.3.1.1.2.1.9.1.2.1",
"sensor_index": "ibServiceStatus.1",
"sensor_type": "ibServiceStatus",
"sensor_descr": "dhcp Status",
"group": null,
"sensor_divisor": 1,
"sensor_multiplier": 1,
"sensor_current": 1,
"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": "ibServiceStatus"
},
{
"sensor_deleted": 0,
"sensor_class": "state",
"poller_type": "snmp",
"sensor_oid": ".1.3.6.1.4.1.7779.3.1.1.2.1.9.1.2.2",
"sensor_index": "ibServiceStatus.2",
"sensor_type": "ibServiceStatus",
"sensor_descr": "dns Status",
"group": null,
"sensor_divisor": 1,
"sensor_multiplier": 1,
"sensor_current": 1,
"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": "ibServiceStatus"
},
{
"sensor_deleted": 0,
"sensor_class": "state",
"poller_type": "snmp",
"sensor_oid": ".1.3.6.1.4.1.7779.3.1.1.2.1.9.1.2.3",
"sensor_index": "ibServiceStatus.3",
"sensor_type": "ibServiceStatus",
"sensor_descr": "ntp Status",
"group": null,
"sensor_divisor": 1,
"sensor_multiplier": 1,
"sensor_current": 1,
"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": "ibServiceStatus"
},
{
"sensor_deleted": 0,
"sensor_class": "state",
"poller_type": "snmp",
"sensor_oid": ".1.3.6.1.4.1.7779.3.1.1.2.1.9.1.2.4",
"sensor_index": "ibServiceStatus.4",
"sensor_type": "ibServiceStatus",
"sensor_descr": "tftp Status",
"group": null,
"sensor_divisor": 1,
"sensor_multiplier": 1,
"sensor_current": 4,
"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": "ibServiceStatus"
},
{
"sensor_deleted": 0,
"sensor_class": "state",
"poller_type": "snmp",
"sensor_oid": ".1.3.6.1.4.1.7779.3.1.1.2.1.9.1.2.5",
"sensor_index": "ibServiceStatus.5",
"sensor_type": "ibServiceStatus",
"sensor_descr": "http-file-dist Status",
"group": null,
"sensor_divisor": 1,
"sensor_multiplier": 1,
"sensor_current": 4,
"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": "ibServiceStatus"
},
{
"sensor_deleted": 0,
"sensor_class": "state",
"poller_type": "snmp",
"sensor_oid": ".1.3.6.1.4.1.7779.3.1.1.2.1.9.1.2.6",
"sensor_index": "ibServiceStatus.6",
"sensor_type": "ibServiceStatus",
"sensor_descr": "ftp Status",
"group": null,
"sensor_divisor": 1,
"sensor_multiplier": 1,
"sensor_current": 4,
"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": "ibServiceStatus"
},
{
"sensor_deleted": 0,
"sensor_class": "state",
"poller_type": "snmp",
"sensor_oid": ".1.3.6.1.4.1.7779.3.1.1.2.1.9.1.2.7",
"sensor_index": "ibServiceStatus.7",
"sensor_type": "ibServiceStatus",
"sensor_descr": "bloxtools-move Status",
"group": null,
"sensor_divisor": 1,
"sensor_multiplier": 1,
"sensor_current": 5,
"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": "ibServiceStatus"
},
{
"sensor_deleted": 0,
"sensor_class": "state",
"poller_type": "snmp",
"sensor_oid": ".1.3.6.1.4.1.7779.3.1.1.2.1.9.1.2.8",
"sensor_index": "ibServiceStatus.8",
"sensor_type": "ibServiceStatus",
"sensor_descr": "bloxtools Status",
"group": null,
"sensor_divisor": 1,
"sensor_multiplier": 1,
"sensor_current": 4,
"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": "ibServiceStatus"
}
],
"state_indexes": [
{
"state_name": "ibGridStatus",
"state_descr": "ID Grid Master",
"state_draw_graph": 1,
"state_value": 1,
"state_generic_value": 0
},
{
"state_name": "ibGridStatus",
"state_descr": "ID Grid Member",
"state_draw_graph": 1,
"state_value": 2,
"state_generic_value": 0
},
{
"state_name": "ibHaStatus",
"state_descr": "Active",
"state_draw_graph": 1,
"state_value": 1,
"state_generic_value": 0
},
{
"state_name": "ibHaStatus",
"state_descr": "Passive",
"state_draw_graph": 1,
"state_value": 2,
"state_generic_value": 0
},
{
"state_name": "ibServiceStatus",
"state_descr": "Working",
"state_draw_graph": 0,
"state_value": 1,
"state_generic_value": 0
},
{
"state_name": "ibServiceStatus",
"state_descr": "Warning",
"state_draw_graph": 0,
"state_value": 2,
"state_generic_value": 1
},
{
"state_name": "ibServiceStatus",
"state_descr": "Failed",
"state_draw_graph": 0,
"state_value": 3,
"state_generic_value": 2
},
{
"state_name": "ibServiceStatus",
"state_descr": "Inactive",
"state_draw_graph": 0,
"state_value": 4,
"state_generic_value": 2
},
{
"state_name": "ibServiceStatus",
"state_descr": "Unknown",
"state_draw_graph": 0,
"state_value": 5,
"state_generic_value": 3
}
]
},
"poller": "matches discovery"
}
}

View File

@@ -0,0 +1,26 @@
1.3.6.1.2.1.1.1.0|4|Linux dcs-blox01.mountsinai.org 3.14.25 #1 SMP Fri Jan 25 03:42:05 EST 2019 x86_64
1.3.6.1.2.1.1.2.0|6|1.3.6.1.4.1.7779.1.1404
1.3.6.1.2.1.1.3.0|67|441408898
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.25.1.1.0|67|1045795522
1.3.6.1.4.1.7779.3.1.1.2.1.9.1.1.1|2|1
1.3.6.1.4.1.7779.3.1.1.2.1.9.1.1.2|2|2
1.3.6.1.4.1.7779.3.1.1.2.1.9.1.1.3|2|3
1.3.6.1.4.1.7779.3.1.1.2.1.9.1.1.4|2|4
1.3.6.1.4.1.7779.3.1.1.2.1.9.1.1.5|2|5
1.3.6.1.4.1.7779.3.1.1.2.1.9.1.1.6|2|6
1.3.6.1.4.1.7779.3.1.1.2.1.9.1.1.7|2|7
1.3.6.1.4.1.7779.3.1.1.2.1.9.1.1.8|2|8
1.3.6.1.4.1.7779.3.1.1.2.1.9.1.2.1|2|1
1.3.6.1.4.1.7779.3.1.1.2.1.9.1.2.2|2|1
1.3.6.1.4.1.7779.3.1.1.2.1.9.1.2.3|2|1
1.3.6.1.4.1.7779.3.1.1.2.1.9.1.2.4|2|4
1.3.6.1.4.1.7779.3.1.1.2.1.9.1.2.5|2|4
1.3.6.1.4.1.7779.3.1.1.2.1.9.1.2.6|2|4
1.3.6.1.4.1.7779.3.1.1.2.1.9.1.2.7|2|5
1.3.6.1.4.1.7779.3.1.1.2.1.9.1.2.8|2|4
1.3.6.1.4.1.7779.3.1.1.2.1.12.0|4|ID Grid Member
1.3.6.1.4.1.7779.3.1.1.2.1.13.0|4|Active
1.3.6.1.6.3.10.2.1.3.0|2|4414097