Simon icon Simon
Flexible server monitoring

variable name enclosed in square brackets is inserted instead of the variable's value

I am using Simon 2.3.5 under OSX 10.3.9. I seem to have a problem with variable substitution: the variable name enclosed in square brackets is inserted instead of the expected value. For example, the SMTP test produces in preview

If recieve "220 " then send "helo [Username]" and continue.
Or receive "" then send "" and report failure.

If recieve "250 " then send "quit" and continue.
Or receive "" then send "" and report failure.

In the Service Edit window, it is

then send "helo {Testusername}"

The literal [Username] produces an error, of course:

250 /here-was-hostname/ cannot verify [Username]

The original script for this test had {TestURL} as variable, which resulted in "helo [URL]" sent to the SMTP server producing the same error. The testusername is my attempt to work around this issue and provide an explicit hostname to pass.

David Sinclair's picture

Re: variable name enclosed in square brackets is inserted

The variable name in square brackets is used when you check a notifier; it's a preview of how it'd work, to confirm that it's set up correctly. It can't use real values as it isn't associated with a test at that point — notifiers can be used for several tests.

When you actually use it with a test, the correct values will be used instead.

Re: variable name enclosed in square brackets is inserted

Hmm, wouldn't a check with actual values make more sense? It is actually associated with a test at this point -- I am clicking 'preview' when editing a test not a notifier.

David Sinclair's picture

Re: variable name enclosed in square brackets is inserted

Yes, intuitively it would make sense to use the test's values when clicking the Preview button within the New/Edit Test window, but at that point the values haven't been saved, so it can't reliably do so.

I have some ideas on how to improve that in a future version.

Re: variable name enclosed in square brackets is inserted

Of course, you can't use unsaved values. What about deactivating the preview button until test is saved and then using the saved values. But it should also be possible to send the values currently in the dialog with the preview action, sort of like a fake save. That would make preview a powerful debugging tool.

David Sinclair's picture

Re: variable name enclosed in square brackets is inserted

The Preview button is enabled so you can record cookies. In a sense it does do a "fake save" of the location field (URL), but not the other values.

I plan on changing the way this works in the future. In the meantime, the placeholder values give some indication of what it'll do, and you can use the Preview command from the Monitor window to use real values.