Added Dahua NVR processor and sensors (#8570)

* Added Dahua NVR processor and sensors

* moved cpu

* updated proc data
This commit is contained in:
Neil Lathwood 2018-04-26 14:45:15 +01:00 committed by Tony Murray
parent 0e19747934
commit 7b2c1e0fe4
5 changed files with 1232 additions and 4 deletions

View File

@ -0,0 +1,19 @@
mib: DAHUA-SNMP-MIB
modules:
processors:
data:
-
oid: cpuUsage
num_oid: .1.3.6.1.4.1.1004849.2.1.3.{{ $index }}
descr: CPU Usage
sensors:
state:
data:
-
oid: deviceStatus
num_oid: .1.3.6.1.4.1.1004849.2.1.2.8.
descr: 'Device Status'
index: 'deviceStatus.{{ $index }}'
states:
- { value: 0, descr: Bad, graph: 1, generic: 2 }
- { value: 1, descr: Good, graph: 1, generic: 0 }

View File

@ -0,0 +1,32 @@
<?php
/**
* dahua-nvr.inc.php
*
* Dahua NVR OS polling
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @package LibreNMS
* @link http://librenms.org
* @copyright 2018 Neil Lathwood
* @author Neil Lathwood <gh+n@laf.io>
*/
$dahua_data = snmp_get_multi_oid($device, ['softwareRevision.0', 'serialNumber.0', 'deviceType.0'], '-OUQs', 'DAHUA-SNMP-MIB');
$version = $dahua_data['softwareRevision.0'];
$serial = $dahua_data['serialNumber.0'];
$hardware = $dahua_data['deviceType.0'];
unset($dahua_data);

1108
mibs/dahua/DAHUA-SNMP-MIB Normal file

File diff suppressed because it is too large Load Diff

View File

@ -25,13 +25,13 @@
"sysObjectID": ".1.3.6.1.4.1.1004849.3.2.10",
"sysDescr": "DH-NVR4108HS-8P-4KS2",
"sysContact": "<private>",
"version": null,
"hardware": "",
"version": "3.212.0000.1",
"hardware": "DH-NVR4108HS-8P-4KS2",
"features": null,
"location": "<private>",
"os": "dahua-nvr",
"type": "appliance",
"serial": null,
"serial": "2M00D2APAZTL62J",
"icon": "dahua.png"
}
]
@ -470,5 +470,69 @@
}
]
}
},
"processors": {
"discovery": {
"processors": [
{
"entPhysicalIndex": "0",
"hrDeviceIndex": "0",
"processor_oid": ".1.3.6.1.4.1.1004849.2.1.3.0",
"processor_index": "0",
"processor_type": "dahua-nvr",
"processor_usage": "6",
"processor_descr": "CPU Usage",
"processor_precision": "1",
"processor_perc_warn": "75"
}
]
},
"poller": "matches discovery"
},
"sensors": {
"discovery": {
"sensors": [
{
"sensor_deleted": "0",
"sensor_class": "state",
"poller_type": "snmp",
"sensor_oid": ".1.3.6.1.4.1.1004849.2.1.2.8.0",
"sensor_index": "deviceStatus.0",
"sensor_type": "deviceStatus",
"sensor_descr": "Device Status",
"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": "deviceStatus"
}
],
"state_indexes": [
{
"state_name": "deviceStatus",
"state_descr": "Bad",
"state_draw_graph": "1",
"state_value": "0",
"state_generic_value": "2"
},
{
"state_name": "deviceStatus",
"state_descr": "Good",
"state_draw_graph": "1",
"state_value": "1",
"state_generic_value": "0"
}
]
},
"poller": "matches discovery"
}
}

View File

@ -1,5 +1,5 @@
1.3.6.1.2.1.1.1.0|4|DH-NVR4108HS-8P-4KS2
1.3.6.1.2.1.1.2.0|6|.1.3.6.1.4.1.1004849.3.2.10
1.3.6.1.2.1.1.2.0|6|1.3.6.1.4.1.1004849.3.2.10
1.3.6.1.2.1.1.3.0|67|24641813
1.3.6.1.2.1.1.4.0|4|<private>
1.3.6.1.2.1.1.5.0|4|<private>
@ -48,4 +48,9 @@
1.3.6.1.2.1.2.2.1.21.2|66|0
1.3.6.1.2.1.2.2.1.22.1|6|0.0
1.3.6.1.2.1.2.2.1.22.2|6|0.0
1.3.6.1.4.1.1004849.2.1.1.1.0|4|3.212.0000.1
1.3.6.1.4.1.1004849.2.1.2.4.0|4|2M00D2APAZTL62J
1.3.6.1.4.1.1004849.2.1.2.6.0|4|DH-NVR4108HS-8P-4KS2
1.3.6.1.4.1.1004849.2.1.2.8.0|2|1
1.3.6.1.4.1.1004849.2.1.3.0|2|6
1.3.6.1.6.3.10.2.1.3.0|2|246422