Author Archive | Jonathan

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

Remove Azure Classic Blobs that are in Leased State “Leased” and Lease Status “Locked”

In this post I will post the PowerShell commands you can run to remove a blob file in an Azure Classic storage container that are in Leased State Leased and Lease Status Locked. There are some scripts out there to set all the files to Broken Lease State but this commands will only do it to one blob at the time.

Remove Blobs that are in Leased State Leased and Lease Status Locked 1

Picture 1: Shows a blob at Lease Status “Locked” and Lease State “Leased”.

Script to change the at Lease Status “Unlocked” and Lease State “Broken”.

Remove Blobs that are in Leased State Leased and Lease Status Locked 2

Picture 2: Shows a blob at Lease Status “Unlocked” and Lease State “Broken”.

To remove the blob with PowerShell one can run the following commands.

 

0

DSC for Linux example – application installation and configuration with bash script

In the following example I will show how to install the “ocsinventory-agent” package on an Ubuntu server and then pull the Inventory on the server to a file in a created directory “/var/log/ocsinventory”. This will be done by a bash script. The DSC configuration works fine but is still under testing so please give me feedback if something could be done in another way. It is tested with Azure Automation DSC as a pull server.

DSC Configuration file

Just copy and pasted the script to a PowerShell file (ps1).

 

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