Get alarms and change default values

My question is two really, I was just read the previous thread http://communities.vmware.com/thread/230786?tstart=0 and I was wondering how to get the list of existing alarms, after have stuck in the SDK for awhile, I thought I would ask experts.

I see how they relate to the CROWD, but can not put it in the code.

Also, is there a way to modify each alarm 5 by default that are created to add an action to send a snmp trap?

Thank you

Alan Renouf

http://Virtu-al.NET/

The first part of your question is easy.

The following script will display just the name of the alarm, but you can find all the properties in the object of the alarm ($t variable).


$serviceInstance = get-view ServiceInstance

$alarmMgr = get-view $serviceInstance.Content.alarmManager

$alarms = $alarmMgr.GetAlarm($null)
$alarms | %{
     $t = Get-View -Id $_
     Write-Host $t.Info.Name
}

For the 2nd part of the question, yes you can change the preset alarms (as you can from the VIC).

You'd use the ReconfigureAlarm method to do this.


$predefined = "Host connection state","Host CPU Usage","Host Memory Usage","Virtual Machine CPU Usage","Virtual Machine Memory Usage"

$serviceInstance = get-view ServiceInstance

$alarmMgr = get-view $serviceInstance.Content.alarmManager

$alarms = $alarmMgr.GetAlarm($null)
$alarms | % {
     $alarm = Get-View -Id $_
     if($predefined -contains $alarm.Info.Name){
          $spec = New-Object VMware.Vim.AlarmSpec
          $spec.Action = New-Object VMware.Vim.GroupAlarmAction
          $spec.action.action = @(New-Object VMware.Vim.AlarmTriggeringAction)
          $spec.Action.Action[0].action = New-Object VMware.Vim.SendSNMPAction
          $spec.Action.Action[0].Green2yellow = $true
          $spec.Action.Action[0].Red2yellow = $false
          $spec.Action.Action[0].Yellow2green = $false
          $spec.Action.Action[0].Yellow2red = $true
          $spec.Name = $alarm.Info.Name
          $spec.Description = $alarm.Info.Description
          $spec.Expression = $alarm.Info.Expression
          $spec.Enabled = $alarm.Info.Enabled
          $spec.Setting = $alarm.Info.Setting

          $alarm.ReconfigureAlarm($spec)
     }
}

Alarms, listed in $predefined, will now send an SNMP trap when the State goes from green to yellow and when the State goes from yellow to red.

Tags: VMware

Similar Questions

  • Windows Vista Photo Gallery - change default values

    I would like to change the default check mark when printing in the library. The default seems to tick the box 'adapt to the chassis. I would like to make the default value to leave out the check in the box. Sounds easy... but I have not found a way.
    Any help appreciated.
    Harry

    Hi harry015,

    What exactly happens when you try to print the photos?

    There is no option to save the changes to uncheck the option adjust to the photo frame and it goes back to default whenever you launch printing.

    Because your problem is by design, I would recommend leaving your comments to the following address:

    http://connect.Microsoft.com

    Hope this information is useful.

    Boumediene. K.
    Microsoft Answers Support Engineer
    Visit our Microsoft answers feedback Forum and let us know what you think.

    If this post can help solve your problem, please click the 'Mark as answer' or 'Useful' at the top of this message. Marking a post as answer, or relatively useful, you help others find the answer more quickly.

  • Update and change the values when VI is running

    Hello everyone! I have a digital control slider and I want to be able to change and update the value when Vi is running. Can I use the property for this node?

    If it is a CONTROL (no), then it is for the user to set the value via mouse / keyboard.

    You can still set the value via the NŒUD of PROPERTY or the LOCAL VARIABLE for ALL controls.

    What difficulty do you observe?

  • change default value of newtab

    I just want my homepage appears on new tabs, not the tiles of history. I don't understand why Firefox doesn't do this as simple as selecting a default home page. It could be easily done right to the general or the search tabs in the options. Looks like a reasonable scale to ask.

    On Firefox 41.0.1 there is no "browser.newtab.url" in subject: config at least on mine. I tried to fix this using existing message/question strings and the man refer to 'browser.newtab.url '. I would like to solve it this way, but this selection is just not for me.

    There is only browser.newtabpage.directory.source

    and

    Only browser.newtabpage.directory.Ping

    I changed both to https://duckduckgo.com and still get the tiles.

    I don't want the tiles. I want to just my homepage.

    No help available on this?

    Hi, 41 of Firefox, you must use an add-on like tab override (browser.newtab.url replacement), to make changes to the page tab.

    Once installed, open the Add-ons (Ctrl + Shift + A) Manager > Extensions, and then look for the new tab override and click Options to set your preference.

    Note, if you want only the new tab to be the same as your home page, you can use the Add on new tab homepage instead.

    You will then need to restart Firefox for all changes to take effect.

    If your question is resolved by this or another answer, please take a minute to let us know. Thank you.

  • fast_start_mttr_target has NOT changed default value

    I had a raccheck on my new installed RAC nodes. Operating system is linux redhat, oracle version is 11.2.0.3.

    raccheck has one results: fast_start_mttr_target has NOT been changed from default.

    Our current system not migrated for fast_start_mttr_target have not been configured.

    We need to set this?

    The fast_start_mttr_target allows you to specify the number of seconds that takes to the database to perform crash recovery. You must assign the optimal value.

    See link below before setting this parameter
    http://docs.Oracle.com/CD/B13789_01/server.101/B10734/rcmtunin.htm#1008706

    Concerning
    http://www.oracleracexpert.com
    Oracle Flashback - Oracle Total Recall data archive
    http://www.oracleracexpert.com/2012/06/Oracle-flashback-data-archive-Oracle.html
    Backup and restore MySQL database
    http://www.oracleracexpert.com/2012/06/backup-and-restore-MySQL-database.html

  • I have 4 individual signatures on file, but all I get is the marked default value of a

    Original title: have 4 signatures on file to use WL Mail - you want to access according to e / message and not the default every time.

    I have 4 individual signatures on file, but all I can get is by default marked one?

    TKU,

    Jack C.

    Hello

    Windows LiveMail has its own Forums, so you can ask your questions there.

    Windows Live Mail - Forums
    http://windowslivehelp.com/forums.aspx?ProductID=15

    Windows Live Solution Center - Solutions mail - Mail Forums
    http://windowslivehelp.com/

    Windows Live Mail - mail Solutions
    http://windowslivehelp.com/solutions.aspx?ProductID=15

    I hope this helps.

    Rob Brown - MS MVP - Windows Desktop Experience: Bike - Mark Twain said it right.

  • Help - desperate font DW will not change default value

    Help me please! I have a major problem with the fonts in DW 8. I can't change the default setting. I uninstalled and reinstalled DW 8 nothing works. Somebody save me please? I think it could be a corrupted DLL. All my fonts work in other Adobe applications

    Thanks Gary! He was disabled and when I checked it worked and he was back to normal. I'm so happy, it was an easy fix. Thanks again

  • Change default value of output format you 'Keynote 09 '.

    Hi all

    I use Keynote 6.6.2 and I need your help to know how to use the 'Keynote ' 09"as the default output format, without an export each time.

    In my company, I'm the only one with this version of Keynote, if no one else can use my files and allows us to work on the same files really often!

    Thank you for helping me.

    Kind regards

    Nicolas

    The only way to create 09 files from Keynote 6.6.2 is to use file > export > Keynote 09

  • Windows 8 will not open .exe from the drive of installation and the default value of internet explore

    Hope someone can help me please

    I bought a new laptop with windows 8, and when I try to install my software AVG anti-virus from the disk, the exe file opens in internet explore
    Thank you
    Diarra

    Windows 8 is already bundled with Antivirus and AntiSpyware utility called Windows Defender. In addition to the security features built into your laptop Windows 8.

    -Operating system Secure Boot Boot/Trusted - cannot be falsified

    -Start of Anti-Malware Scanning

    -Antivirus/Anti-Spyware - Windows Defender

    -Filter sieve Smart Windows

    -Address Space Layout Randomization (moves around the operating system at startup code deceive malware).

    Kernel - kernel Patch guard - cannot be falsified

    -User Account Control - impossible to accidentally install unwanted programs

    -HeapStack protection - prevents the buffer overflows

    -Device Driver signature

    -Safe_mode in Internet Explorer

    Add these with a little common sense and you should have a system even more secure.

    A glance to the use of Windows Defender on Windows 8

    With regard to the .exe create open in Internet Explorer, try to reset the default file association.

  • How to get higher and second higher value of a line?

    Hello world

    I want more solid and second upper sal from emp in a line,

    Thank you

    Hello

    Whenever you have a problem, after the results you want.
    Always tell what version of Oracle you are using.

    Are you looking for this?

    HIGHEST_SAL SECOND_HIGHEST_SAL
    ----------- ------------------
           5000               3000
    

    If so, follow these steps:

    WITH     got_r_num     AS
    (
         SELECT     sal
         ,     ROW_NUMBER () OVER (ORDER BY sal DESC)     AS r_num
         FROM     scott.emp
    )
    SELECT     MAX (CASE WHEN r_num = 1 THEN sal END)     AS highest_sal
    ,     MAX (CASE WHEN r_num = 2 THEN sal END)     AS second_highest_sal
    FROM     got_r_num
    ;
    

    It works in Oracle 9 (and), but can easily be adapted for Oracle 8.1.
    From Oracle 11, you can also use SELECT... PIVOT.

    It is unclear how you want to handle links. Say there were only 3 rows, with 100, 200 and 200 sals. What do you consider being the second highest?

  • Permanantly disabling "Install Google Toolbar" and change the default value for future updates

    I use Adobe products for years and, in general, is that Adobe produces some really useful tools for users of computers and productivity.  Thereby, ever time I get notice of an 'Adobe Flash Player' update I have to answer the same questions during the update / install process.  During the installation of the installation application ask if I want to install the toolbar 'Google', and the default value is Yes, then I have to uncheck the box before installation or I receive the software on my system I do not want or do not want.  In addition, towards the end of the update, the installation application provides three options on future updates:

    (1) download and install automatically

    (2) ask before installing

    (3) never install...

    And each installation I have to uncheck the installation of "Google Toolbar" and tell them that Adobe 'ask me... ' "before you download and install future updates.

    Is it possible permanently disable toolbar Google and by default my response to the update download and install question to always be 'Ask Me' first?  Adobe's witnesses crossing the machine during this process, so please do not suggest that it is not possible.  Adobe simply needs to modify the setup package to find these cookies and apply preferences users for the installation process instead of constantly trying to push unwanted applications and choices to the user.

    The displayed offers are based on the OS and the browser used.  If the two of you are essentially correct, for the browsers you use.

    If you opt in background updates, update option = allow Adobe to install updates (recommended), Flash Player will be updated within 24 hours of a new version is released.  If you use several browsers that use different types of Flash Player (for example, IE & Firefox) all drive types are updated within 24 hours of the new versions available.

    If you opt in notification updates, update = option Notify me when updates are available, the update notification generally appears within 7 days of an update is available and it is after that the system was restarted or that you log on/off voltage.   Opting to put up-to-date will launch the browser to a download page to download and install Flash Player.  If you use several browsers that use different types of Flash Player (for example, IE & Firefox) as the type of player who set the notification of update is updated.  The other type of player is not updated.

    Essentially, opting in the background updates will update all types of drive on the system within 24 hours and avoids downloading accidentally offers from third-party vendors.

    Note: there are slight differences for OS X updated behaivour but since you have Windows I described the behavior under Windows.

  • Can I change default display width in the integrated PDF Viewer?

    I almost always want to view a PDF in "page width" but the zoom default 'auto' setting always displays them to fill the height rather than the width of the window and I have to modify manually every time I find a PDF file. Can I change this setting somewhere?

    Hi cfcentaurea, you can define a view by default as follows: enter Subject: config in the bar firefox address (confirm the message information where it appears) & search for the preference named pdfjs.defaultZoomValue. Double-click it and change its value to the width of the page (this should affect all new documents you open).

    https://github.com/Mozilla/PDF.js/pull/3850

  • Cannot change the value of mousewheel scroll

    After you have reinstalled windows and all I had on my old desktop, I seem to be unable to change my amount of scrolling the mouse on firefox. I looked through all the troubleshooting questions that have already been posted, and all users have responded that I had to access about: config and change the value of mousewheel.withnokey.numlines.

    However, when you access everything: config, I discovered that not only I don't the integer specified, I don't have any integer with a preferably name that contains "withnokey", so I tried to add it in me, but not to use. Currently my parchment done on lines 6 and 7 and I would like to go down to about 3.

    Hello, Skarlath, the scrolling behavior has been overhauled in firefox 17 (see for reference https://wiki.mozilla.org/Gecko:Mouse_Wheel_Scrollingtechnical information) - the old setting longer reverberate.

    It must still be possible to set a different frame rate. You can enter about: config in the firefox address bar (confirm the message information where it appears), search preferences starting with mousewheel.default.delta_multiplier_ ..., you can double-click on these parameters and assign a different value to - then a restart of firefox is required for the changed settings is taken into account.

  • How can you specify the default value for the undefined array elements

    According to aid LV, the tables have two default values, the normal default value and the default value for the undefined array elements.

    I assume that there must be a way to specify the default value for later, but I can't find it anywhere.  Any ideas?

    I know that you can drag the item out of the table container.  Change the default value on this scalar element.  Then drag the item in table tank.

  • Default value in OT

    Hello

    In the database, we have fields that have a default value. I checked my OS and the default value is not set. So I wonder if I should manually or if it's supposed to be synchronized with the DB schema. I ask because I have validation error when validation changes, and mistakes are to field that are necessary but not displayed in the interface user.

    JDev 11.1.2.4

    Thank you

    Set the default values in the area and you're fine, for example using groovy.

    Our remove the constraint attribute in the eo zero and let the db by default.

    Timo

Maybe you are looking for