Modifying Components in Bulk

Component Modification Using an XML File

The XML file that is created exclusively for modifying multiple component specifications, should contain entries of the following format:

<?xml version="1.0" encoding="UTF-8"?>

<Component action="modify">

    <Agent>

    <Modification to component1>

    </Agent>

    <Agent>

        <Modification to component2>

    </Agent>

            .

            .

            .

            .

</Component>

For example, to change the nick name of an Oracle database server and the port number of an MS SQL server that pre-exist, your specification would be:

<?xml version="1.0" encoding="UTF-8"?>

<Component action="modify">

    <Agent>

    <componenttype>Oracle database</componenttype>

    <hostip>192.168.10.8</hostip>

    <oldcomponentname>oracle8</oldcomponentname>

        <newcomponentname>oracle80</newcomponentname>

    <port>1521</port>

    <sid>egora</sid>

    <ispassive>no</ispassive>

    <externalagents>192.168.10.152</externalagents>

    </Agent>

    <Agent>

    <componenttype>Microsoft SQL</componenttype>

    <hostip>192.168.10.9</hostip>

    <componentname>mssql</componentname>

    <oldport>1433</oldport>

    <newport>1434</newport>

<ispassive>no</ispassive>

    <externalagents>192.168.10.152</externalagents>

    </Agent>

</Component>

You can either specify the hostip or the hostname while you try to modify the components.

Once the XML file is created on the orchestrator’s host, invoke the following command from the orchestrator to update the eG manager with all the modifications contained in the XML file:

eGCLI ModifyComponent -managerid <ManagerID> -file <Fullpath_to_the_XML_file>

For example:

eGCLI ModifyComponent -managerID mgr153 -file c:\modcomp.xml

Note:

  • Each modification should be included within the main <Component></Component> block only.
  • A single XML file should not contain more than one <Component></Component> block.
  • An XML file that is created for modifying component details should not include sections pertaining to any other operation.
  • A single XML file can be used for modifying the details of components of different types.

Component Modification Using a CSV File

As already mentioned, an exclusive CSV file will have to be created to handle bulk modifications to component details.

Entries in this file should be of the following format:

Element,action

Component,modify

componenttype,hostip/hostname,componentname,port,externalagents

<Modification to component1>

<Modification to component2>

.

.

.

For example, if you want to modify the port numbers of 2 IIS web servers, do the following:

Element,action

Component,modify

componenttype,hostip,componentname,oldport,Newport,mtsenabled,externalagents

IIS web,192.168.10.96,iis96,7077,8088,no,ext43

IIS web,192.168.10.173,iis173,7077,7078,no,ext173

The CSV file can also be used to modify the details of components of multiple types at one shot. While doing so, make sure that you leave the columns not applicable for a component specification, blank. At the same time, ensure that the column names you specify in the CSV file are a super-set of the parameters supported by all the components that are being modified. In other words, the column names provided in the CSV file should correspond to the following:

  • the parameters that are common across all the components to be modified, and;
  • the parameters that are distinct/unique for each of the components being modified; 

For instance, say you want to modify the nick name of an Oracle database server, and want to change the monitoring mode of an MS SQL server from agent-based to agentless. The specification in this case will be, as follows:

Element,action

Component,modify

componenttype,hostip,componentname,oldcomponentname,
newcomponentname,port,sid,agentless,mode,os,externalagents,remoteagent

Oracle database,192.168.10.8,,ora8,ora08,1521,egora,,,,ext125,

Microsoft SQL,192.168.10.63, sql63,,,1433,,yes,perfmon,Windows2003,ext173,rem12

In the above specification, you can find that the column list includes the the following:

  1. parameters such as componenttype, hostip/hostname, port, and externalagents that are common to both the Oracle and MS SQL servers
  2. the oldcomponentname, newcomponentname, and sid parameter that are available only for the Oracle component
  3. the componentname, agentless, mode, os, and remoteagent parameters that are relevant for only the MS SQL server being modified

From the above specification, it is also evident that columns not applicable to a component specification have been left blank.

If say, you want to add multiple SIDs to an Oracle database server, your specification should be as follows:

Element,action

Component,modify

componenttype,hostip,componentname,port,sid,externalagents

Oracle database,192.168.10.8,ora08,1521,"egora,egoracle",ext125

Note:

If an Oracle database server with multiple SIDs is added to the eG Enterprise system, then each SID will be registered as a separate Oracle database server in the eG Enterprise system.

Once the CSV file is created on the orchestrator’s host, invoke the following command from the orchestrator to update the eG manager with all the modifications contained in the CSV file:

eGCLI ModifyComponent -managerid <ManagerID> -file <Fullpath_to_the_CSV_file>

For example:

eGCLI ModifyComponent -managerID mgr153 -file c:\modcomp.csv