When we start the implementation of vrops as a monitoring solution at many customer we have seen that the legacy customers have a unique way of monitoring their environment. These customers will use a lot of custom script to monitor a certain service or read though certain file and check if the infra is working as expected. These scripts are not top notch but they deliver exactly what is expected.
One of the very frequently asked questions when working with vROPs is, Can we get the output of a Custom Script on to the Dashboards, and can we be alerted when something is not behaving as expected.
As usual there are 2 way,
- Using vROPs End Point Operation Agents to Monitor the Script – Covered in this post
- Using Log Insight to Parse the custom Logs – (will be covered in next Blog Post, by end of the day tomorrow)
Appraoach 1:- EPOPs Agents
Over all Flow:-
- The EPOPs Agent Connects to the Virtual machine
- Checks for script availability
- Executes the script and waits for return value.
- Display it on vrops dashboard.
Once we have the Value in vrops as a metric we can use it to create Alerts
The first requirement for this approach is to install EPOPs Agent on Virtual Machine that we want to monitor. I will not be covering that in this Blog Post, but, here a link https://www.virtualizationhowto.com/2017/07/install-vrealize-operations-manager-6-6-endpoint-agent/
Once you have the EPOPs agent installed on the VM go to Environment à All Objects à EPOPs Adapter à Windows / Linux à< name of the VM> à Actions
Select à more
Select “Script” in the Drop down options
Fill in the details like
- Display Name
- Path to Script that you want to Run.
- Polling interval etc.
Save the Settings.
I have created a simple .Bat – scripttest.bat — file that will display a number
I have saved the File at the location mentioned in the Path variable in the Monitor Script
Once the setup is done, you can go and check the Script Monitor you just created under
Environment à all Objects à epops adapter à script à Name of the Script
You can see the health of the script on the summary page.
Go to All Metrics, under Utilization tab you will see the Result Value.
There are few Limitations to this method
- The Script should return an exit value.
- The Return Value can only be numeric value.
- There can only be one return value.
- Return Value cannot be an array of numeric value.
- If multiple values are returned the EPOPs agent will return the first value only.