-
Notifications
You must be signed in to change notification settings - Fork 5
Add Proxmox VE plugin #90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
iBePixel
wants to merge
5
commits into
main
Choose a base branch
from
work/el/add-proxmox-plugin
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
ce60f7e
Initial plugin created with OOB dashboards.
iBePixel 4e1c9d5
Changed Container Data stream ID name from 'VM ID' to 'Container ID'
iBePixel a1536c3
Changed metric 'shapes' from date to timestamp.
iBePixel 16e481e
Updated readme file to include network metrics for VMs and Containers.
iBePixel 63ec260
Updated readme to include relevant references to the ignore SSL option.
iBePixel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| { | ||
| "steps": [ | ||
| { | ||
| "displayName": "Authenticate", | ||
| "dataStream": { "name": "apiVersion" }, | ||
| "required": true, | ||
| "error": "Could not connect to Proxmox VE. Check your Host URL is reachable, and that your Token ID and Token Secret are correct.", | ||
| "success": "Connected to Proxmox VE successfully." | ||
| } | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| [ | ||
| { | ||
| "name": "Proxmox Node", | ||
| "sourceType": "Proxmox Node", | ||
| "icon": "server", | ||
| "singular": "Node", | ||
| "plural": "Nodes" | ||
| }, | ||
| { | ||
| "name": "Proxmox VM", | ||
| "sourceType": "Proxmox VM", | ||
| "icon": "display", | ||
| "singular": "VM", | ||
| "plural": "VMs" | ||
| }, | ||
| { | ||
| "name": "Proxmox Container", | ||
| "sourceType": "Proxmox Container", | ||
| "icon": "box", | ||
| "singular": "Container", | ||
| "plural": "Containers" | ||
| } | ||
| ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| { | ||
| "name": "apiVersion", | ||
| "displayName": "API Version", | ||
| "description": "Proxmox VE API version and release information", | ||
| "tags": ["Info"], | ||
| "baseDataSourceName": "httpRequestUnscoped", | ||
| "config": { | ||
| "httpMethod": "get", | ||
| "endpointPath": "/version", | ||
| "pathToData": "data" | ||
| }, | ||
| "matches": "none", | ||
| "visibility": { "type": "hidden" }, | ||
| "metadata": [ | ||
| { "pattern": ".*" } | ||
| ], | ||
| "timeframes": false | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| { | ||
| "name": "clusterResources", | ||
| "displayName": "Cluster Resources", | ||
| "description": "All nodes, VMs, and containers across the cluster with current resource utilisation", | ||
| "tags": ["Cluster", "Resources"], | ||
| "baseDataSourceName": "httpRequestUnscoped", | ||
| "config": { | ||
| "httpMethod": "get", | ||
| "endpointPath": "/cluster/resources", | ||
| "postRequestScript": "clusterResources.js" | ||
| }, | ||
| "matches": "none", | ||
| "metadata": [ | ||
| { "name": "sourceId", "displayName": "Source ID", "shape": "string", "visible": false }, | ||
| { "name": "sourceType", "displayName": "Type", "shape": "string" }, | ||
| { "name": "name", "displayName": "Name", "shape": "string", "role": "label" }, | ||
| { "name": "node", "displayName": "Node", "shape": "string" }, | ||
| { "name": "vmid", "displayName": "VM ID", "shape": "number" }, | ||
| { "name": "status", "displayName": "Status", "shape": ["state", { "map": { "success": ["running", "online"], "error": ["stopped", "offline"], "warning": ["paused", "unknown"] } }] }, | ||
| { "name": "cpu", "displayName": "CPU Usage", "shape": ["percent", { "asZeroToOne": true }] }, | ||
| { "name": "maxcpu", "displayName": "CPU Cores", "shape": "number" }, | ||
| { "name": "mem", "displayName": "Memory Used", "shape": "bytes" }, | ||
| { "name": "maxmem", "displayName": "Memory Total", "shape": "bytes" }, | ||
| { "name": "disk", "displayName": "Disk Used", "shape": "bytes" }, | ||
| { "name": "maxdisk", "displayName": "Disk Total", "shape": "bytes" }, | ||
| { "name": "uptime", "displayName": "Uptime", "shape": "seconds" }, | ||
| { "name": "type", "displayName": "API Type", "shape": "string", "visible": false } | ||
| ], | ||
| "timeframes": false | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| { | ||
| "name": "containerMetrics", | ||
| "displayName": "Container Metrics", | ||
| "description": "Historical CPU, memory, and network metrics for an LXC container", | ||
| "tags": ["Container", "Metrics"], | ||
| "baseDataSourceName": "httpRequestScopedSingle", | ||
| "config": { | ||
| "httpMethod": "get", | ||
| "endpointPath": "/nodes/{{object.node}}/lxc/{{object.rawId}}/rrddata", | ||
| "getArgs": [ | ||
| { | ||
| "key": "timeframe", | ||
| "value": "{{timeframe.enum === 'last1hour' ? 'hour' : timeframe.enum === 'last7days' ? 'week' : timeframe.enum === 'last30days' ? 'month' : 'day'}}" | ||
| }, | ||
| { | ||
| "key": "cf", | ||
| "value": "AVERAGE" | ||
| } | ||
| ], | ||
| "pathToData": "data" | ||
| }, | ||
| "matches": { "sourceType": { "type": "oneOf", "values": ["Proxmox Container"] } }, | ||
| "metadata": [ | ||
| { "name": "time", "displayName": "Time", "shape": "timestamp", "role": "timestamp" }, | ||
| { "name": "cpu", "displayName": "CPU Usage", "shape": ["percent", { "asZeroToOne": true }], "role": "value" }, | ||
| { "name": "mem", "displayName": "Memory Used", "shape": "bytes" }, | ||
| { "name": "maxmem", "displayName": "Memory Total", "shape": "bytes" }, | ||
| { "name": "netin", "displayName": "Network In", "shape": "bytespersecondbinary" }, | ||
| { "name": "netout", "displayName": "Network Out", "shape": "bytespersecondbinary" }, | ||
| { "name": "diskread", "displayName": "Disk Read", "shape": "bytespersecondbinary" }, | ||
| { "name": "diskwrite", "displayName": "Disk Write", "shape": "bytespersecondbinary" } | ||
| ], | ||
| "timeframes": ["last1hour", "last24hours", "last7days", "last30days"] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| { | ||
| "name": "containerStatus", | ||
| "displayName": "Container Status", | ||
| "description": "Current CPU, memory, disk, and uptime for an LXC container", | ||
| "tags": ["Container", "Status"], | ||
| "baseDataSourceName": "httpRequestScopedSingle", | ||
| "config": { | ||
| "httpMethod": "get", | ||
| "endpointPath": "/nodes/{{object.node}}/lxc/{{object.rawId}}/status/current", | ||
| "pathToData": "data" | ||
| }, | ||
| "matches": { "sourceType": { "type": "oneOf", "values": ["Proxmox Container"] } }, | ||
| "metadata": [ | ||
| { "name": "name", "displayName": "Name", "shape": "string", "role": "label" }, | ||
| { "name": "status", "displayName": "Status", "shape": ["state", { "map": { "success": ["running"], "error": ["stopped"], "warning": ["paused", "unknown"] } }], "role": "value" }, | ||
| { "name": "cpu", "displayName": "CPU Usage", "shape": ["percent", { "asZeroToOne": true }] }, | ||
| { "name": "cpus", "displayName": "CPU Cores", "shape": "number" }, | ||
| { "name": "mem", "displayName": "Memory Used", "shape": "bytes" }, | ||
| { "name": "maxmem", "displayName": "Memory Total", "shape": "bytes" }, | ||
| { "name": "swap", "displayName": "Swap Used", "shape": "bytes" }, | ||
| { "name": "maxswap", "displayName": "Swap Total", "shape": "bytes" }, | ||
| { "name": "disk", "displayName": "Disk Used", "shape": "bytes" }, | ||
| { "name": "maxdisk", "displayName": "Disk Total", "shape": "bytes" }, | ||
| { "name": "uptime", "displayName": "Uptime", "shape": "seconds" }, | ||
| { "name": "containerid", "displayName": "Container ID", "shape": "number" } | ||
| ], | ||
| "timeframes": false | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| { | ||
| "name": "nodeMetrics", | ||
| "displayName": "Node Metrics", | ||
| "description": "Historical CPU, memory, and network metrics for a node", | ||
| "tags": ["Node", "Metrics"], | ||
| "baseDataSourceName": "httpRequestScopedSingle", | ||
| "config": { | ||
| "httpMethod": "get", | ||
| "endpointPath": "/nodes/{{object.rawId}}/rrddata", | ||
| "getArgs": [ | ||
| { | ||
| "key": "timeframe", | ||
| "value": "{{timeframe.enum === 'last1hour' ? 'hour' : timeframe.enum === 'last7days' ? 'week' : timeframe.enum === 'last30days' ? 'month' : 'day'}}" | ||
| }, | ||
| { | ||
| "key": "cf", | ||
| "value": "AVERAGE" | ||
| } | ||
| ], | ||
| "pathToData": "data" | ||
| }, | ||
| "matches": { "sourceType": { "type": "oneOf", "values": ["Proxmox Node"] } }, | ||
| "metadata": [ | ||
| { "name": "time", "displayName": "Time", "shape": "timestamp", "role": "timestamp" }, | ||
| { "name": "cpu", "displayName": "CPU Usage", "shape": ["percent", { "asZeroToOne": true }], "role": "value" }, | ||
| { "name": "maxcpu", "displayName": "CPU Cores", "shape": "number" }, | ||
| { "name": "memused", "displayName": "Memory Used", "shape": "bytes" }, | ||
| { "name": "memtotal", "displayName": "Memory Total", "shape": "bytes" }, | ||
| { "name": "netin", "displayName": "Network In", "shape": "bytespersecondbinary" }, | ||
| { "name": "netout", "displayName": "Network Out", "shape": "bytespersecondbinary" }, | ||
| { "name": "iowait", "displayName": "I/O Wait", "shape": ["percent", { "asZeroToOne": true }] } | ||
| ], | ||
| "timeframes": ["last1hour", "last24hours", "last7days", "last30days"] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| { | ||
| "name": "nodeStatus", | ||
| "displayName": "Node Status", | ||
| "description": "Current CPU, memory, disk, and uptime for a node", | ||
| "tags": ["Node", "Status"], | ||
| "baseDataSourceName": "httpRequestScopedSingle", | ||
| "config": { | ||
| "httpMethod": "get", | ||
| "endpointPath": "/nodes/{{object.rawId}}/status", | ||
| "pathToData": "data", | ||
| "expandInnerObjects": true | ||
| }, | ||
| "matches": { "sourceType": { "type": "oneOf", "values": ["Proxmox Node"] } }, | ||
| "metadata": [ | ||
| { "name": "cpu", "displayName": "CPU Usage", "shape": ["percent", { "asZeroToOne": true }], "role": "value" }, | ||
| { "name": "memory.used", "displayName": "Memory Used", "shape": "bytes" }, | ||
| { "name": "memory.total", "displayName": "Memory Total", "shape": "bytes" }, | ||
| { "name": "rootfs.used", "displayName": "Disk Used", "shape": "bytes" }, | ||
| { "name": "rootfs.total", "displayName": "Disk Total", "shape": "bytes" }, | ||
| { "name": "uptime", "displayName": "Uptime", "shape": "seconds" }, | ||
| { "name": "kversion", "displayName": "Kernel Version", "shape": "string" }, | ||
| { "name": "pveversion", "displayName": "PVE Version", "shape": "string" } | ||
| ], | ||
| "timeframes": false | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| { | ||
| "name": "nodeUpdates", | ||
| "displayName": "Node Updates", | ||
| "description": "Pending OS package updates available for a node", | ||
| "tags": ["Node", "Updates"], | ||
| "baseDataSourceName": "httpRequestScopedSingle", | ||
| "config": { | ||
| "httpMethod": "get", | ||
| "endpointPath": "/nodes/{{object.rawId}}/apt/update", | ||
| "pathToData": "data" | ||
| }, | ||
| "matches": { "sourceType": { "type": "oneOf", "values": ["Proxmox Node"] } }, | ||
| "metadata": [ | ||
| { "name": "Package", "displayName": "Package Name", "shape": "string", "role": "label" }, | ||
| { "name": "Version", "displayName": "New Version", "shape": "string" }, | ||
| { "name": "OldVersion", "displayName": "Current Version", "shape": "string" }, | ||
| { "name": "Priority", "displayName": "Priority", "shape": "string" }, | ||
| { "name": "Origin", "displayName": "Origin", "shape": "string" }, | ||
| { "name": "Description", "displayName": "Description", "shape": "string" } | ||
| ], | ||
| "timeframes": false | ||
| } |
28 changes: 28 additions & 0 deletions
28
plugins/ProxmoxVE/v1/dataStreams/scripts/clusterResources.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| const resources = (data && data.data) || []; | ||
|
|
||
| const typeMap = { | ||
| node: 'Proxmox Node', | ||
| qemu: 'Proxmox VM', | ||
| lxc: 'Proxmox Container' | ||
| }; | ||
|
|
||
| result = resources | ||
| .filter(function(r) { return typeMap[r.type]; }) | ||
| .map(function(r) { | ||
| return { | ||
| sourceId: r.type === 'node' ? r.node : String(r.vmid), | ||
| sourceType: typeMap[r.type], | ||
| name: r.name || r.node, | ||
| node: r.node, | ||
| vmid: r.vmid != null ? r.vmid : null, | ||
| type: r.type, | ||
| status: r.status, | ||
| cpu: r.cpu || 0, | ||
| maxcpu: r.maxcpu || 0, | ||
| mem: r.mem || 0, | ||
| maxmem: r.maxmem || 0, | ||
| disk: r.disk || 0, | ||
| maxdisk: r.maxdisk || 0, | ||
| uptime: r.uptime || 0 | ||
| }; | ||
| }); | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| { | ||
| "name": "vmMetrics", | ||
| "displayName": "VM Metrics", | ||
| "description": "Historical CPU, memory, and network metrics for a QEMU/KVM virtual machine", | ||
| "tags": ["VM", "Metrics"], | ||
| "baseDataSourceName": "httpRequestScopedSingle", | ||
| "config": { | ||
| "httpMethod": "get", | ||
| "endpointPath": "/nodes/{{object.node}}/qemu/{{object.rawId}}/rrddata", | ||
| "getArgs": [ | ||
| { | ||
| "key": "timeframe", | ||
| "value": "{{timeframe.enum === 'last1hour' ? 'hour' : timeframe.enum === 'last7days' ? 'week' : timeframe.enum === 'last30days' ? 'month' : 'day'}}" | ||
| }, | ||
| { | ||
| "key": "cf", | ||
| "value": "AVERAGE" | ||
| } | ||
| ], | ||
| "pathToData": "data" | ||
| }, | ||
| "matches": { "sourceType": { "type": "oneOf", "values": ["Proxmox VM"] } }, | ||
| "metadata": [ | ||
| { "name": "time", "displayName": "Time", "shape": "timestamp", "role": "timestamp" }, | ||
| { "name": "cpu", "displayName": "CPU Usage", "shape": ["percent", { "asZeroToOne": true }], "role": "value" }, | ||
| { "name": "mem", "displayName": "Memory Used", "shape": "bytes" }, | ||
| { "name": "maxmem", "displayName": "Memory Total", "shape": "bytes" }, | ||
| { "name": "netin", "displayName": "Network In", "shape": "bytespersecondbinary" }, | ||
| { "name": "netout", "displayName": "Network Out", "shape": "bytespersecondbinary" }, | ||
| { "name": "diskread", "displayName": "Disk Read", "shape": "bytespersecondbinary" }, | ||
| { "name": "diskwrite", "displayName": "Disk Write", "shape": "bytespersecondbinary" } | ||
| ], | ||
| "timeframes": ["last1hour", "last24hours", "last7days", "last30days"] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| { | ||
| "name": "vmStatus", | ||
| "displayName": "VM Status", | ||
| "description": "Current CPU, memory, disk, and uptime for a QEMU/KVM virtual machine", | ||
| "tags": ["VM", "Status"], | ||
| "baseDataSourceName": "httpRequestScopedSingle", | ||
| "config": { | ||
| "httpMethod": "get", | ||
| "endpointPath": "/nodes/{{object.node}}/qemu/{{object.rawId}}/status/current", | ||
| "pathToData": "data" | ||
| }, | ||
| "matches": { "sourceType": { "type": "oneOf", "values": ["Proxmox VM"] } }, | ||
| "metadata": [ | ||
| { "name": "status", "displayName": "Status", "shape": ["state", { "map": { "success": ["running"], "error": ["stopped"], "warning": ["paused", "unknown"] } }], "role": "value" }, | ||
| { "name": "cpu", "displayName": "CPU Usage", "shape": ["percent", { "asZeroToOne": true }] }, | ||
| { "name": "cpus", "displayName": "CPU Cores", "shape": "number" }, | ||
| { "name": "mem", "displayName": "Memory Used", "shape": "bytes" }, | ||
| { "name": "maxmem", "displayName": "Memory Total", "shape": "bytes" }, | ||
| { "name": "disk", "displayName": "Disk Used", "shape": "bytes" }, | ||
| { "name": "maxdisk", "displayName": "Disk Total", "shape": "bytes" }, | ||
| { "name": "uptime", "displayName": "Uptime", "shape": "seconds" }, | ||
| { "name": "name", "displayName": "Name", "shape": "string", "role": "label" }, | ||
| { "name": "vmid", "displayName": "VM ID", "shape": "number" }, | ||
| { "name": "netin", "displayName": "Network In", "shape": "bytes" }, | ||
| { "name": "netout", "displayName": "Network Out", "shape": "bytes" } | ||
| ], | ||
| "timeframes": false | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When the skill uses a script, it really loves to add every property one by one.
Possibly should add guidance to spread the properties @clarkd?
Granted it also goes in hand with how it loves to define every metadata column, rather than using
"pattern": ".*", not sure what best practice here should be