The change is triggered in VCenter via PowerCLI

Good afternoon everyone, I am trying to automate the change of an alarm with VCenter 5 trigger.  Currently when users use 75% or more the storage on the local hard disk, I get an alarm for "Datastore Disk use.  I want to change the warning from 75% to 85% and the alert from 85% to 90%.  I have been using VSphere PowerCLI for many tasks for adding and configuring the hosts and their storage, networks, dns, etc...  So, I understand the basics.  I can't understand how to do something else then get the name of the alarm.  Any help would be appreciated.

Hello, ThatMattGuy-

You can change an element of the alarm using the API.  You should be able to use the following to update the caveat - and the percentages of trigger alert at 85% and 90% respectively by using:

## get the .NET View object for the Alarm of the given name$viewAlarmToUpdate = Get-View -Id (Get-AlarmDefinition -Name "Datastore usage on disk").Id

## copy the existing AlarmInfo item from the current alarm definition$specNewAlarmInfo = $viewAlarmToUpdate.Info

## update the two desired properties on the MetricAlarmExpression (http://pubs.vmware.com/vsphere-50/index.jsp?topic=/com.vmware.wssdk.apiref.doc_50/vim.alarm.MetricAlarmExpression.html)$specNewAlarmInfo.Expression.Expression[0].yellow = 8500$specNewAlarmInfo.Expression.Expression[0].red = 9000

## reconfigure the alarm with the new threshold values$viewAlarmToUpdate.ReconfigureAlarm($specNewAlarmInfo)

It takes AlarmInfo to the definition of existing alarm, updates the two values you mentioned and the uses of the method ReconfigureAlarm() of the alarm.

And, then to display the new values, you check the definition of alarm triggers tab in vCenter, updating the view on the object data and echoing, as:

## update the View object$viewAlarmToUpdate.UpdateViewData("Info")## display new values for the alarm$viewAlarmToUpdate.Info.Expression.Expression[0]

How do I?

Tags: VMware

Similar Questions

  • How to calculate the IOPS datastore / s and latency via Powercli?

    Hi all!

    I want to calculate the IOPS / s (RO/RW) and the latency of the data via Powercli store, but I cant' find this metric in Vcenter (in the data store tab) and see no metric for data via the cmdlet Get-Stat store.

    How can we measure IOPS / s and latency of data store?  For example I know veeam monitor this information - http://cdn.swcdn.net/creative/v16.8/images/screenshots/products/VM/Lg/EN/VMan60-Orion-Datastore-Top_Lg_960x540.jpg

    I know, I can get this VM or vmhost metric, but I need information on the data store.

    How to measure for IOPS / s and latency of data properly store?

    Thanks in advance!

    These measures are collected on ESXi nodes, entity would need to have the ESXi nodes where these data warehouses are connected.

    You can use the Instance property to filter.

    Under the PerformanceManager , you see all the measures for each indicator it indicates under which entity this metric is collected.

    And Yes, the cmdlet Get-inventory returns no data warehouses.

    There is a little, aggregated metric for data warehouses, I'll have to find an alternative for those.

    Nice catch!

  • How to calculate the CPU Ready on Cluster DRS via Powercli?

    Hi all!

    I have a DRS Vsphere cluster. I want to know what is the value of the loan of CPU I have in my group.

    For example, I get 20% of powercli value, it is normal for the cluster, but if I have 100% or more, I have a problem.

    How to achieve via Powercli? And how to calculate the percentage values correctly?

    I know, I can get all values of CPU Ready of VMs cluster, but IT is not the same thing, I need overall value of CPU Ready.

    Thanks in advance!

    As far as I know you can get the cpu.ready.summation for ESXi nodes or VMs.

    For a cluster, you will need to get the value of each node in the cluster ESXi and then take the average.

    The metric cpu.radey.summation is expressed in milliseconds.

    To get a percentage, you need to calculate the percentage of loan period during the interval during which it was measured.

    Something like this (this will give the loan current %)

    $clusterName = "mycluster.

    $stat = "cpu.ready.summation".

    $esx = get-Cluster-name $clusterName | Get-VMHost

    $stats = get-Stat-entity $esx - Stat $stat - Realtime - MaxSamples 1 - forum «»

    $readyAvg = $stats | Measure-object-property - average value. Select - ExpandProperty average

    $readyPerc = $readyAvg / ($stats [0].) IntervalSecs * 1000)

    Write-Output "Cluster $($clusterName) - CPU % loan $(' {0:p}'-f $readyPerc).

  • Extract alarm VCenter via PowerCLI

    Nice day!

    I have a script which collects VCenter alarms and inform me by e-mail. It collects the alarm of VM, host, the data centers with clusters, etc. But I had the alarm to the VCenter. I can't find how to extract using PowerCLI. Invites, who face this problem.

    vmware.png

    Level vCenter alarms can normally be recovered through the folder hidden data centers.

    Use the entity returned by 'Get-file-name data centers'

  • Get the storage you use of a via powercli virutal machine

    Is there a oneliner where I can get the storage you USE a virtual machine?

    example:

    windc configured server used 100 GB 55GO

    I'd like to type something like: get - vm winDC |   Get-usedstorage

    and I want to go 55GO

    I wasn't able to find a good word

    Something like that?

    Get - VM | Select Name, UsedSpaceGB

  • Define the IP addresses on guest via PowerCLI RHEL 6 OS?

    I try the IP address subnet value and the gateway on RHEL6 Guest OS via PowerCLI. Howerver his failure with "bash: / tmp/powerclivmware0: permission Denied"

    $NetInt = get-VMGuestNetworkInterface - VM $VM. VMName - GuestUser $USR - GuestPassword $PWD

    Game-VMGuestNetworkInterface - VMGuestNetworkInterface $NetInt - $USR - GuestPassword $PWD - Ip $VM GuestUser. $VM.Netmask - IP-Gateway $VM subnet mask. Gateway - Dns $DNS1, DNS2 $

    It works fine on RHEL5 but not RHEL6.

    Does anyone have experience with this works for RHEL6 get? Any help would be appreciated!

    Model Security Configurations has problem.

    This occurs if the permissions to run executable files are denied to /tmp/

    Problem solved.

  • Help, I changed the password of root ESXi via powerCli, now I can not connect with the web client or the console.

    Help, I've changed the root ESXi via powerCli password, now I can not connect with the web client or the console, but I can still connect to powerCli. The command I used was;

    SE connect-VIServer esxihostname-user root - password newpasswd

    This production network btw, I have connected to each host and run the above command, these ESXi hosts are not on a domain

    y at - it something I have left out. I really appreciate any assistance that you people can provide.

    Thank you, Joe

    It is probably a longshot, but a lot of things in the land of windows is not sensitive to capital letters as Unix is.  I wonder if your new password you put through powerCLI mixed uppercase in it and if the capitalization was abandoned by command windows powerCLI Analyzer, or he interpreted as all capitals or something.   If you can still get through the powerCLI you could try to reset the password again to something simple without capitalization mixed case and if your password on ESXi strategy requires a special character, try something different than a "$", like a "_" (I find that a '_' is less likely than some other special characters (, as a '-' or a ' / ' to cause problems with analyzers.).

    Edit:

    Another thing, you can try before playing with the password once again, is to create a different username ESXi using powerCLI and see if the password ends up what you think, it should be, and if you can get with the client vsphere using it.  In this way, you can find out if there are some problems with certain characters or Cap through command powerCLI Analyzer without losing your remaining root by powerCLI access.  After some tests, you can understand what went wrong with your initial password change and may be able to fix it with less risk of losing access.  I also assume that you can not create a new username on ESXi who is able to change the root password no matter what authority give you it, otherwise, you could create a new username with PowerCLI, then connect to the client vsphere with it and change the password to root from there.

  • Cannot connect esx host or vcenter server via powercli (cannot run the cmdlet Connect-VIServer)

    Dear team,

    Once I opened powercli windows, I m unablwe to connect the ESX host or vcenter server, it gives me the following error... Help, please

    scp.JPG

    concerning

    Mr. VMware

    Hello, MrVmware9423-

    It seems that this may have to do with the .NET Framework is installed on the computer on which you run PowerShell/PowerCLI.  Take a look at http://communities.vmware.com/message/2174319 - users have been able to solve the problem with a newer version of the .NET Framework (v2, installed v3.5 - success).

    Because your problem seem (you use a? 2 version of .NET, and you're able to install a newer version)?

  • How to change the MOB OpenManage integration for vCenter Server registration

    A few months back, I've updated our installation of the vCenter for v2 plugin, now called OpenManage integration for vCenter Server. When you perform the upgrade, we have kept the old base done vs a new installation. During the upgrade process, we deployed the new device under a new name of the computer.

    Everything works well except that we noticed an annoying thing. Registration of the plugin is the former name of the server instead of the name of the new server-oriented. It is validated by looking at the web page MOB: http://vcenter Server/fmt drilling then down through:

    Content--> Extension Manager--> extensionList ["com.dell.plugin.OpenManage_Integration_for_VMware_vCenter"] --> server--> URL string

    The configuration of the appliamnce shows the correct new name of the device and the administration console is accessible via the new name for the device. The only place where we see the old name of the device is in the MOB config.

    We tried to remove the plugin and added, but still cannot change the value of server URL to reflect the new name of the device. Until we solve this problem, I work around the problem by keeping just the DNS entry for the old name of the server in DNS.

    Anyone know who to change the property MOB for the URL of the server?

    I solved the problem.

    I found the following article that shows how to upgrade the extension. I just cut and paste into my current values with the URL of update and now all is good.

    http://KB.VMware.com/selfservice/microsites/search.do?cmd=displayKC&docType=kc&externalId=2060127&sliceId=1&docTypeID=DT_KB_1_1&dialogID=236869583&StateID=0%200%20236885165

  • VMware tools take it apart or modify the parameters of CD-Rom via PowerCLI

    Hello

    My problem:

    After the upgrade invited on Redhat Linux vmware tools vmware tools remain in the properties of the vm.

    I mean that the device vm: CD-Rom drive is configured to store data-ISO file [/vmimages/tools-isoimages/linux.iso]

    The CD-ROM drive is not connected!

    I can't Vmotion of such systems.

    Is there a way to define the type of device clientcdrom to 'clientdevice' via PowerCLI?

    I checked some commands powercli: set-cddrive, dismount-tools


    With the powerclie cmd:

    Get - vm GuestName | Get-cddrive

    I am able to locate systems that have the problem.

    Output:

    IsoPath RemoteDevice HostDevice
    -------              ----------                             ------------
    [] / vmimages/tool...

    Via Vsphere Client, I am able to change the iso data store config in clientdevice.

    and change the mode to emulate ide to ide pathtrough (recommended)

    -> A chip solution would be to automate tasks via powercli this 2.

    2 screenshots:

    vmware-tools_cdrom1.jpg

    vmware-tools_cdrom2.jpg

    Has anyone automated this 2 tasks via powercli

    Hi, George,

    I think NoMedia - Set-CDDrive switch, it's what you need - it Peel host device or iso file.

    Get - VM | Get-CDDrive. Game-CDDrive - NoMedia-confirm: $false

    Kind regards

    Vitali

    Team PowerCLI

  • How can I change text size and point via the command prompt?

    I want to create a script that will allow me to easily change to or from my TV to my monitor. I know how to change the display, but I don't know how I can change the size of text and point via the command prompt (that is, from 100% to 150%). Does anyone know how?

    Unfortunately, you can not.  In addition, change the DPI requires reboot (or logout and back).  But you can apply a different theme, that you can call from the command just by opening the .themepack file.  Since themes can control the size of some elements of the police who might do the trick you are looking for.

  • Change the settings for Conversion of PDFCreator via GPO

    Hello.

    I wonder if there is a way to change the settings of Conversion of PDFCreator via GPO.  Specifically, I need to change the setting that automatically converts email to PDF Portfolios instead of a standard PDF file.

    Hello

    You need to do this, use Adobe Customization Wizard. Please follow the link below to check the details for the wizard.

    Acrobat-Reader Toolkit Enterprise Edition family

  • Collect information of the NIC via PowerCLI

    Hi all

    We need to collect the following information about all the cards in all hosts via PowerCLI:

    -name

    -manufacturer

    -version of the driver

    -firmware version

    -MAC address

    We know the esxcli method, but it would take a lot of time that we have many hosts and they would send an alarm to deactivate the lock mode and activating SSH and it would be extremely long and inefficient.

    While Google search, we found this method through Get-EsxCLI (http://jreypo.wordpress.com/tag/powercli/), but for some reason that I can not even list the NICs.

    PowerCLI C:\Program Files (x 86) \VMware\Infrastructure\vSphere PowerCLI > $esxcli = Get-EsxCli - vmhost host

    PowerCLI C:\Program Files (x 86) \VMware\Infrastructure\vSphere PowerCLI > $esxcli.system.module.get

    TypeNameOfValue: VMware.VimAutomation.ViCore.Util10Ps.EsxCliExtensionMethod

    OverloadDefinitions: {vim. Get EsxCLI.system.module.get.ModuleDetails (string module)}

    MemberType: CodeMethod

    Value: vim. Get EsxCLI.system.module.get.ModuleDetails (string module)

    Name: get

    IsInstance: true

    PowerCLI C:\Program Files (x 86) \VMware\Infrastructure\vSphere PowerCLI > $esxcli.system.module.list

    TypeNameOfValue: VMware.VimAutomation.ViCore.Util10Ps.EsxCliExtensionMethod

    OverloadDefinitions: {vim. EsxCLI.system.module.list.Module [] list (boolean active, responsible boolean)}

    MemberType: CodeMethod

    Value: vim. List of [] EsxCLI.system.module.list.Module (active boolean, boolean loaded)

    Name: list

    IsInstance: true

    PowerCLI C:\Program Files (x 86) \VMware\Infrastructure\vSphere PowerCLI > $esxcli.network.nic.list

    TypeNameOfValue: VMware.VimAutomation.ViCore.Util10Ps.EsxCliExtensionMethod

    OverloadDefinitions: [] list() {vim.EsxCLI.network.nic.list.Nic}

    MemberType: CodeMethod

    Value: vim.EsxCLI.network.nic.list.Nic [] list()

    Name: list

    IsInstance: true

    Can someone help me? Thanks in advance!

    Add parentheses to the method call

    $esxcli.network.nic.list)

  • Run the package in Guest remotely via PowerCLI

    Hi all

    I'm sure that I came across a script that can run a batch file in Windows remote clients using PowerCLI, but for the life of me I can't find it.

    I have 4 Windows VMS, who have the same connection credentials, they have a test.bat file in the same place, I need a way to execute commands remotely via PowerCLI simultaneously, is - it possible?

    It seems that the sqlio command is not found. May be that the directory is not in the Path variable in this OS.

    Try again with the full path to the executable sqlio.

  • The host system resources / booking via PowerCLI

    Hello chaps,

    Does anyone know if it is possible to adjust the CPU and the memory that is reserved for a host via PowerCLI?

    (Home > Configuration > Allocation of system resources > edit)

    I usually affect the reserve memory 800 MB and CPU 800 MHz according to the design best practices.

    Thank you


    Dan

    As far as I know, there's no cmdlet for this, but you can use the UpdateSystemResources method.

    You just need to know that the key to the Scriptures "host/system".

    $esx = Get-VMHost MyHost 
    
    $spec = New-Object VMware.Vim.HostSystemResourceInfo $spec.key = "host/system" $spec.Config = New-Object VMware.Vim.ResourceConfigSpec$spec.Config.cpuAllocation = New-Object VMware.Vim.ResourceAllocationInfo$spec.Config.cpuAllocation.reservation = 800$spec.Config.memoryAllocation = New-Object VMware.Vim.ResourceAllocationInfo$spec.Config.memoryAllocation.reservation = 800$spec.Config.ChangeVersion = $esx.ExtensionData.SystemResources.Config.ChangeVersion
    $esx.ExtensionData.UpdateSystemResources($spec)
    

Maybe you are looking for