System monitoring is the process of determining and finding problems in any of your servers, either physical or virtual.
VM Monitoring is a great assistant for virtual machine monitoring in clustered environments and helps to detect whether a virtual machine is running in a critical state. It will allow you to check the health of the VM service at the host level, identify issues using events and status messages. VM Monitoring also enables the host to start a task to solve the problem in a proactive way, with no user interaction. In other words, it will check whether something is wrong, and if necessary, it will try to fix the problem automatically.
This recipe will show you how to prepare the virtual machine and the Management OS to use VM Monitoring.
There are some prerequisites that you need to note before you start. The first thing is that VM Monitoring is only available on virtual machines running on a cluster. All the host computer configurations are done through the Failover Cluster Manager console.
The virtual machine must be a part of the same domain as the Management OS, and the user used to administer Failover Clustering must be a member of the local administrator's group in the VM.
Last but not the least; VM Monitoring is only available on virtual machines that run Windows Server 2012 and higher versions.
The following steps will demonstrate how to prepare the virtual machine to be monitored by VM Monitoring, how to enable it from the host so as to monitor a service, how to monitor Event Viewer entries within the VM, and how to check the VM Monitoring results:
cluadmin.msc
on the Start menu.services.msc
to open the Services console.MyApplication
to the service name you want to add:Add-ClusterVMMonitoredItem –VirtualMachine 2012R2 –Service MyApplication
MyApplication
with the event source you will use and 123
with the event ID VM Monitoring will monitor:Add-ClusterVMMonitoredItem –EventLog "Application" –EventSource "MyApplication" –EventID 123
Get-ClusterResource | fl StatusInformation
VM Monitoring can be enabled on every virtual machine with Windows Server 2012 or higher, running in a cluster, to monitor services and events from the host computer without the need to connect to the VM to check its status.
VM Monitoring requires that the virtual machine to be in the same domain as the host computer. It also needs the failover cluster administrator that is used to set VM Monitoring to be a member of the local administrator group within the VM.
After these prerequisites, a firewall exception to allow VM Monitoring must be created to allow the Management OS to connect to the VM.
When monitoring a service, you can specify what will happen within the VM in case of a service failure using the Recovery tab from the Services console. It allows three actions in a different order to be configured and can be used to automatically carry out an action such as sending an e-mail or running a script to solve the problem.
Using Failover Cluster Manager, you can enable VM Monitoring by selecting which services you want to monitor. In case the service is not listed, the Add-ClusterVMMonitoredItem
command can be used from the host computer to add it to the list.
Although it is not available using the graphical interface, Event Viewer logs can also be monitored on your VMs using PowerShell. The necessary commands used to enable Event Viewer monitoring are a part of the Failover Clustering module and needs to be installed within the VM.
From the node members of the cluster where the VMs sit, you can use the status information from Failover Cluster Manager or use Event Viewer, searching for the event ID 1250 on the system log to check whether one of the monitored items was triggered.
When a problem is found by the cluster, the VM is restarted by default, and in case of failures, a failover process occurs. These failure actions can be changed through the virtual machine properties. Rather than carrying out an action, you can create an Event Viewer task to send an alert to the IT team with the status information, for example.
Although VM Monitoring is very handy, it is not enough. It is important to think about other monitoring tools that can give more details and alerts from your whole infrastructure, with reports and advanced features. A good example is System Centre Operations Manager, a server where you can centralize all monitoring data, which can include servers, applications, network devices, desktops, and many other components from different brands and providers.
In addition, this can all be combined with Log analytics in Operations Management Suite (OMS), which will allow you to gain a deeper insight into your environment. With OMS you can interact with real-time and historical machine data to quickly develop custom insights. OMS also has powerful search capabilities that enable ad-hoc root cause analysis and automated troubleshooting.
18.188.175.182