mikebai.com

  • Home
  • dev
  • DotNET
  • M365
  • 搞笑
  • 杂七杂八
  • FocusDict
M365
M365

azure monitor monitoring process/监视进程

from: https://www.cloudsma.com/2018/07/adding-azure-log-analytics-performance-counters/ https://techcommunity.microsoft.com/t5/azure-monitor/monitoring-processes/m-p/250947# First, in your Azure Portal Log Analytics workspace, go to advanced settings, Data, Windows Performance Counters. Note you can do the same for Linux, but this example covers Windows. Click add to add the default suggested counters. You’ll see them added with purple lines, meaning they haven’t been saved to your workspace yet. Also note, depending on your subscription type, the sample rate can be as high as 10 seconds. You can certainly tune these to different intervals, just be aware that these are global settings. Adding Additional Counters

2020-11-23 0comments 117hotness 0likes mikebai Read all
M365

powershell add counter to log analytics worksapce

form https://www.cloudsma.com/2020/01/azure-monitor-alerting-at-scale-iaas/ In this post I will expand upon the methods I showed here and show you how I do IaaS Alerting in Azure Monitor. As a refresher I believe alerting at scale is: Programmatic Alert Creation Automatically adds/removes resources Having read my previous posts you’ll also know that I prefer a Log Analytics workspace for Metric alerts. I prefer this for a few reasons, which I’ll go into below. PowerShell Modules and Commands To create our alerts we’ll need the following modules: Az.Monitor Az.OperationalInsights We’ll also need the following commands:

2020-11-23 0comments 111hotness 0likes mikebai Read all
M365

powershell ExpandProperty和ExpandResource用法

ExpandProperty http://www.datawan.net/web/index.php/cloud/45-powershell-expandproperty As most of you already know the "-ExpandProperty" parameter let's you enumerate the values of an incoming object as single value.  For example, if you run the command below without the "-ExpandProperty". Get-AzLocalNetworkGateway -ResourceGroupName "network-rg" You will get output like this:↓↓↓↓↓ Name                     : my-lng ResourceGroupName        : network-pd-rg Location                 : southcentralus Id                       : /subscriptions/GUID/resourceGroups/network-pd-rg/providers/Microsoft.Network/localNetworkGateways/qco-houdc-lng Etag                     : W/"GUID" ResourceGuid             : GUID ProvisioningState        : Succeeded Tags                     : ・・・ GatewayIpAddress         : 4.50.4.28 LocalNetworkAddressSpace : {                              "AddressPrefixes": [                                "10.100.0.0/16",                                "10.101.0.0/16",                                "10.102.0.0/16",                                "10.103.0.0/16",                                "10.104.0.0/16",                              ]                            } BgpSettings              : null But what if you just want a simple list of all LocalNetworkAddressSpace?  You can use -ExpandProperty but the trick is you have to use it twice!  See sample below.  If you only pass it once you will still not get desired list, you must expand the properties two times because the expanded property is a list in this case. Get-AzLocalNetworkGateway -ResourceGroupName "network-rg" | Select -ExpandProperty LocalNetworkAddressSpace | Select -ExpandProperty AddressPrefixes | FT

2020-11-23 0comments 101hotness 0likes mikebai Read all
M365

powershell 使用hotmail id无法登录

https://stackoverflow.com/questions/39657391/login-azurermaccount-cant-login-to-azure-using-pscredential/39675182#39675182 Atf's answer has a point but however, this is not only the issue. We cannot directly sign in non-interactively using Hotmail or Outlook account. You must use domain of your account to sign in. See a similar issue posted in server fault : https://serverfault.com/questions/746557/add-azureaccount-unknown-user-type-unknown-user-type-on-azure-automation/746673 It mentions: Make sure the credential asset name (not username) is a simple string. Also make sure the credential asset username is a valid OrgID user (ex: abc@fdgdf.onmicrosoft.com), not a Microsoft / Live account (joe@gmail.com).

2020-11-20 0comments 108hotness 0likes mikebai Read all
M365

log performace 指标说明

性能测试工具LoadRunner32-LR之windows性能监控Perfmon Perfmon是啥?   Perfmon提供了图表化的系统性能实时监视器、性能日志和警报管理,可以用于监视CPU使用率、内存使用率、硬盘读写速度、网络速度等   性能分析方法  内存分析方法   内存分析用于判断系统有无内存瓶颈,是否需要通过增加内存等手段提高系统性能表现。   主要方法和步骤:   1.首先查看Memory:%Committed Bytes in Use指标     如果该指标比例比较大,系统可能出现了内存方面的问题,需要继续下面步骤进一步分析。另外也可以查看Available Bytes,如果该值小说明可用内存不足,存在性能瓶颈。   2.注意Pages/sec、Pages Read/sec和Page Faults/sec的值     操作系统会利用磁盘较好的方式提高系统可用内存量或者提高内存的使用效率。这三个指标直接反应了操作系统进行磁盘交换的频度。     Pages/sec值持续高于几百,可能有内存问题。Pages/sec值不一定大就表明有内存问题,可能是运行使用内存映射文件的程序所致。     Page Faults/sec说明每秒发生页面失效次数,页面失效次数越多,说明操作系统向内存读取的次数越多。此时需要查看Page Read/sec的计数值,该计数器的阀值为5,如果计数值超过5,则可以判断存在内存方面的问题。   处理器分析方法   1.首先看System:%Total Processor Time性能计数器的计数值      该计数器的值提现服务器整体处理器利用率,对多处理器的系统而言,该计数器提醒所有CPU的平均利用率。如果该值持续超过90%,则说明整个系统面临着处理器方面的瓶颈,需要通过增加处理器来提高性能。   2.其次查看每个CPU的%User Time     %User Time是系统非核心操作消耗的CPU时间,如果该值较大,可以考虑是否能通过友好算法等方法降低这个值。如果该服务器是数据库服务器,%User Time值大的原因很可能是数据库的排序或是函数操作消耗了过多的CPU时间,此时可以考虑对数据库系统进行优化。    3.研究系统处理器瓶颈      查看System:Processor Queue Length计数器的值,当该计数器的值大于CPU数量的总数+1时,说明产生了处理器阻塞。在处理器的%Process Time很高时,一般都随处理器阻塞,但产生处理器阻塞时,Processor:%Processor Time计数器的值并不一定很大,此时就必须查找处理器阻塞的原因。    磁盘I/O分析方法   1.计算每磁盘的I/O数     每磁盘的I/O数可用来与磁盘的I/O能力进行对比,如果经过计算得到的每磁盘I/O数超过了磁盘标称的I/O能力,则说明确实存在磁盘的性能瓶颈。

2020-11-20 0comments 109hotness 0likes mikebai Read all
M365

cpu负荷测试工具和使用方法

通过cpuburn工具可以对CPU内核进行压力测试。 支持系统: Linux (32-bit)、Linux (64-bit)、Windows 工具官网地址:  https://patrickmn.com/projects/cpuburn/ 使用案例: 以CentOS 6.5 64bit为例使用cpuburn工具,进行CPU的压力测试,并查看CU中的CPU监控图。 1.下载解压工具 *Linux 64 bit OS下载方式 wget https://cdn.pmylund.com/files/tools/cpuburn/linux/cpuburn-1.0-amd64.tar.gz * Linux 32 bit OS 下载地址 https://cdn.pmylund.com/files/tools/cpuburn/linux/cpuburn-1.0-i386.tar.gz *Windows OS下载地址 https://cdn.pmylund.com/files/tools/cpuburn/windows/cpuburn-1.0.zip -----------------------------测试方法----------------------- windows 拷贝执行文件到测试电脑执行即可   linux #执行以下命令 sudo su - mkdir -p -m 777  /usr/hakutest; cd /usr/hakutest/ wget https://cdn.pmylund.com/files/tools/cpuburn/linux/cpuburn-1.0-amd64.tar.gz ls tar xvzf cpuburn-1.0-amd64.tar.gz ls cd /usr/hakutest/cpuburn/ # 执行 ./cpuburn Burn all available cores ./cpuburn -n 2 Burn two cores ./cpuburn -n 2 -u 5 Burn two cores, sending an update every five seconds 内存 1.LINUX环境下测试 sudo su - mkdir -p -m 777  /usr/hakutest; cd /usr/hakutest/ wget http://pyropus.ca/software/memtester/old-versions/memtester-4.2.2.tar.gz ls tar xvzf memtester-4.2.2.tar.gz ls cd /usr/hakutest/memtester-4.2.2 / # 执行安装 make && make install # 会生成一个memtester文件的,然后运行: # memtester [-p PHYSADDR] <MEMORY> [ITERATIONS] # MEMORY 申请测试内存的数量,单位默认是megabytes(兆),也可以是B K M G # ITERATIONS 测试的次数,默认是无限 ./memtester 2048 10 https://blog.csdn.net/cangencong/article/details/74328944 用法 ./shell.sh 4 (4为4内核) 查看cpu内核数量 > lscpu 执行后会出现一堆kill命令,方便kill掉进程 #!/bin/bash   endless_loop()   {   echo -ne "i=0;  while true  do  i=i+100;  i=100done" | /bin/bash &   }   if [ $# != 1 ]; then   echo "USAGE: $0 <cpus>"   exit 1;   fi      for i in `seq $1`   do   endless_loop   pid_array[$i]=$!;   done      for i in "${pid_array[@]}"; do   echo 'kill' $i ';';   done   shell消耗内存 以前有过[shell消耗cpu][1]的文章,再记录一个shell消耗内存代码。 #!/bin/bash   mkdir /tmp/memory   mount -t tmpfs -o size=1024M tmpfs /tmp/memory   dd if=/dev/zero of=/tmp/memory/block   sleep 3600   rm /tmp/memory/block   umount /tmp/memory   rmdir /tmp/memory   用tmpfs文件系统占用内存一个小时

2020-11-18 0comments 123hotness 0likes mikebai Read all
M365

connect vm to log analytics workspace

https://docs.microsoft.com/en-us/azure/virtual-machines/extensions/oms-windows PowerShell deployment The Set-AzVMExtension command can be used to deploy the Log Analytics agent virtual machine extension to an existing virtual machine. Before running the command, the public and private configurations need to be stored in a PowerShell hash table. PowerShell $PublicSettings = @{"workspaceId" = "myWorkspaceId"} $Prot

2020-11-18 0comments 112hotness 0likes mikebai Read all
M365

powershell Collect Event and Performance Data in Log Analytics

Today we continue with the Log Analytics post series. In the previous posts of this series, I showed you how to create a workspace for log analytics and how to deploy the log analytics. In this post, I will show you how to collect logs and metrics from VMs in your Log Analytics Workspace using Azure PowerShell. Prerequisites The Az.OperationalInsights module version 1.0.0 or later 

2020-11-17 0comments 93hotness 0likes mikebai Read all
M365

Log Analytics でSyslogのデータを収集してみた

■今回事前準備する環境 ・監視対象のマシン(今回はcentos7.5) ・OMS ワークスペース ■設定手順 (1)Log Analytics の[詳細設定]をクリックし、[Data]⇒[Syslog]をクリックします。 (2)その後、[次のファシリティからSyslogを収集]にチェックを入れて有効にし、[監視するファシリティの名前を入力]の検索欄で、監視するファシリティの名前を入力し、+ をクリックし設定していきます。 設定完了後、左上の[Save]をクリックし保存します。 本設定を行うことで、しばらくすると自動的にrsyslogの構成ファイル(

2020-11-16 0comments 115hotness 0likes mikebai Read all
M365

powerapps 画板大小设置

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/set-aspect-ratio-portrait-landscape https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/create-responsive-layout https://powerapps.microsoft.com/en-us/blog/craft-app-height-and-width-expressions-to-create-responsive-canvas-apps/ If you’ve built canvas apps using PowerApps, you’ve noticed that one of the first decisions you need to make is whether you want a layout that is tailored for a phone or for a tablet. This choice will determine the size and shape of the canvas you will work with while building your app. If your app is used on a device of a different size (or on the web), your entire layout is scaled larger (or smaller) to fit the screen where it is running. If an app designed for a phone is run in a large web browser window, for example, it appears almost comically oversized for its space. It can’t take advantage of all those additional pixels, by showing more controls or more content. With this new update, experienced app makers can now transform apps into a responsive experience through some work with expressions. You must write formulas that adapt the size and position of controls based on the size of the screen at runtime which is now able to be referenced in the app. You’ll be able to adapt the layout of each of your screens to the actual space in which they are running. As a result, screens show more information with more appropriate font sizes, all making for a better app experience. Turn off Scale to Fit As responsiveness is not yet the default for canvas apps, you will need to disable the current default fixed size behavior. Navigate to App settings > Screen size and orientation, then  turn the Scale…

2020-09-26 0comments 112hotness 0likes mikebai Read all
1…45678…11

Recent Posts

  • c# winform适配高dpi
  • com.microsoft.sqlserver.jdbc.SQLServerException “trustServerCertificate”属性设置为“false”,但驱动程序无法使用安全套接字层 (SSL) 加密与 SQL Server建立安全连接
  • java -cp 用法介绍
  • HTML 容器元素
  • MVC的cshtml的介绍

Recent Comments

No comments to show.

COPYRIGHT © 2025 mikebai.com. ALL RIGHTS RESERVED.

Theme Kratos Made By Seaton Jiang