Aid to navigation multi level tables

Hello

I am writing a little code to export one vcenter to the other alarms. I know there are existing scripts that already do this, but I couldn't find one that works at several locations.

Here's what I wrote:

Functions:

function getAlarms {}

Param ($location)

$origin = $location | Get-View | Get-VIObjectByVIView

$alarms = get-AlarmDefinition-entity $origin

return $alarms

}

function createAlarms {}

Param ($location, $alarms)

$destination = $location | Get-opinion

$alarmMgr = get-view AlarmManager

ForEach ($alarm to $alarms)

{

$newalarm = $null

$newAlarm = new-Object VMware.Vim.AlarmSpec

$newAlarm = (get - see $alarm). Info

try {}

$alarmMgr.CreateAlarm($destination.) MoRef, $newAlarm)

}

catch {}

#alarms already exist because returns vcenter alarms created records parent as if they were created here.

#so cannot avoid duplicates when browsing the containers

}

}

}

Exporting alarms:

$alarmsSRC = @ {}

#save in the root of vcenter alarms:

$alarmsSRC ['root'] = getAlarms-location (get-file - norecursion)

$alarmsSRC ['data'] = @ {}

$datacenters = get-data center

{ForEach ($datacenter to $datacenters)

$alarmsSRC ["data"] [$datacenter. Name] = @ {}

$alarmsSRC ["data"] [$datacenter. Name] ['root'] = getAlarms-location $datacenter

$folders = get-file-location $datacenter - Type vm | WHERE-object {$_.} Parent - like 'vm'} #only first sublevel of records of a specific data center

{ForEach ($folder in $folders)

$alarmsSRC ["data"] [$datacenter. Name] [$folder. Name] = getAlarms-location $folder

}

}

Here all right, but now I need to recreate the em and I don't know how to navigate on my table...

For example, I get a table like this:

$alarmsSRC ['root'] = alarms_in_root

$alarmsSRC ['data'] ['Datacenter 1'] ['root'] = alarms_in_root_of_datacenter1

$alarmsSRC ["data"] ["data center 1"] ["A notebook"] = alarms_in_folderA_of_datacenter1

$alarmsSRC ["data"] ["data center 1"] ["file B"] = alarms_in_folderB_of_datacenter1

$alarmsSRC ['data'] ['Datacenter 2'] ['root'] = alarms_in_root_of_datacenter2

$alarmsSRC ["data"] ["Data Center 2"] ["A notebook"] = alarms_in_folderA_of_datacenter2

$alarmsSRC ["data"] ["Data Center 2"] ["file B"] = alarms_in_folderB_of_datacenter2

How to use my function createAlarms with this picture?

I'm a bit stuck on how to extract the name of the data center and records.

Here's what I did to re-create the alarms:

ForEach ($datacenter to {$alarmsSRC ["data"])}

{ForEach ($folder in $datacenter)

If (/ / $folder.) Name / /-eq 'root')

{

alarms from #create at the root of this data center

createAlarms-location (get-data center-name / / $datacenter.) Name / /)-alarms $folder

} else {}

createAlarms-location (get-file-name / / $folder.) Name / /-vm-location Type (get-data center-name / / $datacenter.) Name / /). WHERE-object {$_.} Parent - like "vm"}) - alarms $folder

}

}

}

As you can see I'm looking to extract the 'touch' names in the table as "Datacenter 1", "Datacenter 2", "folder", etc.»»

Thanks for any help

The variable $alarmsSRC contains a collection of hash tables. You can use the GetEnumerator method to enumerate the entries in a hash table. The following PowerCLI script shows you how to do this in your case. I like an exercise lets you modify the script to create the alarms.

$alarmsSRC = @ {}

$alarmsSRC ['data'] = @ {}

$alarmsSRC ["data"] ["1 Datacenter'] = @ {}

$alarmsSRC ["data"] ["Data Center 2"] = @ {}

$alarmsSRC ['root'] = "alarms_in_root".

$alarmsSRC ['data'] ['Datacenter 1'] ['root'] = "alarms_in_root_of_datacenter1".

$alarmsSRC ['data centers'] ['Datacenter 1'] ['A book'] = "alarms_in_folderA_of_datacenter1".

$alarmsSRC ['data centers'] ['Datacenter 1'] ['case B'] = "alarms_in_folderB_of_datacenter1".

$alarmsSRC ['data'] ['Datacenter 2'] ['root'] = "alarms_in_root_of_datacenter2".

$alarmsSRC ['data centers'] ['Datacenter 2'] ['A book'] = "alarms_in_folderA_of_datacenter2".

$alarmsSRC ['data centers'] ['Datacenter 2'] ['case B'] = "alarms_in_folderB_of_datacenter2".

$alarmsSRC ['root']

ForEach ($datacenter to $alarmsSRC ['data']. GetEnumerator {}

ForEach ($folder in $alarmsSRC ["data"] [$datacenter. Key]. GetEnumerator {}

$Folder.Key + 'is' + $Folder.value

}

}

Tags: VMware

Similar Questions

  • Need assistance on the implementation of Multi level menu

    Hi all

    Need assistance on the implementation of Multi level menu

    Thank you
    ANU

    Hi Anu,

    Please go through this link Multilevelmenu to implement navigation

    Thank you

  • How to preserve the multi-level iPhoto in Photos folder directory

    If you upgrade OS to Yosemite or El Capitan, how to preserve my folder customized Photos iPhoto multi-level directory? My iPhoto library is 105 GB and contains 41 000 photos, all carefully arranged in a directory of custom and subsidiary subjects.

    iPhoto (the beloved and only) has a great power in its ability to custom folders full of full of albums etc. subfolders directories several levels deep, with photos that can be duplicated in different albums, folder & file size info, etc. Unless this can all be kept in the Photos, there is no point me upgrading until Apple gets serious on the needs of demanding photographers, who want the custom control and want as their stuff protected in their hard drive and not on the cloud. Automatically generated 'events' and 'albums' are things of grandmother-and-the-children, useless for people like me. I need a custom control over making inventories of multiple folder levels based on my own custom categories, categories or undated events Apple thinks we should have. Home, school, family, travel, etc. just does not cut it!

    Someone really aware with this situation can help me get clarity? Promo stuff on pictures Apple responds to virtually none of my questions.

    I would like to begin by asking in the forum of Photos, but until you do, you need to specify your terminology. iPhoto offers events, Albums, and smart Albums for the organization. Thus, by "directories" I can only imagine say you you have files of records nested within other folders? If so, you can do with Photos. There is no need to use the features of cloud Photos. They are not mandatory in any mode.

    Regarding your comment, if you're a serious photographer why you use iPhoto? Make sure you used Apple app for photographers, it was called Aperture. Now for photographers you use applications 3rd party - Lightroom, Capture One etc.

  • Explain to me how a multi-level security strategy can be deployed domain LAN-to-WAN and the LAN domain to the domain of the workstation with the use of internal firewalls.

    Explain to me how a multi-level security strategy can be deployed domain LAN-to-WAN and the LAN domain to the domain of the workstation with the use of internal firewalls.

    Hello

    Your Windows XP question is more complex than what is generally answered in the Microsoft Answers forums. It is better suited for the IT Pro TechNet public. Please ask your question in the following forum.
    http://social.technet.Microsoft.com/forums/en-us/itproxpsp/threads

  • Dreamweaver offers a secure connection multi level feature?

    Hello:

    I am trying to create a connection so multi level when guest log in, they see the content specific to their level of play.

    This http://www.kingluddite.com/tools/crud-in-dreamweaver will show you how to do what you want to do using deprecated technology.

  • Problem of multi-level numbered list

    I have this situation:

    I work in book, with a separate document chapter.

    My chapter number is using digital Roman.

    I want to make my multi-level list (2nd, 3rd level and so forth) use this chapter number, as normal.

    But the result is: IV.1

    Instead, what I want is: 4.1

    Can I convert this digital Roman (IV) normal digital (4)?

    What is alternatives to the list multilevel numbering restarts in each chapter?

    Any help would be appreciated.

    Thank you!

    Check out these 2 points:

    1 the document numbering options:

    Style (Document chapter numbering): must be set up as "1,2,3,4,...» »

    2. variable: chapter number:

    must be set up as "I, II, III, IV,...» »

    When you create your lists at several levels, simply add the chapter number symbol (^ H).

    It must be formatted as seen in point 1.

    Let us know if this solves your problem.

    Vinny

  • Multi level menu

    Hi friends,
    Can someone guide me to create a better multi level menu using jquery. Most of the plugins that I ran into was not compatible due to the jQuery version...
    Please advice...


    Kind regards
    Sitbon

    Dear magneto,

    If this is what you need
    http://Apex.Oracle.com/pls/Apex/f?p=30734
    DDM/ddm

    then it will guide you
    Re: Create a DHTML Drop down

    If the answer to the question, would you please close the thread as answered and give the points where won...

    Best regards
    Mahmoud

  • Rule of load EAS (multi level attributes)

    Hi all

    I'm currently building multi level attributes at the same time, associating with the basic dimension with the dimension of the construction base.


    because I'm building the multi level attributes of... I made it clear at all levels of the attributes then side of base and associations!

    The question is how to set the dimension build property?

    If I need to set it as the size of the attribute or dimension of database construction!

    I studied the page 308 Ser60...

    but the error checking!

    suggestions pls!


    Thank you
    Dolar

    Sorry, I was not more clear.
    1. build the hierarchy of dimension attribule in a State of charge. then, in the second rule of load associate the basic dimension attribute

    2. run the two rules above in reverse order.

    If you automate this, you can do it in an import statement so you get only a restructuring (so it will look like it is built at the same time)

  • How to check if a menu is a menu multi-level programmatically?

    Hi all

    Does anyone have an idea how to do to check if a menu is a menu multi level with objects backingContext?

    Thank you

    Leandro

    I can remember but not bookBackingContext not menuBackingContext who must have the type?
    concerning
    Deepak

  • Multi level navigation pane

    Is it possible to have 3 navigation pane?

    as page 1, it has the navigation pane

    I push page 2

    then I push on page 2, page 3 in the navigation pane.

    page 3 back button, it goes to page 2, and then on the back, he goes to page 1?

    I wrote the wrong qml, I defined page above the container... and now it works.

  • Query fot table multi level

    I need a query which brings me the suite of result:

    Select...

    Where to move = 1;


    1.1.1.1 planet - country - city - Brazil

    1.1.1.2 planet - country - city - France

    1.1.1.2 planet - country - city - Costa Rica



    Example of data;


    PK 2 niveau3 Level4 level 5 level 6 level 1 Description move

    ___  _____   _____   _____  _____    _____    ______  ____________________      _____

    1 1 null null null null nulll planet 0

    2 1 1 null null null null country 0

    2        1          1          1        null        null       null        City                                     0

    2        1          1          1          1         null       null        Brazil                                   1

    2        1          1          1          2         null       null        France                                 1

    2 1 1 1 3 Costa Rica 1 null null


    I have test it with (START WITH CONNECT BY)

    But I did have the expected result


    Help


    Thank you


    Mike

    
    with
    dataset as
    (select 1 pk,1 level1,null level2,null level3,null level4,null level5,null level6,'Planet' description,0 move from dual union all
    select 2,1,1,null,null,null,null,'Country',0 from dual union all
    select 3,1,1,1,null,null,null,'City',0 from dual union all
    select 4,1,1,1,1,null,null,'Brazil',1 from dual union all
    select 5,1,1,1,2,null,null,'France',1 from dual union all
    select 6,1,1,1,3,null,null,'Costa Rica',1 from dual union all
    select 7,2,null,null,null,null,null,'Honda',0 from dual union all
    select 8,2,1,null,null,null,null,'Accord',1 from dual union all
    select 9,2,2,null,null,null,null,'Odyssey',1 from dual
    )
    ,dataset_a AS (SELECT level1,
    LISTAGG(description,'-') WITHIN GROUP (ORDER BY pk) str FROM dataset WHERE MOVE=0 GROUP BY MOVE,level1)
    SELECT a.level1||'.'||a.level2||'.'||nvl(a.level3,1)||'.'||nvl(a.level4,1) versioning,b.str||'-'||a.description final_str FROM dataset a,dataset_a b
    where a.level1=b.level1
    and move<>0;
    

    Output:

    --------------

    VERSION MANAGEMENT FINAL_STR
    1.1.1.1 Planet-country-city-Brazil
    1.1.1.2 Planet-country-city-France
    1.1.1.3 Planet-country-city-Costa Rica
    2.1.1.1 Honda-Accord
    2.2.1.1 Honda-Odyssey

    See you soon,.

    Manik.

  • WebCenter Navigation | Upper level nodes do not pick up the change of locale

    Hi all

    I am facing a problem with the beams of model and default navigation resources in WebCenter. (I tested in PS3 and PS4)

    I've implemented a change language menu which changes the settings regional managed user in a bean method. I used beams of resources of high level and the second level pages using the value by defect-navigation - model .xml. Here is my test case.

    (1) default application language is English
    Top level 2) as well as its child page is both showing English values (picked up from resource group)
    (3) use a language selector down to change the language of the application in Hindi (I replaced the method of calculateLocale() of CustomViewHandler class to apply this logic)
    (4) the second level in the navigation page begins to pick up the Hindi of resource group value, but the first level page still has the old English value.

    Even if I refresh the whole page with F5 or ctrl + F5, the top-level page does not reflect the new language.

    Does anyone have an idea why this is happening? I don't do any special implementation for the second level (partial trigger etc.), but what I have to do something for the first level?

    Thank you
    Prashant

    Hello.

    You must force to reevaluate the EL Expressions and invalidate cache SiteResources because WebCenter is cached Navigation model.
    The best multilingual for me is based on Phase ADF earpiece to force the phase of "prepareModel" when you change language. PrepareModel phase must invalidate SiteResource cache to force assess the EL Expressions.

    You have a multilingual sample based on ADF Phase listener downloadable here http://danielmerchanoracle.blogspot.com.es/2011/09/multi-lenguaje-en-una-aplicacion-de.html. In addition, it is a long explain on that (but it's in Spanish ;)).

    Blog entry: http://danielmerchanoracle.blogspot.com.es/2011/09/multi-lenguaje-en-una-aplicacion-de.html
    Example of direct download: http://dl.dropbox.com/u/46128268/Oracle%20WebCenter%20Samples/WCPortalTraduccion.rar

    Kind regards.

    Published by: Daniel Merchan on 13-Apr-2012 14:06

  • multi level cells

    Hi, is it possible to have the text on several levels in the same cell in a table? In excel I press ALT + ENTER to allow a 2nd line. I don't want 2 separate cells.

    Thank you

    Yes - right click on the table and select "enter multiline".

    Urgent return then takes you on a new line in the same cell.

    Ian

  • Multi-level TOC

    How can I create a third and fourth level for a table of contents without creating a new book? I want to put a subject in the frame a subject. When I click on the arrow move the first topic on the left and try to put something under it, it moves the second topic above instead of below and the arrow is grayed out to move the first subject to the right.

    No, I think I understand what you want. You want:

    I had to change this image by using SnagIt.

    But so that the 'new topic' to be indented, the only way I know that this is possible by creating a new book on the same level as the preferences of the user.

    Like this:

    And it was like that for as long as I've used RoboHelp. More than 20 years. Or, in all that time I've never seen anyone manage to complete the first scenario.

    And then I never claim to know everything there is to know about what either. I'm always learning new things. This week I learned a new feature about TechSmith SnagIt that I had no idea was there. And SnagIt and I go back too far! So if there is a way to get there, I would like to learn about it.

    See you soon... Rick

  • Weird to explain plan structured multi-level XmlType column

    Hello

    spin an explanation on the follwing on 11.2.0.2 query:

    SELECT
    T1.EVENT_ID,
    ACTION_SUB_ID,
    PARAM_KEY,
    PARAM_VALUE,
    TO_DATE('2013-12-10', 'YYYY-MM-DD')
    FROM  T_C_RMP_MNTRNG_XML_FULL_IL ,
      XMLTABLE('/monitoring' PASSING XML_CONTENT COLUMNS
      EVENT_ID VARCHAR2(4000) PATH 'eventId',
      ACTIONS XMLTYPE PATH 'action'
    ) T1,
      XMLTABLE('/action' PASSING T1.ACTIONS COLUMNS
      ACTION_SUB_ID NUMBER(10,0) PATH 'actionSubId',
      PARAMS xmltype PATH 'param'
    ) T2,
      XMLTABLE('/param' PASSING T2.params columns
      PARAM_KEY VARCHAR2(4000) PATH 'key',
      PARAM_VALUE VARCHAR2(1000) PATH 'value'
    ) T3
    WHERE MESSAGE_ID = 4972102 ;
    

    Even if MESSAGE_ID is the primary key of the T_C_RMP_MNTRNG_XML_FULL_IL and so there isn't that one record corresponding to the condition, I get a plan to explain with huge costs, 500 MB of data and a duration of 10 hours:

    PLAN_TABLE_OUTPUT

    --------------------------------------------------------------------------------------------------------

    Hash value of plan: 4011854835

    --------------------------------------------------------------------------------------------------------

    | ID | Operation | Name                  | Lines | Bytes | Cost (% CPU). Time |

    --------------------------------------------------------------------------------------------------------

    |   0 | SELECT STATEMENT |                       |   223KO |   489 M |  3111K (1) | 10:22:17 |

    |   1.  NESTED LOOPS |                       |       |       |            |          |

    |   2.   NESTED LOOPS |                       |   223KO |   489 M |  3111K (1) | 10:22:17 |

    |   3.    NESTED LOOPS |                       |   140K |    11 M |  1678 (1) | 00:00:21 |

    |*  4 |     INDEX RANGE SCAN | X1B                   |     1.    53.     3 (0) | 00:00:01 |

    |   5.     TABLE ACCESS BY INDEX ROWID | T_OR_MON_ACTION |   140K |  4542K |  1675 (1) | 00:00:21 |

    PLAN_TABLE_OUTPUT

    --------------------------------------------------------------------------------------------------------

    |*  6 |      INDEX RANGE SCAN | X3                    |   140K |       |     4 (25) | 00:00:01 |

    |*  7 |    INDEX RANGE SCAN | X4G                   |  4083.       |    22 (0) | 00:00:01 |

    |   8.   TABLE ACCESS BY INDEX ROWID | T_OR_MON_ACTION_PARAM |     2.  4428.    52 (0) | 00:00:01 |

    --------------------------------------------------------------------------------------------------------

    Information of predicates (identified by the operation identity card):

    ---------------------------------------------------

    4 - access ("MESSAGE_ID" = 4972102)

    6 - access("SYS_ALIAS_0".") NESTED_TABLE_ID "=" T_C_RMP_MNTRNG_XML_FULL_IL. " ("' SYS_NC0001200013$ ')

    7 - access ("NESTED_TABLE_ID"= "SYS_ALIAS_0"." ("SYS_NC0000500006$")

    PLAN_TABLE_OUTPUT

    --------------------------------------------------------------------------------------------------------

    Note

    -----

    -dynamic sample used for this survey (level = 2)

    When I run the query, the result comes back within 0.3 seconds.

    Why is the plan to explain to the wide like that?

    It's just the way it is, or is there something wrong here?

    How did you finally to create the column 'XML_CONTENT' in the T_C_RMP_MNTRNG_XML_FULL_IL table / create the T_C_RMP_MNTRNG_XML_FULL_IL table?

    That said, SQL * more explain the scheme, spends most of the time especially bananas when it comes with XMLTYPE and or objects which has no statistics created for them (dynamic sampling used for this survey (level = 2))

    Using DBMS_XPLAN etc to get the 'real' values instead of "estimates".

    https://blogs.Oracle.com/optimizer/entry/how_do_i_know_if

Maybe you are looking for