11-01-2004 01:10 AM
Hi,
I have script (only skelet):
socket connect host ...
socket send ...
socket inspect ...
When I do this commands from console, I see that socket inspect prints some output.
But when I play this script with script play, I see nothing.
Should I do something special when I want to see inspect output from script?
11-04-2004 01:24 AM
Hi,
I think you have to use echo commands for output to the conline when doing a play script. Btw what kind of output are you awaiting when playing a script? Normaly you set exit messges when something with the socket fails. This is how scriped keepalives are working from my experience.
Cheers,
Joerg
11-05-2004 12:02 AM
Hi,
but how to "catch" output from socket inspect to variable for doing echo?
On console I do socket inspect and output is on console. So I imaging that i will use something like
socket inspect ... | grep ...
But as I wrote, I get no output on script. On console it works.
I can't use socket waitfor.
11-08-2004 08:35 PM
Hi,
I did it like this:
set EXIT_MSG "Waitfor Password: Failed port 23"
! The Username seems to be unknown.
socket waitfor ${SOCKET} "Password" 2000
socket inspect ${SOCKET} pretty
The result is the following:
If the phrase Password is not received an Errormessage is displayed and the script exits. This causes that the probed real will change to probe failed if the retry limit is reached. For explanation before waiting for a password prompt I opened a socket with another exitmessage and sent a username after the CSS was "prompted" to send the username. If the login is successfull I disconnect the socket and clear the exit message. In this way you can probe several ports in a row.
Btw a good reference for writing CSS Scripts is
the scripts directory on your CSS. The scripts presented there are quite good documented and maybe you get an idea of what you are missing.
Kind Regards,
Joerg
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide