Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

header-navigation
keyboard_arrow_up
close
keyboard_arrow_left
list Table of Contents
file_download PDF
{ "lLangCode": "en", "lName": "English", "lCountryCode": "us", "transcode": "en_US" }
English
keyboard_arrow_right

Agent configuration update script use cases

date_range 28-Jun-22

You can change the agent configuration without making manual or scripted edits to the AgentConfig.xml file by using update scripts.

When you copy an update script to the WinCollect patch directory, the Agent performs the actions that are described in your script.

Update script actions

Update scripts can include the following actions:

<Addto> - Adds a child to the relevant node. You can include a type and certain defined key value pairs.
content_copy zoom_out_map
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<WinCollectScript version="10.0">
</WinCollectScript>
<Update> - Updates the value of a key.
content_copy zoom_out_map
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<WinCollectScript version="10.0">
</WinCollectScript>
<Delete> - Similar to <Addto>, except you add the name of the object to the object Path.
content_copy zoom_out_map
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<WinCollectScript version="10.0">
</WinCollectScript>

The agent creates a new configuration in the patch folder and validates the new configuration. When the validation is successful, the old agent configuration is backed up. The agent moves the update script, the old AgentConfig.xml file, and the new AgentConfig.xml file into a backup folder (patch_xxxx) and puts the new agent configuration into operation.

Several sample update scripts are installed with WinCollect 10. They are stored in the \IBM\WinCollect\samples directory.

Examples

Note:

These scripts are examples only. All agent configuration service modules are supported so that you can create your own scripts.

Note:

Update script file names must begin with update_. All other file names are ignored.

update_addXPath.xml
content_copy zoom_out_map
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<WinCollectScript version="10.0">
    <AddTo objPath="LocalSources(Name=Local)" >
        <Source Name="Security XPath" >
            <Parameter name="Query">
                <QueryList>
                  <Query Id="1" Path="Security">
                    <Select Path="Security">*[System[(Level=1  or Level=2 or Level=3) and (EventID=1 or EventID=3 or  (EventID >= 5 and EventID <= 100)  or  (EventID >= 200 and EventID <= 500) )]]</Select>
                  </Query>
                </QueryList>
            </Parameter>
        </Source>
    </AddTo>
</WinCollectScript>
update_delSecurity.xml
content_copy zoom_out_map
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<WinCollectScript version="10.0">
    <Delete objPath="LocalSources(Name=Local)/Source(Name=Security)" />
</WinCollectScript>
update_updtConsPort.xml
content_copy zoom_out_map
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<WinCollectScript version="10.0">
    <Update objPath="SystemSettings" setParam="Console.Port" value="3333" descr="Changing the Config Console's port to 3333" />
</WinCollectScript>

The following use cases are examples of how you can use update scripts to change agent configurations:

footer-navigation