All Downloads are FREE. Search and download functionalities are using the official Maven repository.

hardware.Virsh.Virsh.yaml Maven / Gradle / Ivy

The newest version!
---
extends:
- ../Hardware/Hardware
connector:
  displayName: KVM, QEMU, Xen and Hypervisors (virsh)
  platforms: KVM, QEMU, Xen, Hypervisors
  reliesOn: libvirt API
  version: 1.0
  information: This connector enables hardware monitoring for VMs through the virsh command. The libvirt API must be installed on the host.
  detection:
    connectionTypes:
    - remote
    - local
    appliesTo:
    - Linux
    criteria:
    - type: productRequirements
      kmVersion: 11.3.00
    - type: commandLine
      commandLine: virsh list
      expectedResult: Name
    tags: [ hardware, linux ]
monitors:
  vm:
    discovery:
      sources:
        source(1):
          type: commandLine
          commandLine: virsh list | awk '{print $$1}' | grep -oIE "[0-9]*" | while read word; do virsh dominfo ${word} ; done
          computes:
          - type: awk
            script: ${file::vm.awk}
      mapping:
        source: ${source::monitors.vm.discovery.sources.source(1)}
        attributes:
          id: $1
          __display_id: $1
          vm.host.name: $1
          info: $4
          hw.parent.type: enclosure
          name: ${awk::sprintf("%s (%s)", $1, $1)}
        conditionalCollection:
          hw.power{hw.type="vm"}: 0
    collect:
      type: multiInstance
      keys:
      - id
      sources:
        source(1):
          type: commandLine
          commandLine: virsh list | awk '{print $$1}' | grep -oIE "[0-9]*" | while read word; do virsh dominfo ${word} ; done
          computes:
          - type: awk
            script: ${file::vm.awk}
          - type: translate
            column: 2
            translationTable: ${translation::stateTranslationTable}
      mapping:
        source: ${source::monitors.vm.collect.sources.source(1)}
        attributes:
          id: $1
        metrics:
          hw.power_state{hw.type="vm"}: $2
          hw.vm.power_ratio: computePowerShareRatio($3)
translations:
  stateTranslationTable:
    running: "on"
    paused: suspended
    default: "off"
    suspended: suspended




© 2015 - 2024 Weber Informatics LLC | Privacy Policy