ON THIS PAGE
Agent configuration update script use cases
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:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <WinCollectScript version="10.0"> </WinCollectScript>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <WinCollectScript version="10.0"> </WinCollectScript>
<?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
These scripts are examples only. All agent configuration service modules are supported so that you can create your own scripts.
Update script file names must begin with update_. All other file names are ignored.
<?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>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <WinCollectScript version="10.0"> <Delete objPath="LocalSources(Name=Local)/Source(Name=Security)" /> </WinCollectScript>
<?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: