From 8005619e62556fe300e1daf52e5950fee22e2dac Mon Sep 17 00:00:00 2001 From: tomarch Date: Wed, 17 Oct 2018 18:11:02 +0200 Subject: [PATCH] Remove apc-ats os and merge sensors into apc (#9262) * remove_apc-ats * add test data * delete apc-ats.snmprec * add apc_ats variant test file * fix os in json * Updated json test files * Updated json test data --- includes/definitions/apc-ats.yaml | 11 ---- includes/definitions/discovery/apc-ats.yaml | 65 ------------------- includes/definitions/discovery/apc.yaml | 60 +++++++++++++++++ includes/polling/os/apc-ats.inc.php | 10 --- tests/data/apc.json | 40 ++++++++++++ tests/data/{apc-ats.json => apc_ats.json} | 6 +- .../{apc-ats.snmprec => apc_ats.snmprec} | 0 7 files changed, 103 insertions(+), 89 deletions(-) delete mode 100644 includes/definitions/apc-ats.yaml delete mode 100644 includes/definitions/discovery/apc-ats.yaml delete mode 100644 includes/polling/os/apc-ats.inc.php create mode 100644 tests/data/apc.json rename tests/data/{apc-ats.json => apc_ats.json} (99%) rename tests/snmpsim/{apc-ats.snmprec => apc_ats.snmprec} (100%) diff --git a/includes/definitions/apc-ats.yaml b/includes/definitions/apc-ats.yaml deleted file mode 100644 index 9a581fb78d..0000000000 --- a/includes/definitions/apc-ats.yaml +++ /dev/null @@ -1,11 +0,0 @@ -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 \ No newline at end of file diff --git a/includes/definitions/discovery/apc-ats.yaml b/includes/definitions/discovery/apc-ats.yaml deleted file mode 100644 index d2b5e4442c..0000000000 --- a/includes/definitions/discovery/apc-ats.yaml +++ /dev/null @@ -1,65 +0,0 @@ -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 } \ No newline at end of file diff --git a/includes/definitions/discovery/apc.yaml b/includes/definitions/discovery/apc.yaml index d2587835ea..719a692781 100644 --- a/includes/definitions/discovery/apc.yaml +++ b/includes/definitions/discovery/apc.yaml @@ -164,6 +164,66 @@ modules: oid: rPDU2SensorTempHumidityStatusHumidityStatus op: '=' value: 1 + - + 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 } temperature: data: diff --git a/includes/polling/os/apc-ats.inc.php b/includes/polling/os/apc-ats.inc.php deleted file mode 100644 index 6eabf01877..0000000000 --- a/includes/polling/os/apc-ats.inc.php +++ /dev/null @@ -1,10 +0,0 @@ - MD:06/09/2018)", "sysContact": "", "version": "4.1.9", - "hardware": "AP4423", + "hardware": " R01", "features": null, "location": "", - "os": "apc-ats", + "os": "apc", "type": "power", "serial": "", "icon": "apc.svg" diff --git a/tests/snmpsim/apc-ats.snmprec b/tests/snmpsim/apc_ats.snmprec similarity index 100% rename from tests/snmpsim/apc-ats.snmprec rename to tests/snmpsim/apc_ats.snmprec