Send data to OMS Log Analytics with Curl from a Linux server

Here is an example how to send data to OMS Log Analytics with Curl from a Linux server. I have created a bash script that creates everything that is needed for Curl to send data to OMS Log Analytics. Just add your Workspace ID and Workspace Key and try it out. Hope it is useful for you!

Save the following script, make the changes necessary and then run it.

The first time you run the script OMS Log Analytics will create Custom Fields for you based on your data input.

Send data to OMS Log Analytics with Curl from a Linux server1

After some time, you will see the first data from your script. As for now, the data record will not be complete from the beginning. But after some time, the data record  will be updated and all information will be shown. When you see the full data record, all the following record will have all information from the beginning without any delay.

Send data to OMS Log Analytics with Curl from a Linux server2

To get more information, please have a look at Microsoft documentation – https://docs.microsoft.com/en-us/azure/log-analytics/log-analytics-data-collector-api

0

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

4

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