# Hyper-V # Introduction Virtual environments are of great importance in the IT architectures of all companies and therefore their monitoring is essential. Pandora FMS HyperV Monitoring Plugin allows to have under control the Hyper-V virtual architecture in an easy way. It will be executed as an agent plugin and will create modules with specific information of the Hyper-V virtualization environment in the Host machine where it has been launched, and one agent for each virtual machine that it obtains with several modules with information of its performance. # Changelog
DateAuthorChangesVersion
08/10/13Mario P.First plugin versionV1r1
14/10/13S. LerenaGlobal revisionV1r1.1
28/07/20José A. Almendros A. Kevin RojasSecond plugin versionV2r1
# Compatibility matrix
Systems where it has been testedHyper-V 2016 Hyper-V 2012
Systems where it should workHyper-V 2008
# Requeriments for plugin execution The requirements for the proper functioning of the plugin are as follows: \- To install the Pandora FMS agent. \- A powershell console to execute the plugin. By default, it comes installed in Windows Server 2008 R2 and higher systems. \- System permissions for the user that runs the Pandora FMS agent as "LocalAdministrator” \- Have WMI and performance counters enabled, as well as remote Hyper-Vmanagement via powerhell cmdlets (Get-VM, Get-VMMMemory, Get-VMVMHardDiskDrive, Measure-VM...) \- Scripts executions policy set as RemoteSigned or lower: ``` Set-ExecutionPolicy RemoteSigned ``` \- Enable ResourceMetering token on virtual machines: ``` Get-VM | Enable-VMResourceMetering ``` # Modules provided The modules available for each element of the HyperV architecture are as follows. Some of them have preconfigured thresholds that could be modified directly in Pandora FMS console: **5.1 Modules for Local Agent** \- % Mem Use: Percentage of RAM memory usage of the host computer in use. \- CPU Use: Percentage of CPU usage of the host computer. \- Avail Dynamic Memory Balancer\*: Total amount of physical host memory in Bytes, available for Dynamic Memory Balancer. \- FreeDisk (Volume\_Name): Percentage of free disk in the different Host Volumes. As many modules will be added as there are units in the computer. \- Disk Read Bytes (Volume\_Name)\*: Bytes/sec read by each Logical Disk. \- Disk Write Bytes (Volume\_Name)\*: Bytes/sec written by each Logical Disk. \- Disk (Volume\_Name) Health: String with the Health of the local volumes. The thresholds are configured to go to warning if the Health is "Warning" and to critical if the Health is "Unknown". \- File size of vdisk (VDisk\_Name) on VM (VM\_Name): File size of the virtual disks created in the virtual machines. \- Total VMs: Total number of all virtual machines created on the host computer. \- Total VMs State Running: Number of virtual machines in current state Running. \- Total VMs State Off: Number of virtual machines in current state Off. \- Total VMs State Saved: Number of virtual machines in current state Saved. \- Total VMs State Paused: Number of virtual machines in current state Paused. \- Total VMs State Other: Number of virtual machines in a current state other than Running, Off, Saved or Paused. \- Total Assigned Memory: Total memory allocated to all virtual machines (in GB) \- Total Assigned Memory %: Percentage of total memory allocated to all virtual machines relative to total host memory. \- Total Demand Memory: Total memory demanded by all virtual machines (in GB) \- Total Demand Memory %: % of Total memory demanded by all virtual machines in relation to total host memory. \- Total VMs Memory Available: Percentage of Total Available Memory for the virtualization environment ((Total Demand Memory / Total Assigned Memory) \*100) \- Bytes Sent (Interface): Number of bytes/sec sent by each network interface \- Bytes Received (Interface): Number of bytes/sec received at each network interface. \- Packets Received: Number of packets received by the network interface in each interval (Pack/sec) \* These modules are obtained by means of performance counters, whose name is dependent on the language of the equipment. Translation for teams has been added in English and Spanish. **5.2 Modules for Virtual Machine Agents** \- Status: Connection status. The module will go critical if the virtual machine is off. The rest of the modules will not be updated or created if it is critical. \- CPU\_Usage: Percentage of CPU used in the virtual machine \- VM\_Uptime: Uptime of the virtual machine. The value is calculated in Timeticks. You can make the value appear as Days, Hours, Minutes if you change the unit to Timeticks in the module configuration from the web console. \- Mem Dynamic Use: Percentage of dynamic memory used by the virtual machine, this module will only be generated if dynamic memory is enabled in the Virtual Machine configuration. \- Total Disk IO: Bytes of data read + Bytes of data written to the virtual machine disk \- % Disk IO Read: % of the disk operations intended for reading with respect to the total. \- % Disk IO Write: % of the operations on disk destined to writting with respect to the total. \- Disk IO Read Bytes/sec: Bytes/sec read on virtual machine disk \- Disk IO Write Bytes/sec: Bytes/sec written to the virtual machine's disk. \- % Disk used: Percentage of virtual disk used by the virtual machine (one module will be created for each disk obtained by the virtual machine) \- Bytes Send/sec: Bytes/sec sent by the network adapter configured in the virtual machine \- Bytes Received/sec: Bytes/sec received by the network adapter configured in the virtual machine \- Number of Snapshots: Number of snapshots that exist in the virtual machine. # Plugin installation The way to execute the plugin distributed through collections from Pandora FMS console will be explained. This way it will be possible to deploy it in several servers at the same time in case of having more than one Hyper-V server through the policy system. First, we will create the collection from the Configuration > Collections section with the name "hyperv": [![image-1643130571245.png](https://pandorafms.com/guides/public/uploads/images/gallery/2022-01/scaled-1680-/image-1643130571245.png)](https://pandorafms.com/guides/public/uploads/images/gallery/2022-01/image-1643130571245.png) Then, we will press on the "Upload Files" button to upload to the collection the plugin's executable file and its configuration file, previously configured: [![image-1643130613804.png](https://pandorafms.com/guides/public/uploads/images/gallery/2022-01/scaled-1680-/image-1643130613804.png)](https://pandorafms.com/guides/public/uploads/images/gallery/2022-01/image-1643130613804.png) In the Data section of the collection, click on "Create File again" to regenerate the collection with the uploaded files. If we need to edit the configuration file, we can do it from the Files section and then we would have to regenerate the collection file again: [![image-1643130661146.png](https://pandorafms.com/guides/public/uploads/images/gallery/2022-01/scaled-1680-/image-1643130661146.png)](https://pandorafms.com/guides/public/uploads/images/gallery/2022-01/image-1643130661146.png) Now we will add the collection to the Hyper-V server agent where we want to launch the plugin, clicking on the "+" button in the "hyperv" collection in the Collection section of the administration mode (or adding the line "file\_collection hyperv" at the end of the agent configuration file): [![image-1643130701164.png](https://pandorafms.com/guides/public/uploads/images/gallery/2022-01/scaled-1680-/image-1643130701164.png)](https://pandorafms.com/guides/public/uploads/images/gallery/2022-01/image-1643130701164.png) Finally we will add the plugin execution line in the agent configuration file: ``` module_plugin "%ProgramFiles%\pandora_agent\collections\hyperv\hyperV.exe" -c "%ProgramFiles%\pandora_agent\collections\hyperv\HyperV-config.txt" ``` In case we haven't used collections to deploy the plugin and have copied it to the server machine by hand, we would simply add the line above with the correct paths from the executable file and the conf. # Configuration file parameters For the plugin to work properly, the configuration file must be edited with the characteristics of the environment. This is an example of it: ``` # VM Agent Configuration ServerIP localhost Interval 300 Agent_Version 7.0NG.748 Group HyperV File_Path C:\Program Files\pandora_agent\temp\ Tentacle#Options # VM Module Configuration (if you dont want to use any module NO or delete it of the list) VM#ALL VM_Uptime OK VM_Dynamic_Memory OK VM_I/O_Disk OK VM_I/O_Network NO VM_VDisk OK VM_Snapshot OK # Host Module Configuration HS#ALL HS_Dynamic_Memory OK HS_I/O_Disk OK HS_I/O_Network OK HS_Mem OK HS_CPU OK HS_Status OK HS_VDisk_Size NO HS_FreeDisk OK HS_Disk_Health OK HS_VMs_Mem OK ``` Server IP: In this token we should configure the IP of the server to which the agent is pointing to, and it will be used to send the XML that are formed with each one of the virtual machines. Interval: We will indicate the interval that the agents of the virtual machines are going to have, it is recommended to indicate an interval to give to the main agent. For example, if that agent has an interval of 300, we would indicate 300, 600, 900... Agent\_version: We will indicate the version of the main Pandora FMS agent so it will be shown in the console in the virtual machines agents. It is a merely descriptive data. Group: The group we want our virtual machine agents to belong to will be configured. Make sure that this group is previously created in Pandora FMS console. File\_Path: The path where we want the XML of the different agents that will be formed with each virtual machine to be stored in a temporary way, and that later will be sent to the server through the tentacle protocol. The path must exist in the machine, it admits spaces and it is necessary to introduce it without any kind of quotes and ending in "\\". Tentacle\_Options: In this token we will indicate the tentacle sending options. In the case that none is needed, nothing will be indicated as it is in the example file. These are the available options: -c Enable SSL without client certificate -e cert OpenSSL certificate file. Enables SSL. -f ca Verifies that the certificate is signed by the ca. -k key OpenSSL private key file -p port Server port (41121 by default) -x pwd Server password -and proxy server Proxy server (http://user:password@address:port) 7.1 VM Modules VM\_ALL: If we have the token in the indicated way (VM\_ALL) it will send the information of all the available modules of the virtual machines section. If we don't want all of them to be sent and we're going to configure each group of modules independently with the other tokens, we need to remove this token or fake it (VM#ALL) VM\_Uptime: Through an OK, we will enable the following module/group of modules to be sent: \- VM\_Uptime VM\_Dinamic\_Memory: Through an OK, we will enable the following module/group of modules to be sent: \- %Mem Dynamic Use VM\_I/O\_Disk: Through an OK, we will enable the following module/group of modules to be sent: \- Total Disk IO \- %Disk IO Read \- %Disk IO Write \- Disk IO Read Bytes/sec \- Disk IO Write Bytes/sec VM\_I/O\_Network: Through an OK, we will enable the following module/group ofmodules to be sent: \- Bytes Send/sec \- Bytes Received/sec VM\_VDisk: Through an OK, we will enable the following module/group of modules to besent: \- % Disk used VM\_Snapshot: Through an OK, we will enable the following module/group of modules tobe sent: \- Number of snapshots 7.2 Host Modules HS\_ALL: If we have the token in the indicated way (HS\_ALL) it will send the information ofall the available modules of the Host hypervisor section. If we don't want all of them to be sent and we are going to configure each group of modules independently with the rest of tokens, we must remove this token or fake it (HS#ALL) HS\_Dynamic\_Memory: Through an OK, we will enable the following module/group of modules to be sent: \- Avail Dynamic Memory Balancer HS\_I/O\_Disk: Through an OK, we will enable the following module/group of modules to be sent: \- Disk Read Bytes (Volume\_Name) \- Disk Write Bytes (Volume\_Name) HS\_I/O\_Network: Through an OK, we will enable the following module/group of modules to be sent: \- Bytes Sent (Interfaz) \- Bytes Received (Interfaz)HS\_Mem: Through an OK, we will enable the following module/group of modules to be sent: \- % Mem Use HS\_CPU: Through an OK, we will enable the following module/group of modules to be sent: \- CPU Use HS\_Status: Through an OK, we will enable the following module/group of modules to be sent: \- Total VMs \- Total VMs State Running \- Total VMs State Off \- Total VMs State Saved \- Total VMs State Paused \- Total VMs State Other HS\_VDisk\_Size: Through an OK, we will enable the following module/group of modules to be sent: \- File size of vdisk (VDisk\_Name) on VM (VM\_Name) HS\_FreeDisk: Through an OK, we will enable the following module/group of modules to be sent: \- FreeDisk (Volume\_Name) HS\_Disk\_Health: Through an OK, we will enable the following module/group of modules to be sent: \- Disk (Volume\_Name) Health HS\_VMs\_Mem: Through an OK, we will enable the following module/group of modules to be sent: \- Total Assigned Memory \- Total Assigned Memory (%) \- Total Demand Memory \- Total Demand Memory (%) \- Total VMs Memory Available (%) # Configuration screenshots and results Configuration in the agent's machine: We have deployed the plugin through the collection system, so the executable file and the configuration file will be in the path of the collections directory of the Pandora FMS agent: [![image-1643131115761.png](https://pandorafms.com/guides/public/uploads/images/gallery/2022-01/scaled-1680-/image-1643131115761.png)](https://pandorafms.com/guides/public/uploads/images/gallery/2022-01/image-1643131115761.png) The XML of the virtual machine agents in which their sending to the server by tentacle fails will be in the path indicated in the FilePath of the configuration file. Once the configuration of the plugin is done correctly, it will report each interval the data and will create in the first execution an agent for each virtual machine installed in the Host machine, as well as the modules corresponding to the Hypervisor in the agent where the plugin is being launched. The virtual machines that are off will only report the Status module. Until these virtual machines are turned on, they will not report all the modules that are enabled. We could create a new group called Hyper-V and in the plugin configuration file indicate this name in order to create all the new agents in this group. Screenshot of Host View: [![image-1643131184732.png](https://pandorafms.com/guides/public/uploads/images/gallery/2022-01/scaled-1680-/image-1643131184732.png)](https://pandorafms.com/guides/public/uploads/images/gallery/2022-01/image-1643131184732.png) Screenshot of VM View. [![image-1643131218026.png](https://pandorafms.com/guides/public/uploads/images/gallery/2022-01/scaled-1680-/image-1643131218026.png)](https://pandorafms.com/guides/public/uploads/images/gallery/2022-01/image-1643131218026.png)