diff options
author | Vyacheslav Khaliev <vyacheslav.khaliev@zabbix.com> | 2022-04-29 14:08:54 +0300 |
---|---|---|
committer | Vyacheslav Khaliev <vyacheslav.khaliev@zabbix.com> | 2022-04-29 14:08:54 +0300 |
commit | 0db7326d3a6a4a07d48b46fae3a2b6238751ecbb (patch) | |
tree | f65deb53b0175d1725572646fa5b45125a897dc8 /templates/san | |
parent | 886fd7fac3d2b1f8b8ca22731683ce0b25372821 (diff) |
.........T [ZBXNEXT-7632] fixed unsupported items in HPE Primera template
Diffstat (limited to 'templates/san')
-rw-r--r-- | templates/san/hpe_primera_http/README.md | 12 | ||||
-rw-r--r-- | templates/san/hpe_primera_http/template_san_hpe_primera_http.yaml | 259 |
2 files changed, 121 insertions, 150 deletions
diff --git a/templates/san/hpe_primera_http/README.md b/templates/san/hpe_primera_http/README.md index db461267a9f..b5a4d7da323 100644 --- a/templates/san/hpe_primera_http/README.md +++ b/templates/san/hpe_primera_http/README.md @@ -77,8 +77,7 @@ There are no template links in this template. |HPE |HPE Primera: Total capacity |<p>Total capacity in the system.</p> |DEPENDENT |hpe.primera.system.total.capacity<p>**Preprocessing**:</p><p>- JSONPATH: `$.totalCapacityMiB`</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `1h`</p><p>- MULTIPLIER: `1048576`</p> | |HPE |HPE Primera: Total nodes |<p>Total number of nodes in the system.</p> |DEPENDENT |hpe.primera.system.total.nodes<p>**Preprocessing**:</p><p>- JSONPATH: `$.totalNodes`</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `1h`</p> | |HPE |HPE Primera: Online nodes count |<p>Number of online nodes in the system.</p> |DEPENDENT |hpe.primera.system.online.nodes<p>**Preprocessing**:</p><p>- JSONPATH: `$.onlineNodes`</p><p>- JAVASCRIPT: `return value.length`</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `1h`</p> | -|HPE |HPE Primera: Disks total |<p>Number of physical disks.</p> |DEPENDENT |hpe.primera.disks.total<p>**Preprocessing**:</p><p>- JSONPATH: `$.total`</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `1h`</p> | -|HPE |CPG [{#NAME}]: Additional State |<p>Detailed state of the CPG:</p><p>LDS_NOT_STARTED (1) - LDs not started.</p><p>NOT_STARTED (2) - VV not started.</p><p>NEEDS_CHECK (3) - Check for consistency.</p><p>NEEDS_MAINT_CHECK (4) - Maintenance check is required.</p><p>INTERNAL_CONSISTENCY_ERROR (5) - Internal consistency error.</p><p>SNAPDATA_INVALID (6) - Invalid snapshot data.</p><p>PRESERVED (7) - Unavailable LD sets due to missing chunklets. Preserved remaining VV data.</p><p>STALE (8) - Parts of the VV contain old data because of a copy-on-write operation.</p><p>COPY_FAILED (9) - A promote or copy operation to this volume failed.</p><p>DEGRADED_AVAIL (10) - Degraded due to availability.</p><p>DEGRADED_PERF (11) - Degraded due to performance.</p><p>PROMOTING (12) - Volume is the current target of a promote operation.</p><p>COPY_TARGET (13) - Volume is the current target of a physical copy operation.</p><p>RESYNC_TARGET (14) - Volume is the current target of a resynchronized copy operation.</p><p>TUNING (15) - Volume tuning is in progress.</p><p>CLOSING (16) - Volume is closing.</p><p>REMOVING (17) - Removing the volume.</p><p>REMOVING_RETRY (18) - Retrying a volume removal operation.</p><p>CREATING (19) - Creating a volume.</p><p>COPY_SOURCE (20) - Copy source.</p><p>IMPORTING (21) - Importing a volume.</p><p>CONVERTING (22) - Converting a volume.</p><p>INVALID (23) - Invalid.</p><p>EXCLUSIVE (24) - Local storage system has exclusive access to the volume.</p><p>CONSISTENT (25) - Volume is being imported consistently along with other volumes in the VV set.</p><p>STANDBY (26) - Volume in Standby mode.</p><p>SD_META_INCONSISTENT (27) - SD Meta Inconsistent.</p><p>SD_NEEDS_FIX (28) - SD needs fix.</p><p>SD_META_FIXING (29) - SD meta fix.</p><p>UNKNOWN (999) - Unknown state.</p><p>NOT_SUPPORTED_BY_WSAPI (1000) - State not supported by WSAPI.</p> |DEPENDENT |hpe.primera.cpg.additional.states["{#NAME}"]<p>**Preprocessing**:</p><p>- JSONPATH: `$[?(@.name == "{#NAME}")].additionalStates.first()`</p><p>- JAVASCRIPT: `return JSON.stringify(JSON.parse(value));`</p> | +|HPE |HPE Primera: Disks total |<p>Number of physical disks.</p> |SCRIPT |hpe.primera.disks.total<p>**Preprocessing**:</p><p>- JSONPATH: `$.total`</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `1h`</p><p>**Expression**:</p>`The text is too long. Please see the template.` | |HPE |CPG [{#NAME}]: Degraded State |<p>Detailed state of the CPG:</p><p>LDS_NOT_STARTED (1) - LDs not started.</p><p>NOT_STARTED (2) - VV not started.</p><p>NEEDS_CHECK (3) - Check for consistency.</p><p>NEEDS_MAINT_CHECK (4) - Maintenance check is required.</p><p>INTERNAL_CONSISTENCY_ERROR (5) - Internal consistency error.</p><p>SNAPDATA_INVALID (6) - Invalid snapshot data.</p><p>PRESERVED (7) - Unavailable LD sets due to missing chunklets. Preserved remaining VV data.</p><p>STALE (8) - Parts of the VV contain old data because of a copy-on-write operation.</p><p>COPY_FAILED (9) - A promote or copy operation to this volume failed.</p><p>DEGRADED_AVAIL (10) - Degraded due to availability.</p><p>DEGRADED_PERF (11) - Degraded due to performance.</p><p>PROMOTING (12) - Volume is the current target of a promote operation.</p><p>COPY_TARGET (13) - Volume is the current target of a physical copy operation.</p><p>RESYNC_TARGET (14) - Volume is the current target of a resynchronized copy operation.</p><p>TUNING (15) - Volume tuning is in progress.</p><p>CLOSING (16) - Volume is closing.</p><p>REMOVING (17) - Removing the volume.</p><p>REMOVING_RETRY (18) - Retrying a volume removal operation.</p><p>CREATING (19) - Creating a volume.</p><p>COPY_SOURCE (20) - Copy source.</p><p>IMPORTING (21) - Importing a volume.</p><p>CONVERTING (22) - Converting a volume.</p><p>INVALID (23) - Invalid.</p><p>EXCLUSIVE (24) - Local storage system has exclusive access to the volume.</p><p>CONSISTENT (25) - Volume is being imported consistently along with other volumes in the VV set.</p><p>STANDBY (26) - Volume in Standby mode.</p><p>SD_META_INCONSISTENT (27) - SD Meta Inconsistent.</p><p>SD_NEEDS_FIX (28) - SD needs fix.</p><p>SD_META_FIXING (29) - SD meta fix.</p><p>UNKNOWN (999) - Unknown state.</p><p>NOT_SUPPORTED_BY_WSAPI (1000) - State not supported by WSAPI.</p> |DEPENDENT |hpe.primera.cpg.degraded.states["{#NAME}"]<p>**Preprocessing**:</p><p>- JSONPATH: `$[?(@.name == "{#NAME}")].degradedStates.first()`</p><p>- JAVASCRIPT: `return JSON.stringify(JSON.parse(value));`</p> | |HPE |CPG [{#NAME}]: Failed State |<p>Detailed state of the CPG:</p><p>LDS_NOT_STARTED (1) - LDs not started.</p><p>NOT_STARTED (2) - VV not started.</p><p>NEEDS_CHECK (3) - Check for consistency.</p><p>NEEDS_MAINT_CHECK (4) - Maintenance check is required.</p><p>INTERNAL_CONSISTENCY_ERROR (5) - Internal consistency error.</p><p>SNAPDATA_INVALID (6) - Invalid snapshot data.</p><p>PRESERVED (7) - Unavailable LD sets due to missing chunklets. Preserved remaining VV data.</p><p>STALE (8) - Parts of the VV contain old data because of a copy-on-write operation.</p><p>COPY_FAILED (9) - A promote or copy operation to this volume failed.</p><p>DEGRADED_AVAIL (10) - Degraded due to availability.</p><p>DEGRADED_PERF (11) - Degraded due to performance.</p><p>PROMOTING (12) - Volume is the current target of a promote operation.</p><p>COPY_TARGET (13) - Volume is the current target of a physical copy operation.</p><p>RESYNC_TARGET (14) - Volume is the current target of a resynchronized copy operation.</p><p>TUNING (15) - Volume tuning is in progress.</p><p>CLOSING (16) - Volume is closing.</p><p>REMOVING (17) - Removing the volume.</p><p>REMOVING_RETRY (18) - Retrying a volume removal operation.</p><p>CREATING (19) - Creating a volume.</p><p>COPY_SOURCE (20) - Copy source.</p><p>IMPORTING (21) - Importing a volume.</p><p>CONVERTING (22) - Converting a volume.</p><p>INVALID (23) - Invalid.</p><p>EXCLUSIVE (24) - Local storage system has exclusive access to the volume.</p><p>CONSISTENT (25) - Volume is being imported consistently along with other volumes in the VV set.</p><p>STANDBY (26) - Volume in Standby mode.</p><p>SD_META_INCONSISTENT (27) - SD Meta Inconsistent.</p><p>SD_NEEDS_FIX (28) - SD needs fix.</p><p>SD_META_FIXING (29) - SD meta fix.</p><p>UNKNOWN (999) - Unknown state.</p><p>NOT_SUPPORTED_BY_WSAPI (1000) - State not supported by WSAPI.</p> |DEPENDENT |hpe.primera.cpg.failed.states["{#NAME}"]<p>**Preprocessing**:</p><p>- JSONPATH: `$[?(@.name == "{#NAME}")].failedStates.first()`</p><p>- JAVASCRIPT: `return JSON.stringify(JSON.parse(value));`</p> | |HPE |CPG [{#NAME}]: Free CPG space |<p>Free CPG space.</p> |DEPENDENT |hpe.primera.cpg.free.space["{#NAME}"]<p>**Preprocessing**:</p><p>- JSONPATH: `$[?(@.name == "{#NAME}")].freeSpaceMiB.first()`</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `10m`</p><p>- MULTIPLIER: `1048576`</p> | @@ -107,10 +106,10 @@ There are no template links in this template. |HPE |Disk [{#POSITION}]: Free size |<p>Physical disk free size.</p> |DEPENDENT |hpe.primera.disk.free.size["{#POSITION}"]<p>**Preprocessing**:</p><p>- JSONPATH: `$[?(@.position == "{#POSITION}")].freeSizeMiB.first()`</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `1h`</p><p>- MULTIPLIER: `1048576`</p> | |HPE |Disk [{#POSITION}]: Manufacturer |<p>Physical disk manufacturer.</p> |DEPENDENT |hpe.primera.disk.manufacturer["{#POSITION}"]<p>**Preprocessing**:</p><p>- JSONPATH: `$[?(@.position == "{#POSITION}")].manufacturer.first()`</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `1d`</p> | |HPE |Disk [{#POSITION}]: Model |<p>Manufacturer's device ID for disk.</p> |DEPENDENT |hpe.primera.disk.model["{#POSITION}"]<p>**Preprocessing**:</p><p>- JSONPATH: `$[?(@.position == "{#POSITION}")].model.first()`</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `1d`</p> | -|HPE |Disk [{#POSITION}]: Path A0 Degraded |<p>Indicates if this is a degraded path for the disk.</p> |DEPENDENT |hpe.primera.disk.loop.a0.degraded["{#POSITION}"]<p>**Preprocessing**:</p><p>- JSONPATH: `$[?(@.position == "{#POSITION}")].loopA0.degraded.first()`</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `10m`</p> | -|HPE |Disk [{#POSITION}]: Path A1 Degraded |<p>Indicates if this is a degraded path for the disk.</p> |DEPENDENT |hpe.primera.disk.loop.a1.degraded["{#POSITION}"]<p>**Preprocessing**:</p><p>- JSONPATH: `$[?(@.position == "{#POSITION}")].loopA1.degraded.first()`</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `10m`</p> | -|HPE |Disk [{#POSITION}]: Path B0 Degraded |<p>Indicates if this is a degraded path for the disk.</p> |DEPENDENT |hpe.primera.disk.loop.b0.degraded["{#POSITION}"]<p>**Preprocessing**:</p><p>- JSONPATH: `$[?(@.position == "{#POSITION}")].loopB0.degraded.first()`</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `10m`</p> | -|HPE |Disk [{#POSITION}]: Path B1 Degraded |<p>Indicates if this is a degraded path for the disk.</p> |DEPENDENT |hpe.primera.disk.loop.b1.degraded["{#POSITION}"]<p>**Preprocessing**:</p><p>- JSONPATH: `$[?(@.position == "{#POSITION}")].loopB1.degraded.first()`</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `10m`</p> | +|HPE |Disk [{#POSITION}]: Path A0 Degraded |<p>Indicates if this is a degraded path for the disk.</p> |DEPENDENT |hpe.primera.disk.loop.a0.degraded["{#POSITION}"]<p>**Preprocessing**:</p><p>- JSONPATH: `$[?(@.position == "{#POSITION}")].loopA0.degraded.first()`</p><p>⛔️ON_FAIL: `DISCARD_VALUE -> `</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `10m`</p><p>- BOOL_TO_DECIMAL</p> | +|HPE |Disk [{#POSITION}]: Path A1 Degraded |<p>Indicates if this is a degraded path for the disk.</p> |DEPENDENT |hpe.primera.disk.loop.a1.degraded["{#POSITION}"]<p>**Preprocessing**:</p><p>- JSONPATH: `$[?(@.position == "{#POSITION}")].loopA1.degraded.first()`</p><p>⛔️ON_FAIL: `DISCARD_VALUE -> `</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `10m`</p><p>- BOOL_TO_DECIMAL</p> | +|HPE |Disk [{#POSITION}]: Path B0 Degraded |<p>Indicates if this is a degraded path for the disk.</p> |DEPENDENT |hpe.primera.disk.loop.b0.degraded["{#POSITION}"]<p>**Preprocessing**:</p><p>- JSONPATH: `$[?(@.position == "{#POSITION}")].loopB0.degraded.first()`</p><p>⛔️ON_FAIL: `DISCARD_VALUE -> `</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `10m`</p><p>- BOOL_TO_DECIMAL</p> | +|HPE |Disk [{#POSITION}]: Path B1 Degraded |<p>Indicates if this is a degraded path for the disk.</p> |DEPENDENT |hpe.primera.disk.loop.b1.degraded["{#POSITION}"]<p>**Preprocessing**:</p><p>- JSONPATH: `$[?(@.position == "{#POSITION}")].loopB1.degraded.first()`</p><p>⛔️ON_FAIL: `DISCARD_VALUE -> `</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `10m`</p><p>- BOOL_TO_DECIMAL</p> | |HPE |Disk [{#POSITION}]: RPM |<p>RPM of the physical disk.</p> |DEPENDENT |hpe.primera.disk.rpm["{#POSITION}"]<p>**Preprocessing**:</p><p>- JSONPATH: `$[?(@.position == "{#POSITION}")].RPM.first()`</p><p>⛔️ON_FAIL: `DISCARD_VALUE -> `</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `1h`</p> | |HPE |Disk [{#POSITION}]: Serial Number |<p>Disk drive serial number.</p> |DEPENDENT |hpe.primera.disk.serial.number["{#POSITION}"]<p>**Preprocessing**:</p><p>- JSONPATH: `$[?(@.position == "{#POSITION}")].serialNumber.first()`</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `1d`</p> | |HPE |Disk [{#POSITION}]: State |<p>State of the physical disk:</p><p>Normal (1) - Physical disk is in Normal state;</p><p>Degraded (2) - Physical disk is not operating normally;</p><p>New (3) - Physical disk is new, needs to be admitted;</p><p>Failed (4) - Physical disk has failed;</p><p>Unknown (99) - Physical disk state is unknown.</p> |DEPENDENT |hpe.primera.disk.state["{#POSITION}"]<p>**Preprocessing**:</p><p>- JSONPATH: `$[?(@.position == "{#POSITION}")].state.first()`</p><p>⛔️ON_FAIL: `CUSTOM_VALUE -> 99`</p> | @@ -128,7 +127,6 @@ There are no template links in this template. |HPE |Task [{#NAME}]: Finish Time |<p>Task finish time.</p> |DEPENDENT |hpe.primera.task.finish.time["{#NAME}"]<p>**Preprocessing**:</p><p>- JSONPATH: `$[?(@.name == "{#NAME}")].finishTime.first()`</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `6h`</p><p>- NOT_MATCHES_REGEX: `^-$`</p><p>⛔️ON_FAIL: `DISCARD_VALUE -> `</p><p>- JAVASCRIPT: `The text is too long. Please see the template.`</p> | |HPE |Task [{#NAME}]: Start Time |<p>Task start time.</p> |DEPENDENT |hpe.primera.task.start.time["{#NAME}"]<p>**Preprocessing**:</p><p>- JSONPATH: `$[?(@.name == "{#NAME}")].startTime.first()`</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `6h`</p><p>- JAVASCRIPT: `The text is too long. Please see the template.`</p> | |HPE |Task [{#NAME}]: Status |<p>Task status:</p><p>DONE (1) - Task is finished;</p><p>ACTIVE (2) - Task is in progress;</p><p>CANCELLED (3) - Task is canceled;</p><p>FAILED (4) - Task failed.</p> |DEPENDENT |hpe.primera.task.status["{#NAME}"]<p>**Preprocessing**:</p><p>- JSONPATH: `$[?(@.name == "{#NAME}")].status.first()`</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `10m`</p> | -|HPE |Volume [{#NAME}]: Additional State |<p>Detailed state of the VV:</p><p>LDS_NOT_STARTED (1) - LDs not started.</p><p>NOT_STARTED (2) - VV not started.</p><p>NEEDS_CHECK (3) - Check for consistency.</p><p>NEEDS_MAINT_CHECK (4) - Maintenance check is required.</p><p>INTERNAL_CONSISTENCY_ERROR (5) - Internal consistency error.</p><p>SNAPDATA_INVALID (6) - Invalid snapshot data.</p><p>PRESERVED (7) - Unavailable LD sets due to missing chunklets. Preserved remaining VV data.</p><p>STALE (8) - Parts of the VV contain old data because of a copy-on-write operation.</p><p>COPY_FAILED (9) - A promote or copy operation to this volume failed.</p><p>DEGRADED_AVAIL (10) - Degraded due to availability.</p><p>DEGRADED_PERF (11) - Degraded due to performance.</p><p>PROMOTING (12) - Volume is the current target of a promote operation.</p><p>COPY_TARGET (13) - Volume is the current target of a physical copy operation.</p><p>RESYNC_TARGET (14) - Volume is the current target of a resynchronized copy operation.</p><p>TUNING (15) - Volume tuning is in progress.</p><p>CLOSING (16) - Volume is closing.</p><p>REMOVING (17) - Removing the volume.</p><p>REMOVING_RETRY (18) - Retrying a volume removal operation.</p><p>CREATING (19) - Creating a volume.</p><p>COPY_SOURCE (20) - Copy source.</p><p>IMPORTING (21) - Importing a volume.</p><p>CONVERTING (22) - Converting a volume.</p><p>INVALID (23) - Invalid.</p><p>EXCLUSIVE (24) - Local storage system has exclusive access to the volume.</p><p>CONSISTENT (25) - Volume is being imported consistently along with other volumes in the VV set.</p><p>STANDBY (26) - Volume in Standby mode.</p><p>SD_META_INCONSISTENT (27) - SD Meta Inconsistent.</p><p>SD_NEEDS_FIX (28) - SD needs fix.</p><p>SD_META_FIXING (29) - SD meta fix.</p><p>UNKNOWN (999) - Unknown state.</p><p>NOT_SUPPORTED_BY_WSAPI (1000) - State not supported by WSAPI.</p> |DEPENDENT |hpe.primera.volume.additional.states["{#NAME}"]<p>**Preprocessing**:</p><p>- JSONPATH: `$[?(@.name == "{#NAME}")].additionalStates.first()`</p><p>- JAVASCRIPT: `return JSON.stringify(JSON.parse(value));`</p> | |HPE |Volume [{#NAME}]: Administrative Free space |<p>Administrative space. Free space.</p> |DEPENDENT |hpe.primera.volume.admin.free.space["{#NAME}"]<p>**Preprocessing**:</p><p>- JSONPATH: `$[?(@.name == "{#NAME}")].adminSpace.freeMiB.first()`</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `1h`</p><p>- MULTIPLIER: `1048576`</p> | |HPE |Volume [{#NAME}]: Administrative Raw reserved space |<p>Administrative space. Raw reserved space.</p> |DEPENDENT |hpe.primera.volume.admin.raw.reserved.space["{#NAME}"]<p>**Preprocessing**:</p><p>- JSONPATH: `$[?(@.name == "{#NAME}")].adminSpace.rawReservedMiB.first()`</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `12h`</p><p>- MULTIPLIER: `1048576`</p> | |HPE |Volume [{#NAME}]: Administrative reserved space |<p>Administrative space. Reserved space.</p> |DEPENDENT |hpe.primera.volume.admin.reserved.space["{#NAME}"]<p>**Preprocessing**:</p><p>- JSONPATH: `$[?(@.name == "{#NAME}")].adminSpace.reservedMiB.first()`</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `12h`</p><p>- MULTIPLIER: `1048576`</p> | diff --git a/templates/san/hpe_primera_http/template_san_hpe_primera_http.yaml b/templates/san/hpe_primera_http/template_san_hpe_primera_http.yaml index e6155ebb5ac..34ae84ada67 100644 --- a/templates/san/hpe_primera_http/template_san_hpe_primera_http.yaml +++ b/templates/san/hpe_primera_http/template_san_hpe_primera_http.yaml @@ -1,6 +1,6 @@ zabbix_export: version: '6.0' - date: '2022-04-29T08:17:48Z' + date: '2022-04-29T11:03:02Z' groups: - uuid: 7c2cb727f85b492d88cd56e17127c64d @@ -224,10 +224,73 @@ zabbix_export: - uuid: d5b8a74991d34652973a78d58203d5fd name: 'HPE Primera: Disks total' - type: DEPENDENT + type: SCRIPT key: hpe.primera.disks.total - delay: '0' + delay: 10m history: 7d + params: | + var params = JSON.parse(value); + var fields = ['username', 'password', 'method', 'base_url']; + var result = {}; + + fields.forEach(function (field) { + if (typeof params !== 'object' || typeof params[field] === 'undefined' || params[field] === '' ) { + throw 'Required param is not set: "' + field + '".'; + } + }); + + if (!params.base_url.endsWith('/')) { + params.base_url += '/'; + } + + var response, request = new HttpRequest(); + request.addHeader('Content-Type: application/json'); + + credentials = {'user' : params.username, 'password' : params.password}; + + response = request.post(params.base_url + 'api/v1/credentials', JSON.stringify(credentials)); + + if (request.getStatus() < 200 || request.getStatus() >= 300) { + throw 'Auth request failed with status code ' + request.getStatus() + ': ' + response; + } + + if (response !== null) { + try { + auth_data = JSON.parse(response); + } + catch (error) { + throw 'Failed to parse auth response received from device API. Check debug log for more information.'; + } + } + + sessionKey = auth_data['key']; + + request = new HttpRequest(); + request.addHeader('X-HP3PAR-WSAPI-SessionKey: ' + sessionKey); + + data = request.get(params.base_url + 'api/v1/' + params.method); + + if (request.getStatus() < 200 || request.getStatus() >= 300) { + throw 'Request failed with status code ' + request.getStatus() + ': ' + response; + } + + if (data !== null) { + try { + result = JSON.stringify(data); + } + catch (error) { + throw 'Failed to parse response received from device API. Check debug log for more information.'; + } + } + + request = new HttpRequest(); + response = request.delete(params.base_url + 'api/v1/credentials/' + sessionKey) + + if (request.getStatus() !== 200) { + throw 'Logout request failed with status code ' + request.getStatus() + ': ' + response; + } + + return data; description: 'Number of physical disks.' preprocessing: - @@ -238,8 +301,20 @@ zabbix_export: type: DISCARD_UNCHANGED_HEARTBEAT parameters: - 1h - master_item: - key: hpe.primera.disks + timeout: '{$HPE.PRIMERA.DATA.TIMEOUT}' + parameters: + - + name: base_url + value: 'https://{HOST.CONN}' + - + name: method + value: disks + - + name: password + value: '{$HPE.PRIMERA.PASSWORD}' + - + name: username + value: '{$HPE.PRIMERA.USERNAME}' tags: - tag: component @@ -1148,72 +1223,6 @@ zabbix_export: description: 'List of CPGs resources.' item_prototypes: - - uuid: ae3e249556334ab49ed126f854e65386 - name: 'CPG [{#NAME}]: Additional State' - type: DEPENDENT - key: 'hpe.primera.cpg.additional.states["{#NAME}"]' - delay: '0' - history: 7d - trends: '0' - value_type: CHAR - description: | - Detailed state of the CPG: - - LDS_NOT_STARTED (1) - LDs not started. - NOT_STARTED (2) - VV not started. - NEEDS_CHECK (3) - Check for consistency. - NEEDS_MAINT_CHECK (4) - Maintenance check is required. - INTERNAL_CONSISTENCY_ERROR (5) - Internal consistency error. - SNAPDATA_INVALID (6) - Invalid snapshot data. - PRESERVED (7) - Unavailable LD sets due to missing chunklets. Preserved remaining VV data. - STALE (8) - Parts of the VV contain old data because of a copy-on-write operation. - COPY_FAILED (9) - A promote or copy operation to this volume failed. - DEGRADED_AVAIL (10) - Degraded due to availability. - DEGRADED_PERF (11) - Degraded due to performance. - PROMOTING (12) - Volume is the current target of a promote operation. - COPY_TARGET (13) - Volume is the current target of a physical copy operation. - RESYNC_TARGET (14) - Volume is the current target of a resynchronized copy operation. - TUNING (15) - Volume tuning is in progress. - CLOSING (16) - Volume is closing. - REMOVING (17) - Removing the volume. - REMOVING_RETRY (18) - Retrying a volume removal operation. - CREATING (19) - Creating a volume. - COPY_SOURCE (20) - Copy source. - IMPORTING (21) - Importing a volume. - CONVERTING (22) - Converting a volume. - INVALID (23) - Invalid. - EXCLUSIVE (24) - Local storage system has exclusive access to the volume. - CONSISTENT (25) - Volume is being imported consistently along with other volumes in the VV set. - STANDBY (26) - Volume in Standby mode. - SD_META_INCONSISTENT (27) - SD Meta Inconsistent. - SD_NEEDS_FIX (28) - SD needs fix. - SD_META_FIXING (29) - SD meta fix. - UNKNOWN (999) - Unknown state. - NOT_SUPPORTED_BY_WSAPI (1000) - State not supported by WSAPI. - valuemap: - name: 'Primera: Volume detailed state enum' - preprocessing: - - - type: JSONPATH - parameters: - - '$[?(@.name == "{#NAME}")].additionalStates.first()' - - - type: JAVASCRIPT - parameters: - - 'return JSON.stringify(JSON.parse(value));' - master_item: - key: hpe.primera.cpgs - tags: - - - tag: component - value: cpg - - - tag: component - value: storage - - - tag: cpg - value: '{#NAME}' - - uuid: a7e2188d600a4715a58deba46f3b46ac name: 'CPG [{#NAME}]: Degraded State' type: DEPENDENT @@ -2285,10 +2294,15 @@ zabbix_export: type: JSONPATH parameters: - '$[?(@.position == "{#POSITION}")].loopA0.degraded.first()' + error_handler: DISCARD_VALUE - type: DISCARD_UNCHANGED_HEARTBEAT parameters: - 10m + - + type: BOOL_TO_DECIMAL + parameters: + - '' master_item: key: hpe.primera.disks tags: @@ -2308,18 +2322,23 @@ zabbix_export: key: 'hpe.primera.disk.loop.a1.degraded["{#POSITION}"]' delay: '0' history: 7d - trends: '0' - value_type: CHAR description: 'Indicates if this is a degraded path for the disk.' + valuemap: + name: 'Primera: Boolean' preprocessing: - type: JSONPATH parameters: - '$[?(@.position == "{#POSITION}")].loopA1.degraded.first()' + error_handler: DISCARD_VALUE - type: DISCARD_UNCHANGED_HEARTBEAT parameters: - 10m + - + type: BOOL_TO_DECIMAL + parameters: + - '' master_item: key: hpe.primera.disks tags: @@ -2339,18 +2358,23 @@ zabbix_export: key: 'hpe.primera.disk.loop.b0.degraded["{#POSITION}"]' delay: '0' history: 7d - trends: '0' - value_type: CHAR description: 'Indicates if this is a degraded path for the disk.' + valuemap: + name: 'Primera: Boolean' preprocessing: - type: JSONPATH parameters: - '$[?(@.position == "{#POSITION}")].loopB0.degraded.first()' + error_handler: DISCARD_VALUE - type: DISCARD_UNCHANGED_HEARTBEAT parameters: - 10m + - + type: BOOL_TO_DECIMAL + parameters: + - '' master_item: key: hpe.primera.disks tags: @@ -2370,18 +2394,23 @@ zabbix_export: key: 'hpe.primera.disk.loop.b1.degraded["{#POSITION}"]' delay: '0' history: 7d - trends: '0' - value_type: CHAR description: 'Indicates if this is a degraded path for the disk.' + valuemap: + name: 'Primera: Boolean' preprocessing: - type: JSONPATH parameters: - '$[?(@.position == "{#POSITION}")].loopB1.degraded.first()' + error_handler: DISCARD_VALUE - type: DISCARD_UNCHANGED_HEARTBEAT parameters: - 10m + - + type: BOOL_TO_DECIMAL + parameters: + - '' master_item: key: hpe.primera.disks tags: @@ -3256,72 +3285,6 @@ zabbix_export: description: 'List of storage volume resources.' item_prototypes: - - uuid: 35457814e61a432c95820d38607b402f - name: 'Volume [{#NAME}]: Additional State' - type: DEPENDENT - key: 'hpe.primera.volume.additional.states["{#NAME}"]' - delay: '0' - history: 7d - trends: '0' - value_type: CHAR - description: | - Detailed state of the VV: - - LDS_NOT_STARTED (1) - LDs not started. - NOT_STARTED (2) - VV not started. - NEEDS_CHECK (3) - Check for consistency. - NEEDS_MAINT_CHECK (4) - Maintenance check is required. - INTERNAL_CONSISTENCY_ERROR (5) - Internal consistency error. - SNAPDATA_INVALID (6) - Invalid snapshot data. - PRESERVED (7) - Unavailable LD sets due to missing chunklets. Preserved remaining VV data. - STALE (8) - Parts of the VV contain old data because of a copy-on-write operation. - COPY_FAILED (9) - A promote or copy operation to this volume failed. - DEGRADED_AVAIL (10) - Degraded due to availability. - DEGRADED_PERF (11) - Degraded due to performance. - PROMOTING (12) - Volume is the current target of a promote operation. - COPY_TARGET (13) - Volume is the current target of a physical copy operation. - RESYNC_TARGET (14) - Volume is the current target of a resynchronized copy operation. - TUNING (15) - Volume tuning is in progress. - CLOSING (16) - Volume is closing. - REMOVING (17) - Removing the volume. - REMOVING_RETRY (18) - Retrying a volume removal operation. - CREATING (19) - Creating a volume. - COPY_SOURCE (20) - Copy source. - IMPORTING (21) - Importing a volume. - CONVERTING (22) - Converting a volume. - INVALID (23) - Invalid. - EXCLUSIVE (24) - Local storage system has exclusive access to the volume. - CONSISTENT (25) - Volume is being imported consistently along with other volumes in the VV set. - STANDBY (26) - Volume in Standby mode. - SD_META_INCONSISTENT (27) - SD Meta Inconsistent. - SD_NEEDS_FIX (28) - SD needs fix. - SD_META_FIXING (29) - SD meta fix. - UNKNOWN (999) - Unknown state. - NOT_SUPPORTED_BY_WSAPI (1000) - State not supported by WSAPI. - valuemap: - name: 'Primera: Volume detailed state enum' - preprocessing: - - - type: JSONPATH - parameters: - - '$[?(@.name == "{#NAME}")].additionalStates.first()' - - - type: JAVASCRIPT - parameters: - - 'return JSON.stringify(JSON.parse(value));' - master_item: - key: hpe.primera.volumes - tags: - - - tag: component - value: storage - - - tag: component - value: volume - - - tag: volume - value: '{#NAME}' - - uuid: bb78eda6a941407581f78cf29ef2b647 name: 'Volume [{#NAME}]: Administrative Free space' type: DEPENDENT @@ -4446,6 +4409,16 @@ zabbix_export: description: 'Specify user name for WSAPI.' valuemaps: - + uuid: 79ba0611293541f29f8b43b34e64465d + name: 'Primera: Boolean' + mappings: + - + value: '0' + newvalue: 'No' + - + value: '1' + newvalue: 'Yes' + - uuid: fd9a3483b02f45c6836b9a126b669402 name: 'Primera: diskState enum' mappings: |