Archive | Operations Management Suite

Custom OMS Solution for Processor, Memory and Volume C utilization

I got a question if I could create a custom OMS solution that was collecting information about Processor, Memory and the Volume C on all servers. This is what I came up with.

2

1

To get started download my solution and import it through View Designer.

Download solution: ComputerUtilization 

To get data in to the solution go to Settings -> Data -> Windows Performance Counters and enable the following Counters.

6

 

Solution

More information how the Solution is built.

Processor

3

General
Group Title: Averaged Processor Utilization last 10 min

Title 1
Legend: Computers with average CPU over 90% utilization
Query: Type:Perf ObjectName=Processor CounterName=”% Processor Time” InstanceName=_Total TimeGenerated>NOW-10MINUTES | measure avg(CounterValue) by Computer | where AggregatedValue > 90

Title 2
Legend: Computers with average CPU over 80% utilization
Query: Type:Perf ObjectName=Processor CounterName=”% Processor Time” InstanceName=_Total TimeGenerated>NOW-10MINUTES | measure avg(CounterValue) by Computer | where AggregatedValue > 80 and AggregatedValue < 90

List
Query: Type:Perf ObjectName=Processor CounterName=”% Processor Time” InstanceName=_Total TimeGenerated>NOW-10MINUTES | measure avg(CounterValue) by Computer

Enable Thresholds
7-custom-oms-solution-for-processor-memory-and-volume-c-utilization

Memory

4

General
Group Title: Averaged memory utilization last 10 min

Title 1
Legend: Computers with average Memory over 90% utilization
Query: Type:Perf ObjectName=Memory CounterName=”% Committed Bytes In Use” TimeGenerated>NOW-10MINUTES | measure avg(CounterValue) by Computer | where AggregatedValue > 90

Title 2
Legend: Computers with average Memory over 80% utilization
Query: Type:Perf ObjectName=Memory CounterName=”% Committed Bytes In Use” TimeGenerated>NOW-10MINUTES | measure avg(CounterValue) by Computer | where AggregatedValue > 80 and AggregatedValue < 90

List
Query: Type:Perf ObjectName=Memory CounterName=”% Committed Bytes In Use” TimeGenerated>NOW-10MINUTES | measure avg(CounterValue) by Computer

Enable Thresholds
7-custom-oms-solution-for-processor-memory-and-volume-c-utilization

Navigation Query: Type:Perf ObjectName=Memory CounterName=”% Committed Bytes In Use” TimeGenerated>NOW-10MINUTES | measure avg(CounterValue) by Computer

Disk Volume C

5

General
Group Title: Disk volume C utilization in percentage last 10 min

Title 1
Legend: Disk volumes with less than 10% free space
Query: Type:Perf ObjectName=LogicalDisk InstanceName=”C:” CounterName=”% Free Space” TimeGenerated>NOW-10MINUTES | measure avg(CounterValue) by Computer | where AggregatedValue < 10

Title 2
Legend: Disk volumes with less than 20% free space
Query: Type:Perf ObjectName=LogicalDisk InstanceName=”C:” CounterName=”% Free Space” TimeGenerated>NOW-10MINUTES | measure avg(CounterValue) by Computer | where AggregatedValue < 20 and AggregatedValue > 10

List
Query: Type:Perf ObjectName=LogicalDisk InstanceName=”C:” CounterName=”% Free Space” TimeGenerated>NOW-10MINUTES | measure avg(CounterValue) by Computer

Navigation Query: Type:Perf ObjectName=LogicalDisk InstanceName=”D:” CounterName=”% Free Space” TimeGenerated>NOW-10MINUTES | measure avg(CounterValue) by Computer

0

Install Desired State Configuration on Linux system and connect it to Azure Automation

I received a question if it is possible to only install DSC for Linux servers without installing OMS agent as I do in my post Easy installation and registration script for OMS and DSC on Linux.

To install PowerShell DSC manually it is just to download the Open Management Infrastructure (OMI) agent from https://collaboration.opengroup.org/omi, and then PowerShell DSC from https://github.com/Microsoft/PowerShell-DSC-for-Linux.

But what if you want to install the components by a script? On the web there is a couple of ways to do this and this is my way. In my script I will download the OMS agent and then use the OMI package in there to install OMI that is needed for DSC on Linux. This is because there is no way to download the OMI package from OpenGroup with wget.

The script is using dpkg as installer and is tested on Debian and Ubuntu. To use it on systems that support rpm packages, change the dpkg and .deb files.

 

0

Add module in Azure Automation if DSC Configuration compilation fails

If you get the following error, see below, when compiling DSC Configuration in Azure Automation, it is probably because the module for the DSC Configuration is missing. In my example I need the “nx” module to compile the DSC configuration file. To solve the problem, add the module to the Azure Automation account.

Add module in Azure Automation if DSC Configuration compilation fails 1

Exception calling “NewScriptBlock” with “1” argument(s): “At line:4 char:5 + Import-DSCResource -Module nx + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The DSC engine could not load the module ‘nx’. It was not found on the system. At line:8 char:9 + nxPackage apache2Install + ~~~~~~~~~ Undefined DSC resource ‘nxPackage’. Use Import-DSCResource to import the resource. At line:15 char:9 + nxService apache2Service + ~~~~~~~~~ Undefined DSC resource ‘nxService’. Use Import-DSCResource to import the resource. At line:23 char:9 + nxFile apache2File + ~~~~~~ Undefined DSC resource ‘nxFile’. Use Import-DSCResource to import the resource.” (At line:4 char:5 + Import-DSCResource -Module nx + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The DSC engine could not load the module ‘nx’. It was not found on the system. At line:8 char:9 + nxPackage apache2Install + ~~~~~~~~~ Undefined DSC resource ‘nxPackage’. Use Import-DSCResource to import the resource. At line:15 char:9 + nxService apache2Service + ~~~~~~~~~ Undefined DSC resource ‘nxService’. Use Import-DSCResource to import the resource. At line:23 char:9 + nxFile apache2File + ~~~~~~ Undefined DSC resource ‘nxFile’. Use Import-DSCResource to import the resource.)

Add Module

Open the Azure Automation account and click Asset and then Modules.

Add module in Azure Automation if DSC Configuration compilation fails2

If you have a module package you can upload it to Azure Automation by clicking “Add a module” if it exists in the Gallery, you can download and install it from there. In my example I will click “Browse Gallery” and install it from there.

Add module in Azure Automation if DSC Configuration compilation fails3

Search for the module to install. In my example “nx”.

Add module in Azure Automation if DSC Configuration compilation fails4

Click the module to install and then “Import”.

Add module in Azure Automation if DSC Configuration compilation fails5

Now the module should be installed into the Azure Automation account and be ready to use.

Add module in Azure Automation if DSC Configuration compilation fails6

Try to compile the DSC Configuration file again to see if it works!

 

 

0

Install and configure an Apache web server on Linux with DSC and Azure Automation

This post will describe how to install an apache server, check that the apache service is running and configure the default web page with Desired State Configuration and Azure Automation. After deployed, I will show how to monitor that the configuration is not drifting with DSC in Azure Automation. This DSC service with Azure Automation works both for servers in the on-prem datacenter or at a public cloud provider.

The blog post will also show how to create an easy DSC Configuration file, add it so DSC in Azure Automation, and deploy it to a Linux computer. I will not show how to create an Azure Automation account or deploy the DSC agent. If you need help to deploy DSC on Linux, please see my blog post “Easy installation and registration script for OMS and DSC on Linux” where I install OMI, DSC and the OMS agent.

Get started

To get started we have to create a DSC Configuration file. Below is anexample that will deploy an Apache web server, check that Apache is running and that the web page looks like it should. To test this configuration save the below configuration in a file named DSCLinux01.ps1. This configuration uses the Apt package installer in Linux and is tested on Debian and Ubuntu.

When the configuration file is created go to the Azure Automation account and click DSC Configurations.

Install and configure an Apache web server on Linux with DSC and Azure Automation1

After entered the DSC Configuration click “Add a configuration file” and upload the file DSCLinux01.ps1.

Install and configure an Apache web server on Linux with DSC and Azure Automation2

 

Click on the “DSCLinux01” and then “Compile”. When the status is “Completed” it is time to deploy the configuration to a Linux computer.

Install and configure an Apache web server on Linux with DSC and Azure Automation3

Before the configuration can be deploy the DSC Configuration DSC needs to be installed on the Linux server that is going to use the configuration. See my blog post “Easy installation and registration script for OMS and DSC on Linux” where I install OMI, DSC and the OMS if you need help with this.

When DSC is installed and registered the server shows up under DSC Nodes. Click DSC Nodes and the server to deploy DSC configurations to.

Install and configure an Apache web server on Linux with DSC and Azure Automation4

Click Assign Node Configuration to be able to select the configuration you wish to use.

Install and configure an Apache web server on Linux with DSC and Azure Automation5

Select “DSCLinux01.apache2”.

Install and configure an Apache web server on Linux with DSC and Azure Automation6

Check that the configuration was selected in the “Node Configuration” section.

Install and configure an Apache web server on Linux with DSC and Azure Automation7

Now it is just to wait for the configuration to be added to the server. In the picture below one can see that the configuration has been added and checked that the server is compliant with the configuration file.

Install and configure an Apache web server on Linux with DSC and Azure Automation8

To check the end result, enter the IP or DNS for the server in a web browser to check if one can see the webpage. The result should look like this.

Install and configure an Apache web server on Linux with DSC and Azure Automation10

Let’s also make a quick check on the server to see the apache is installed and the service is started.

Install and configure an Apache web server on Linux with DSC and Azure Automation11

0

Easy installation and registration script for OMS and DSC on Linux

This is an easy Linux bash script to install and register OMS and DSC for Azure Automation. The script uses dpkg for installation of a .deb file so use it for Linux systems that can use the installation option.

Paste the script and save it into an install.sh file. Change the variables for the OMS and DSC installation and registration. Chmod the script with execution rights and then run it as ./install.sh.

Remember that the links in the script can change because of new agents.

 

1