Skip to content

Commit 54ecfb4

Browse files
authored
Updated docs to reflect use of MIB::OID usage in yaml and code (librenms#19051)
1 parent 6bdc613 commit 54ecfb4

1 file changed

Lines changed: 18 additions & 19 deletions

File tree

doc/Developing/Sensor-State-Support.md

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -72,54 +72,53 @@ generic state (0, 1, 2 or 3).
7272
For YAML based state discovery:
7373

7474
```yaml
75-
mib: NETBOTZV2-MIB
7675
modules:
7776
sensors:
7877
state:
7978
data:
8079
-
81-
oid: dryContactSensorTable
82-
value: dryContactSensorValue
80+
oid: NETBOTZV2-MIB::dryContactSensorTable
81+
value: NETBOTZV2-MIB::dryContactSensorValue
8382
num_oid: '.1.3.6.1.4.1.5528.100.4.2.1.1.2.{{ $index }}'
84-
descr: dryContactSensorLabel
83+
descr: NETBOTZV2-MIB::dryContactSensorLabel
8584
group: Contact Sensors
8685
index: 'dryContactSensor.{{ $index }}'
87-
state_name: dryContactSensor
86+
state_name: NETBOTZV2-MIB::dryContactSensor
8887
states:
8988
- { value: -1, generic: 3, graph: 0, descr: 'null' }
9089
- { value: 0, generic: 0, graph: 0, descr: open }
9190
- { value: 1, generic: 2, graph: 0, descr: closed }
9291
-
93-
oid: doorSwitchSensorTable
94-
value: doorSwitchSensorValue
92+
oid: NETBOTZV2-MIB::doorSwitchSensorTable
93+
value: NETBOTZV2-MIB::doorSwitchSensorValue
9594
num_oid: '.1.3.6.1.4.1.5528.100.4.2.2.1.2.{{ $index }}'
96-
descr: doorSwitchSensorLabel
95+
descr: NETBOTZV2-MIB::doorSwitchSensorLabel
9796
group: Switch Sensors
9897
index: 'doorSwitchSensor.{{ $index }}'
99-
state_name: doorSwitchSensor
98+
state_name: NETBOTZV2-MIB::doorSwitchSensor
10099
states:
101100
- { value: -1, generic: 3, graph: 0, descr: 'null' }
102101
- { value: 0, generic: 0, graph: 0, descr: open }
103102
- { value: 1, generic: 2, graph: 0, descr: closed }
104103
-
105-
oid: cameraMotionSensorTable
106-
value: cameraMotionSensorValue
104+
oid: NETBOTZV2-MIB::cameraMotionSensorTable
105+
value: NETBOTZV2-MIB::cameraMotionSensorValue
107106
num_oid: '.1.3.6.1.4.1.5528.100.4.2.3.1.2.{{ $index }}'
108-
descr: cameraMotionSensorLabel
107+
descr: NETBOTZV2-MIB::cameraMotionSensorLabel
109108
group: Camera Motion Sensors
110109
index: 'cameraMotionSensor.{{ $index }}'
111-
state_name: cameraMotionSensor
110+
state_name: NETBOTZV2-MIB::cameraMotionSensor
112111
states:
113112
- { value: -1, generic: 3, graph: 0, descr: 'null' }
114113
- { value: 0, generic: 0, graph: 0, descr: noMotion }
115114
- { value: 1, generic: 2, graph: 0, descr: motionDetected }
116115
-
117-
oid: otherStateSensorTable
118-
value: otherStateSensorErrorStatus
116+
oid: NETBOTZV2-MIB::otherStateSensorTable
117+
value: NETBOTZV2-MIB::otherStateSensorErrorStatus
119118
num_oid: '.1.3.6.1.4.1.5528.100.4.2.10.1.3.{{ $index }}'
120-
descr: otherStateSensorLabel
119+
descr: NETBOTZV2-MIB::otherStateSensorLabel
121120
index: '{{ $index }}'
122-
state_name: otherStateSensorErrorStatus
121+
state_name: NETBOTZV2-MIB::otherStateSensorErrorStatus
123122
states:
124123
- { value: 0, generic: 0, graph: 0, descr: normal }
125124
- { value: 1, generic: 1, graph: 0, descr: info }
@@ -141,11 +140,11 @@ switches. The file should be located in
141140
```php
142141
<?php
143142

144-
$oids = snmpwalk_group($device, 'ciscoEnvMonSupplyStatusTable', 'CISCO-ENVMON-MIB');
143+
$oids = SnmpQuery::hideMib()->walk('CISCO-ENVMON-MIB::ciscoEnvMonSupplyStatusTable')->valuesByIndex;
145144

146145
if (!empty($oids)) {
147146
//Create State Index
148-
$state_name = 'ciscoEnvMonSupplyState';
147+
$state_name = 'CISCO-ENVMON-MIB::ciscoEnvMonSupplyState';
149148
$states = [
150149
['value' => 1, 'generic' => 0, 'graph' => 0, 'descr' => 'normal'],
151150
['value' => 2, 'generic' => 1, 'graph' => 0, 'descr' => 'warning'],

0 commit comments

Comments
 (0)