After uploading the script to ASM, the {username} & {password} encoding doesn't seem to work and we see the following in the ASM logs for this monitor:
However, if we do not encode the credentials in the xml and put the username and password, all is working as expected:
Any
For this particular case there was an extra space at the end of the username (in ASM UI under the monitor in question) and that was the reason of the login authentication failure: