Skip to content

Commit

Permalink
Added Dahua NVR processor and sensors (#8570)
Browse files Browse the repository at this point in the history
* Added Dahua NVR processor and sensors

* moved cpu

* updated proc data
  • Loading branch information
laf authored and murrant committed Apr 26, 2018
1 parent 0e19747 commit 7b2c1e0
Show file tree
Hide file tree
Showing 5 changed files with 1,232 additions and 4 deletions.
19 changes: 19 additions & 0 deletions includes/definitions/discovery/dahua-nvr.yaml
Original file line number Diff line number Diff line change
@@ -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 }
32 changes: 32 additions & 0 deletions includes/polling/os/dahua-nvr.inc.php
Original file line number Diff line number Diff line change
@@ -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);
Loading

0 comments on commit 7b2c1e0

Please sign in to comment.