Skip to content

Commit

Permalink
Added specific support for APC Automatic Transfer Switch (#9221)
Browse files Browse the repository at this point in the history
DO NOT DELETE THIS TEXT

#### Please note

> Please read this information carefully. You can run `./scripts/pre-commit.php` to check your code before submitting.

- [x] Have you followed our [code guidelines?](http://docs.librenms.org/Developing/Code-Guidelines/)

#### Testers

If you would like to test this pull request then please run: `./scripts/github-apply <pr_id>`, i.e `./scripts/github-apply 5926`
After you are done testing, you can remove the changes with `./scripts/github-remove`.  If there are schema changes, you can ask on discord how to revert.


----------------------------

**APC Automatic Transfer Switch are now detected has generic APC device like a PDU, but the overall information is not the same.**

Long time that I've not added a new device, sorry in advance for the mistakes...

![screen shot 2018-09-18 at 10 02 55](https://user-images.githubusercontent.com/1927109/45676643-7fb30e00-bb32-11e8-82e2-bd08f27b9757.png)
<img width="912" alt="screen shot 2018-09-18 at 10 38 10" src="https://user-images.githubusercontent.com/1927109/45676644-7fb30e00-bb32-11e8-84e9-bab33ccce72a.png">
<img width="899" alt="screen shot 2018-09-18 at 10 40 07" src="https://user-images.githubusercontent.com/1927109/45676645-7fb30e00-bb32-11e8-867e-caa5d731981a.png">
  • Loading branch information
0-skill authored and laf committed Sep 19, 2018
1 parent 2c7a197 commit 2757232
Show file tree
Hide file tree
Showing 5 changed files with 1,086 additions and 0 deletions.
11 changes: 11 additions & 0 deletions includes/definitions/apc-ats.yaml
@@ -0,0 +1,11 @@
os: apc-ats
text: 'APC Automatic Transfer Switch'
type: power
icon: apc
mib_dir:
- apc
over:
- { graph: device_bits, text: 'Device Traffic' }
discovery:
- sysObjectID:
- .1.3.6.1.4.1.318.1.3.32
65 changes: 65 additions & 0 deletions includes/definitions/discovery/apc-ats.yaml
@@ -0,0 +1,65 @@
mib: PowerNet-MIB
modules:
sensors:
state:
data:
-
oid: atsStatusSourceAStatus
value: atsStatusSourceAStatus
state_name: atsStatusSourceAStatus
num_oid: .1.3.6.1.4.1.318.1.1.8.5.1.12.
index: 'atsStatusSourceAStatus.{{ $index }}'
descr: Source A Status
states:
- { descr: Fail, graph: 0, value: 1, generic: 2 }
- { descr: OK, graph: 0, value: 2, generic: 0 }
-
oid: atsStatusSourceBStatus
value: atsStatusSourceBStatus
state_name: atsStatusSourceBStatus
num_oid: .1.3.6.1.4.1.318.1.1.8.5.1.13.
index: 'atsStatusSourceBStatus.{{ $index }}'
descr: Source B Status
states:
- { descr: Fail, graph: 0, value: 1, generic: 2 }
- { descr: OK, graph: 0, value: 2, generic: 0 }
-
oid: atsStatusSwitchStatus
value: atsStatusSwitchStatus
state_name: atsStatusSwitchStatus
num_oid: .1.3.6.1.4.1.318.1.1.8.5.1.10.
index: 'atsStatusSwitchStatus.{{ $index }}'
descr: Global Switch Status
states:
- { descr: Fail, graph: 0, value: 1, generic: 2 }
- { descr: OK, graph: 0, value: 2, generic: 0 }
-
oid: atsStatusSelectedSource
value: atsStatusSelectedSource
state_name: atsStatusSelectedSource
num_oid: .1.3.6.1.4.1.318.1.1.8.5.1.2.
index: 'atsStatusSelectedSource.{{ $index }}'
descr: Selected Source
states:
- { descr: Source A, graph: 0, value: 1, generic: 3 }
- { descr: Source B, graph: 0, value: 2, generic: 3 }
-
oid: atsStatusRedundancyState
value: atsStatusRedundancyState
state_name: atsStatusRedundancyState
num_oid: .1.3.6.1.4.1.318.1.1.8.5.1.3.
index: 'atsStatusRedundancyState.{{ $index }}'
descr: Redundancy State
states:
- { descr: Redundancy Lost, graph: 0, value: 1, generic: 2 }
- { descr: Fully Redundant, graph: 0, value: 2, generic: 0 }
-
oid: atsStatusPhaseSyncStatus
value: atsStatusPhaseSyncStatus
state_name: atsStatusPhaseSyncStatus
num_oid: .1.3.6.1.4.1.318.1.1.8.5.1.14.
index: 'atsStatusPhaseSyncStatus.{{ $index }}'
descr: Phase Sync Status
states:
- { descr: In Sync, graph: 0, value: 1, generic: 0 }
- { descr: Out Of Sync, graph: 0, value: 2, generic: 2 }
10 changes: 10 additions & 0 deletions includes/polling/os/apc-ats.inc.php
@@ -0,0 +1,10 @@
<?php

$oids = 'atsIdentSerialNumber.0 atsIdentModelNumber.0 atsIdentFirmwareRev.0';

$data = snmp_get_multi($device, $oids, '-OQUs', 'PowerNet-MIB');
d_echo($data);

$version = $data[0]['atsIdentFirmwareRev'];
$hardware = $data[0]['atsIdentModelNumber'];
$serial = $data[0]['atsIdentSerialNumber'];

0 comments on commit 2757232

Please sign in to comment.