Forum Discussion
Raynewalk
Nimbostratus
Sep 17, 2012HEX definition in an irule
We want to build an irule that sends HEX to a server and checks the reponse back in HEX. Base don this we want to build a health monitor to mark the server as up or down.
Grateful for any advice or exmaples.
Cheers
8 Replies
- Kevin_Stewart
Employee
Are you trying to convert TO/FROM HEX? Are the client and/or server speaking a binary protocol?
In any case, the binary scan/format commands will give you HEX conversion. Just need to know more specifics about what you're trying to do.
As for the monitor, that's completely different and not based on iRules (unless you point the monitor at a VIP). - Raynewalk
Nimbostratus
Hi Kevin, Our server applicaitionn guy tells us that the application to be monitored uses EBCDIC so he has supplied a HEX string to input and an expected response in HEX that confirms the server is healthy. So the question is how to form that raw HEX into an irule that quirts this at the server and interprets the response.
Thanks for your help. - Kevin_Stewart
Employee
I'm assuming you're only talking about monitoring the app, so there's probably several ways to do this. First and foremost, you wouldn't need an iRule if you can poll the server directly from a scripted monitor. Take a look at something like netcat in the shell. Modify one of the sample monitor scripts in /config/monitors.
res=`echo reqfile.txt | nc $1 $2 | grep "somedata"`
The reqfile.txt file would contain your HEX data.There's any number of other utilities in the shell to convert the response to HEX, if that's even necessary. Refer to http://www.sans.org/security-resources/sec560/netcat_cheat_sheet_v1.pdf for netcat commands. - Raynewalk
Nimbostratus
OK, I,ll chekc that. Thanks - Raynewalk
Nimbostratus
OK, I,ll chekc that. Thanks - hoolio
Cirrostratus
You should be able to just specify the hex characters in the send and receive strings in an inbuilt TCP or HTTP monitor:
sol4186: Entering escape sequences in an HTTP health monitor's Send and Receive strings
https://support.f5.com/kb/en-us/solutions/public/4000/100/sol4186.html
Escape Sequence
\xHH
Description
Insert the character with the hexadecimal ASCII code of HH
Aaron - Raynewalk
Nimbostratus
That could be very helpful indeed. I will be trying this out tomorrow.... - Raynewalk
Nimbostratus
Posted By hoolio on 09/20/2012 09:26 AM
You should be able to just specify the hex characters in the send and receive strings in an inbuilt TCP or HTTP monitor:
sol4186: Entering escape sequences in an HTTP health monitor's Send and Receive strings
https://support.f5.com/kb/en-us/solutions/public/4000/100/sol4186.html
Escape Sequence
\xHH
Description
Insert the character with the hexadecimal ASCII code of HH
Aaron
Hi Aaron,This worked perfectly. We found we had to precede each HEX character in the string with the escape sequence although we did not try stringing them all together without any gaps, which may have worked.
cheers
Greg
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects