I was working with a customer today and I was asked the question: “Why aren’t computers automatically grouped by OS (Linux and Windows) in OMS? Further, if computers are not automatically grouped by OS, is there an easy way to create this grouping? Like SCOM, OMS is very flexible so my canned answer to questions like these is always “we can most likely make it happen”. That said, I had not looked at his particular scenario so I was anxious to dig in and discover the answers for myself.
After a bit of investigation, I was happy to see that the new Heartbeat data does include fields for OSType, OSMajorVersion, and OSMinorVersion. Using these fields we can very easily create computer groups based on OS and OS versions. Nice!
Creating groups in OMS is quite easy, and grouping by OS is no exception. Like everything in OMS, it’s all about knowing which fields to use for filtering and shaping views to display the output you are looking for. In this case, I want to create 2 top-level groups, 1 of Linux and 1 for Windows Computers. Additionally, I want to take it a bit further and create computer groups based on OS version. Let’s get started.
NOTE: If you are not getting Heartbeat data for Linux agents update the agent to the latest version and the issue should be resolved. You can find the Linux agent available for download here.
- Navigate to the Log Search page and enter the following query to display Heartbeat entries: Type=Heartbeat
- To filter the query by OS, add the following syntax to the query. In this case I am grouping all Linux computers: Type=Heartbeat OSType=Linux
- Now that I am only displaying computers with the OSType Linux, I am ready to create my group. To create a group, I simply pipe my query to filter by “Distinct Computer”: Type=Heartbeat OSType=Linux | Distinct Computer
- To create the computer group, select the save icon on the top left, fill out the name and category fields, select Yes to save the query as a computer group and select save. Click here for more detailed information about creating OMS computer groups.
- We now have a Linux Computers group which can be used for targeting queries. In the following example I am targeting a performance query for % Memory Used at the Linux Computers group.
- We can take it a step further and create groups based on OS version. In the following example I’m creating a Linux Computer Group for Ubuntu 15.10
- We simply use the same logic applied to create the Linux computer groups above to create Windows computer and OS version groups. We simply substitute OSType=Linux for OSType=Windows.