Forum Discussion
What is the correct way to script multiple newline characters in iApp (to create a monitor)
I have a HTTP monitor which requires a \r\n\r\n at the end. For the life of me, I cannot fix the syntax on this.
I end up with the following debugs in /var/tmp/scriptd.out (sanitised obviously).
With the following line:
set monitor_send "\"GET /hosting/discovery HTTP/1.1\r\nHost: $::deploy__monitor_dns_name\r\nConnection: Close\r\n \r\n\""
I get the following result:
create / ltm monitor http test_lync_wac_internal_http_monitor defaults-from http interval 30 timeout 91 send "GET /hosting/discovery HTTP/1.1\r\nHost: myserver.mydomain.local\r\nConnection: Close\r\n \r\n" recv "wopi-discovery"
With the following line:
set monitor_send "\"GET /hosting/discovery HTTP/1.1\r\nHost: $::deploy__monitor_dns_name\r\nConnection: Close\r\n\r\n\""
I get the following result:
create / ltm monitor http test_lync_wac_internal_http_monitor defaults-from http interval 30 timeout 91 send "GET /hosting/discovery HTTP/1.1\r\nHost: myserver.mydomain.local\r\nConnection: Close\r\n" recv "wopi-discovery"
The final part of the send string must read "Connection: Close\r\n\r\n" to work correctly.
In both cases this is using the f5.app_utils:create_monitor procedure.
set monitor_name [tmsh::run_proc f5.app_utils:create_monitor \
$app_name $monitor_type $monitor_interval "$monitor_send" \
"$monitor_recv" $::HTTP_11_VERSION_STRING $monitor_dns_name]
I did try making one directly with LTM commands but I experienced difficulty with escaping and it sent the \r\n as linefeed characters instead of literal text.
This means a manual edit of the monitor each time a setting is changed in the iApp, which isn't going to be regular, but will cause an outage when someone forgets to check (and they will). What's the right way to escape two newlines?
Any help is appreciated, thanks.
The 11.4 f5.http template uses the following:
The extra backslash is consumed within the iApp, and the result is correct. It does not use app_utils.'GET $::monitor__uri HTTP/1.1\\r\\nHost: $hostname\\r\\nConnection: Close\\r\\n\\r\\n'
9 Replies
- Ido_Breger_3805Historic F5 AccountHi Alex,
- naladar_65658
Altostratus
I do not know of any tool for sizing. There are three pieces of advice I would like to provide.
Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com