Scripted Webserver filter on TIM

book

Article ID: 198521

calendar_today

Updated On:

Products

CA Application Performance Management Agent (APM / Wily / Introscope) CA Application Performance Management (APM / Wily / Introscope) INTROSCOPE DX Application Performance Management

Issue/Introduction

The easiest way for configuring WebServer filters on TIM is by using the WebUI on the TESS. However, for automated failover (High Availability) when using 2 TIMs, one can use curl to trigger the timsettings function on the TIM.

Environment

TIM 10.7.x

Resolution

The curl call has to be sent from the TESS as that is the only machine allowed to connect to the TIM without authentication. Doing a packet capture, it can be seen that the timsettings function on the TIM is called, which takes care of everything:
POST /wily/cem/tim/tess/settimconfig HTTP/1.1
Content-Type: text/plain
Cache-Control: no-cache
Pragma: no-cache
User-Agent: Java/1.8.0_112
Host: 10.10.10.6
Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
Connection: keep-alive
Content-Length: 269
<?xml version="1.0" encoding="UTF-8"?>
<TimConfigFile timStatus="enabled"><DocInfo dateAndTime="Mon, 08 Jun 2020
08:15:18 GMT" version="1.2"/><ServerFilterList><ServerFilter fromIp="0.0.0.0"
port="0" toIp="255.255.255.255" type="IP"/></ServerFilterList></TimConfigFile>

So using curl from the TESS system, it would be:
curl -d "@webserver.filter" -H "Content-Type: text/plain" -X POST
http://10.10.10.6/wily/cem/tim/tess/settimconfig

And in the file "webserver.filter" file, it would need to be written the desired filter to push out (enable or disable):

- To enable your filter:
<?xml version="1.0" encoding="UTF-8"?>
<TimConfigFile timStatus="enabled"><DocInfo dateAndTime="Mon, 08 Jun 2020
08:15:18 GMT" version="1.2"/><ServerFilterList><ServerFilter fromIp="0.0.0.0"
port="0" toIp="255.255.255.255" type="IP"/></ServerFilterList></TimConfigFile>


To disable the filters, push out the following:
<?xml version="1.0" encoding="UTF-8"?>
<TimConfigFile timStatus="enabled"><DocInfo dateAndTime="Mon, 08 Jun 2020
08:16:06 GMT" version="1.2"/><ServerFilterList/></TimConfigFile>

This method has the advantage that it uses the TIM to actually do the job, and makes the TIM reread its configuration file without having to restart the TIM.