diff options
author | Alexander Bakaldin <alexander.bakaldin@zabbix.com> | 2022-03-31 10:06:49 +0300 |
---|---|---|
committer | Alexander Bakaldin <alexander.bakaldin@zabbix.com> | 2022-03-31 10:06:49 +0300 |
commit | b494641b3e8fc5f1921d06c08366fdb1e4569101 (patch) | |
tree | ec3057a013f61f00b72c92e51a85afff304ad019 /templates | |
parent | 48e02bb8c5604621cccd37b3bfc7f6bd80aa193c (diff) |
.........T [ZBXNEXT-7506] added value map to Proxmox Virtual Environment template
Diffstat (limited to 'templates')
-rw-r--r-- | templates/app/proxmox/README.md | 7 | ||||
-rw-r--r-- | templates/app/proxmox/template_app_proxmox.yaml | 313 |
2 files changed, 304 insertions, 16 deletions
diff --git a/templates/app/proxmox/README.md b/templates/app/proxmox/README.md index 0588adbdf31..097cd45946a 100644 --- a/templates/app/proxmox/README.md +++ b/templates/app/proxmox/README.md @@ -4,7 +4,7 @@ ## Overview For Zabbix version: 6.2 and higher -Proxmox VE uses a REST like API. The concept is described in (Resource Oriented Architectur - ROA). +Proxmox VE uses a REST like API. The concept is described in (Resource Oriented Architecture - ROA). We choose JSON as primary data format, and the whole API is formally defined using JSON Schema. @@ -87,6 +87,7 @@ There are no template links in this template. |Network interfaces |Proxmox: VM [{#NODE.NAME}/{#QEMU.NAME} ({#QEMU.ID})]: Outgoing data, rate |<p>Outgoing data rate.</p> |DEPENDENT |proxmox.qemu.netout[{#QEMU.ID}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.data.netout`</p><p>- CHANGE_PER_SECOND</p><p>- MULTIPLIER: `8`</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `1h`</p> | |Network interfaces |Proxmox: LXC [{#NODE.NAME}/{#LXC.NAME} ({#LXC.ID})]: Incoming data, rate |<p>Incoming data rate.</p> |DEPENDENT |proxmox.lxc.netin[{#LXC.ID}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.data.netin`</p><p>- CHANGE_PER_SECOND</p><p>- MULTIPLIER: `8`</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `1h`</p> | |Network interfaces |Proxmox: LXC [{#NODE.NAME}/{#LXC.NAME} ({#LXC.ID})]: Outgoing data, rate |<p>Outgoing data rate.</p> |DEPENDENT |proxmox.lxc.netout[{#LXC.ID}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.data.netout`</p><p>- CHANGE_PER_SECOND</p><p>- MULTIPLIER: `8`</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `1h`</p> | +|Status |Proxmox: API service status |<p>Get API service status.</p> |SCRIPT |proxmox.api.available<p>**Preprocessing**:</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `12h`</p><p>**Expression**:</p>`The text is too long. Please see the template.` | |Status |Proxmox: Cluster [{#RESOURCE.NAME}]: Quorate |<p>Indicates if there is a majority of nodes online to make decisions.</p> |DEPENDENT |proxmox.cluster.quorate[{#RESOURCE.NAME}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.data.[?(@.name == '{#RESOURCE.NAME}' && @.type == 'cluster')].quorate.first()`</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `1h`</p> | |Status |Proxmox: Node [{#NODE.NAME}]: Status |<p>Indicates if the node is online or offline.</p> |DEPENDENT |proxmox.node.online[{#NODE.NAME}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.data.[?(@.name == '{#NODE.NAME}' && @.type == 'node')].online.first()`</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `1h`</p> | |Status |Proxmox: Node [{#NODE.NAME}]: Uptime |<p>System uptime in 'N days, hh:mm:ss' format.</p> |DEPENDENT |proxmox.node.uptime[{#NODE.NAME}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.data.uptime`</p> | @@ -107,7 +108,7 @@ There are no template links in this template. |Storage |Proxmox: LXC [{#NODE.NAME}/{#LXC.NAME} ({#LXC.ID})]: Disk write, rate |<p>Disk write.</p> |DEPENDENT |proxmox.lxc.diskwrite[{#LXC.ID}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.data.diskwrite`</p><p>- CHANGE_PER_SECOND</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `1h`</p> | |Storage |Proxmox: LXC [{#NODE.NAME}/{#LXC.NAME} ({#LXC.ID})]: Disk read, rate |<p>Disk read.</p> |DEPENDENT |proxmox.lxc.diskread[{#LXC.ID}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.data.diskread`</p><p>- CHANGE_PER_SECOND</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `1h`</p> | |Zabbix raw items |Proxmox: Get cluster resources |<p>Resources index.</p> |HTTP_AGENT |proxmox.cluster.resources<p>**Preprocessing**:</p><p>- CHECK_NOT_SUPPORTED</p><p>⛔️ON_FAIL: `CUSTOM_VALUE -> Error getting data`</p> | -|Zabbix raw items |Proxmox: Get cluster status |<p>Get cluster status information.</p> |HTTP_AGENT |proxmox.cluster.status | +|Zabbix raw items |Proxmox: Get cluster status |<p>Get cluster status information.</p> |HTTP_AGENT |proxmox.cluster.status<p>**Preprocessing**:</p><p>- CHECK_NOT_SUPPORTED</p><p>⛔️ON_FAIL: `CUSTOM_VALUE -> Error getting data`</p> | |Zabbix raw items |Proxmox: Node [{#NODE.NAME}]: Status |<p>Read node status.</p> |HTTP_AGENT |proxmox.node.status[{#NODE.NAME}] | |Zabbix raw items |Proxmox: Node [{#NODE.NAME}]: RRD statistics |<p>Read node RRD statistics.</p> |HTTP_AGENT |proxmox.node.rrd[{#NODE.NAME}]<p>**Preprocessing**:</p><p>- JAVASCRIPT: `var rrd_data = JSON.parse(value).data; return JSON.stringify(rrd_data[rrd_data.length - 1]) `</p> | |Zabbix raw items |Proxmox: Node [{#NODE.NAME}]: Time |<p>Read server time and time zone settings.</p> |HTTP_AGENT |proxmox.node.time[{#NODE.NAME}] | @@ -126,6 +127,7 @@ There are no template links in this template. |Proxmox: Node [{#NODE.NAME}] high memory usage (over {$PVE.MEMORY.PUSE.MAX.WARN:"{#NODE.NAME}"}% use) |<p>Memory usage.</p> |`min(/Proxmox VE by HTTP/proxmox.node.memused[{#NODE.NAME}],5m) / last(/Proxmox VE by HTTP/proxmox.node.memtotal[{#NODE.NAME}]) * 100 >{$PVE.MEMORY.PUSE.MAX.WARN:"{#NODE.NAME}"}` |WARNING | | |Proxmox: VM [{#NODE.NAME}/{#QEMU.NAME} ({#QEMU.ID})] high memory usage (over {$PVE.VM.MEMORY.PUSE.MAX.WARN:"{#QEMU.ID}"}% use) |<p>Memory usage.</p> |`min(/Proxmox VE by HTTP/proxmox.qemu.mem[{#QEMU.ID}],5m) / last(/Proxmox VE by HTTP/proxmox.qemu.maxmem[{#QEMU.ID}]) * 100 >{$PVE.VM.MEMORY.PUSE.MAX.WARN:"{#QEMU.ID}"}` |WARNING | | |Proxmox: LXC [{#NODE.NAME}/{#LXC.NAME} ({#LXC.ID})] high memory usage (over {$PVE.LXC.MEMORY.PUSE.MAX.WARN:"{#LXC.ID}"}% use) |<p>Memory usage.</p> |`min(/Proxmox VE by HTTP/proxmox.lxc.mem[{#LXC.ID}],5m) / last(/Proxmox VE by HTTP/proxmox.lxc.maxmem[{#LXC.ID}]) * 100 >{$PVE.LXC.MEMORY.PUSE.MAX.WARN:"{#LXC.ID}"}` |WARNING | | +|Proxmox: API service not available |<p>The API service is not available. Check your network and authorization settings.</p> |`last(/Proxmox VE by HTTP/proxmox.api.available) <> 200` |HIGH | | |Proxmox: Cluster [{#RESOURCE.NAME}] not quorum |<p>Proxmox VE use a quorum-based technique to provide a consistent state among all cluster nodes.</p> |`last(/Proxmox VE by HTTP/proxmox.cluster.quorate[{#RESOURCE.NAME}]) <> 1` |HIGH | | |Proxmox: Node [{#NODE.NAME}] offline |<p>Node offline.</p> |`last(/Proxmox VE by HTTP/proxmox.node.online[{#NODE.NAME}]) <> 1` |HIGH | | |Proxmox: Node [{#NODE.NAME}]: has been restarted (uptime < 10m) |<p>Uptime is less than 10 minutes</p> |`last(/Proxmox VE by HTTP/proxmox.node.uptime[{#NODE.NAME}])<10m` |INFO |<p>Manual close: YES</p> | @@ -136,7 +138,6 @@ There are no template links in this template. |Proxmox: Node [{#NODE.NAME}] high root filesystem space usage (over {$PVE.ROOT.PUSE.MAX.WARN:"{#NODE.NAME}"}% use) |<p>Root filesystem space usage.</p> |`min(/Proxmox VE by HTTP/proxmox.node.rootused[{#NODE.NAME}],5m) / last(/Proxmox VE by HTTP/proxmox.node.roottotal[{#NODE.NAME}]) * 100 >{$PVE.ROOT.PUSE.MAX.WARN:"{#NODE.NAME}"}` |WARNING | | |Proxmox: Node [{#NODE.NAME}] high root filesystem space usage (over {$PVE.SWAP.PUSE.MAX.WARN:"{#NODE.NAME}"}% use) |<p>This trigger is ignored, if there is no swap configured.</p> |`min(/Proxmox VE by HTTP/proxmox.node.swapused[{#NODE.NAME}],5m) / last(/Proxmox VE by HTTP/proxmox.node.swaptotal[{#NODE.NAME}]) * 100 > {$PVE.SWAP.PUSE.MAX.WARN:"{#NODE.NAME}"} and last(/Proxmox VE by HTTP/proxmox.node.swaptotal[{#NODE.NAME}]) > 0` |WARNING | | |Proxmox: Storage [{#NODE.NAME}/{#STORAGE.NAME}] high filesystem space usage (over {$PVE.STORAGE.PUSE.MAX.WARN:"{#NODE.NAME}/{#STORAGE.NAME}"}% use) |<p>Root filesystem space usage.</p> |`min(/Proxmox VE by HTTP/proxmox.node.disk[{#NODE.NAME},{#STORAGE.NAME}],5m) / last(/Proxmox VE by HTTP/proxmox.node.maxdisk[{#NODE.NAME},{#STORAGE.NAME}]) * 100 >{$PVE.STORAGE.PUSE.MAX.WARN:"{#NODE.NAME}/{#STORAGE.NAME}"}` |WARNING | | -|Proxmox: API service not available |<p>The API service is not available. Check your network and authorization settings.</p> |`last(/Proxmox VE by HTTP/proxmox.cluster.resources) = "Error getting data"` |HIGH | | ## Feedback diff --git a/templates/app/proxmox/template_app_proxmox.yaml b/templates/app/proxmox/template_app_proxmox.yaml index ed5c7795025..46e8fbb6b96 100644 --- a/templates/app/proxmox/template_app_proxmox.yaml +++ b/templates/app/proxmox/template_app_proxmox.yaml @@ -1,6 +1,6 @@ zabbix_export: version: '6.2' - date: '2022-03-28T00:15:18Z' + date: '2022-03-31T06:50:52Z' groups: - uuid: a571c0d144b14fd4a87a9d9b2aa9fcd6 @@ -16,6 +16,63 @@ zabbix_export: name: Templates/Applications items: - + uuid: 75f8f8c507774f529ade4bc4255f5fd2 + name: 'Proxmox: API service status' + type: SCRIPT + key: proxmox.api.available + delay: 5m + history: 7d + params: | + try { + var params = JSON.parse(value); + var req = new HttpRequest(); + req.addHeader('Authorization: PVEAPIToken=' + params.token + '=' + params.secret); + req.get(encodeURI('https://' + params.url + ':' + params.port + '/api2/json/version')); + } catch (error) { + Zabbix.log(3, "Proxmox API failed: " + params.url + " Error: " + error); + if (!Number.isInteger(error)) + return 520; + } + return req.getStatus(); + description: 'Get API service status.' + valuemap: + name: 'HTTP response status code' + preprocessing: + - + type: DISCARD_UNCHANGED_HEARTBEAT + parameters: + - 12h + timeout: 10s + parameters: + - + name: token + value: '{$PVE.TOKEN.ID}' + - + name: secret + value: '{$PVE.TOKEN.SECRET}' + - + name: url + value: '{HOST.CONN}' + - + name: port + value: '{$PVE.URL.PORT}' + tags: + - + tag: component + value: system + triggers: + - + uuid: 7ef8290fd6e242339d0e56d5e8eedb1a + expression: 'last(/Proxmox VE by HTTP/proxmox.api.available) <> 200' + name: 'Proxmox: API service not available' + opdata: 'Current value: {ITEM.LASTVALUE1}' + priority: HIGH + description: 'The API service is not available. Check your network and authorization settings.' + tags: + - + tag: scope + value: availability + - uuid: 4fe4fa1323cd481f8aff3bfb716eeae2 name: 'Proxmox: Get cluster resources' type: HTTP_AGENT @@ -41,18 +98,6 @@ zabbix_export: - tag: component value: raw - triggers: - - - uuid: 7ef8290fd6e242339d0e56d5e8eedb1a - expression: 'last(/Proxmox VE by HTTP/proxmox.cluster.resources) = "Error getting data"' - name: 'Proxmox: API service not available' - opdata: 'Current value: {ITEM.LASTVALUE1}' - priority: HIGH - description: 'The API service is not available. Check your network and authorization settings.' - tags: - - - tag: scope - value: availability - uuid: 6e6a5046b8154bafad375813ca210e1f name: 'Proxmox: Get cluster status' @@ -63,6 +108,13 @@ zabbix_export: trends: '0' value_type: TEXT description: 'Get cluster status information.' + preprocessing: + - + type: CHECK_NOT_SUPPORTED + parameters: + - '' + error_handler: CUSTOM_VALUE + error_handler_params: 'Error getting data' url: 'https://{HOST.CONN}:{$PVE.URL.PORT}/api2/json/cluster/status' headers: - @@ -2091,6 +2143,241 @@ zabbix_export: value: '0' newvalue: 'No' - + uuid: 87034fae192c44dba6c8bb568cd90bbd + name: 'HTTP response status code' + mappings: + - + value: '100' + newvalue: Continue + - + value: '101' + newvalue: 'Switching Protocols' + - + value: '102' + newvalue: Processing + - + value: '200' + newvalue: OK + - + value: '201' + newvalue: Created + - + value: '202' + newvalue: Accepted + - + value: '203' + newvalue: 'Non-Authoritative Information' + - + value: '204' + newvalue: 'No Content' + - + value: '205' + newvalue: 'Reset Content' + - + value: '206' + newvalue: 'Partial Content' + - + value: '207' + newvalue: Multi-Status + - + value: '208' + newvalue: 'Already Reported' + - + value: '226' + newvalue: 'IM Used' + - + value: '300' + newvalue: 'Multiple Choices' + - + value: '301' + newvalue: 'Moved Permanently' + - + value: '302' + newvalue: Found + - + value: '303' + newvalue: 'See Other' + - + value: '304' + newvalue: 'Not Modified' + - + value: '305' + newvalue: 'Use Proxy' + - + value: '306' + newvalue: 'Switch Proxy' + - + value: '307' + newvalue: 'Temporary Redirect' + - + value: '308' + newvalue: 'Permanent Redirect/Resume Incomplete' + - + value: '400' + newvalue: 'Bad Request' + - + value: '401' + newvalue: Unauthorized + - + value: '402' + newvalue: 'Payment Required' + - + value: '403' + newvalue: Forbidden + - + value: '404' + newvalue: 'Not Found' + - + value: '405' + newvalue: 'Method Not Allowed' + - + value: '406' + newvalue: 'Not Acceptable' + - + value: '407' + newvalue: 'Proxy Authentication Required' + - + value: '408' + newvalue: 'Request Timeout' + - + value: '409' + newvalue: Conflict + - + value: '410' + newvalue: Gone + - + value: '411' + newvalue: 'Length Required' + - + value: '412' + newvalue: 'Precondition Failed' + - + value: '413' + newvalue: 'Payload Too Large' + - + value: '414' + newvalue: 'Request-URI Too Long' + - + value: '415' + newvalue: 'Unsupported Media Type' + - + value: '416' + newvalue: 'Requested Range Not Satisfiable' + - + value: '417' + newvalue: 'Expectation Failed' + - + value: '418' + newvalue: 'I''m a Teapot' + - + value: '419' + newvalue: 'Authentication Timeout' + - + value: '420' + newvalue: 'Method Failure/Enhance Your Calm' + - + value: '421' + newvalue: 'Misdirected Request' + - + value: '422' + newvalue: 'Unprocessable Entity' + - + value: '423' + newvalue: Locked + - + value: '424' + newvalue: 'Failed Dependency' + - + value: '426' + newvalue: 'Upgrade Required' + - + value: '428' + newvalue: 'Precondition Required' + - + value: '429' + newvalue: 'Too Many Requests' + - + value: '431' + newvalue: 'Request Header Fields Too Large' + - + value: '440' + newvalue: 'Login Timeout' + - + value: '444' + newvalue: 'No Response' + - + value: '449' + newvalue: 'Retry With' + - + value: '450' + newvalue: 'Blocked by Windows Parental Controls' + - + value: '451' + newvalue: 'Unavailable for Legal Reasons/Redirect' + - + value: '494' + newvalue: 'Request Header Too Large' + - + value: '495' + newvalue: 'Cert Error' + - + value: '496' + newvalue: 'No Cert' + - + value: '497' + newvalue: 'HTTP to HTTPS' + - + value: '498' + newvalue: 'Token Expired/Invalid' + - + value: '499' + newvalue: 'Client Closed Request/Token Required' + - + value: '500' + newvalue: 'Internal Server Error' + - + value: '501' + newvalue: 'Not Implemented' + - + value: '502' + newvalue: 'Bad Gateway' + - + value: '503' + newvalue: 'Service Unavailable' + - + value: '504' + newvalue: 'Gateway Timeout' + - + value: '505' + newvalue: 'HTTP Version Not Supported' + - + value: '506' + newvalue: 'Variant Also Negotiates' + - + value: '507' + newvalue: 'Insufficient Storage' + - + value: '508' + newvalue: 'Loop Detected' + - + value: '509' + newvalue: 'Bandwidth Limit Exceeded' + - + value: '510' + newvalue: 'Not Extended' + - + value: '511' + newvalue: 'Network Authentication Required' + - + value: '520' + newvalue: 'Unknown Error' + - + value: '598' + newvalue: 'Network Read Timeout Error' + - + value: '599' + newvalue: 'Network Connect Timeout Error' + - uuid: 99c0bc65efb34d298586320bdcf14209 name: 'Node online' mappings: |