Jean-Michel Toussaint 0 Posted September 13, 2011 Share Posted September 13, 2011 I am trying to use groovy to verify the connectivity of an FTP server following the FAQ (http://help.logicmonitor.com/using/da...)Here is the exact script used:import com.santaba.agent.groovyapi.expect.Expectcli = Expect.open(\'\'x.x.x.x\'\', 21, 5)cli.expect(\'\'220 \'\')cli.send( \'\'user anonymous\'\' )cli.expect(\'\'331 \'\')cli.send(\'\'pass meme\'\')cli.expect( \'\'230 \'\')cli.send( \'\'quit\'\' )Unfortunately, the groovy debugger wither comes back with a timeout, or the following:>> !groovyEnd of stream reached, no match foundMy FTP server, in turn, see the connection coming from the agent, but never receives the \'\'USER anonymous\'\' command.Any Help welcome Quote Link to post Share on other sites
0 LogicMonitor Staff Steve Francis 20 Posted May 3, 2012 LogicMonitor Staff Share Posted May 3, 2012 In the coming release, in a week or two, there will be direct access to all properties of a host.nnRight now you can use HOSTNAME and WILDVALUE (quoted) in scripts.nnYou can also pass in any property as a parameter to your groovy script, and then access positionally:nne.g.nnhost = this.args[0]nnso youd use HOSTNAME as the parameters to your script in the datasource screen.nnThere is currently a risk that WILDVALUE, when substituted, could break the script syntax (if the WILDVALUE object contains a quote, say). That risk will go away in the coming release. Quote Link to post Share on other sites
0 Jean-Michel Toussaint 0 Posted May 3, 2012 Author Share Posted May 3, 2012 I have tried 220 , and 220 exact_sentence_returned_by_FTP.nnNot any better. Quote Link to post Share on other sites
0 Jerry Wiltse 4 Posted December 15, 2014 Share Posted December 15, 2014 Was this ever resolved?I will use WILDVALUE for now, but is there a better way? Quote Link to post Share on other sites
Question
Jean-Michel Toussaint 0
I am trying to use groovy to verify the connectivity of an FTP server following the FAQ (http://help.logicmonitor.com/using/da...)
Here is the exact script used:
import com.santaba.agent.groovyapi.expect.Expect
cli = Expect.open(\'\'x.x.x.x\'\', 21, 5)
cli.expect(\'\'220 \'\')
cli.send( \'\'user anonymous
\'\' )
cli.expect(\'\'331 \'\')
cli.send(\'\'pass meme
\'\')
cli.expect( \'\'230 \'\')
cli.send( \'\'quit
\'\' )
Unfortunately, the groovy debugger wither comes back with a timeout, or the following:
>> !groovy
End of stream reached, no match found
My FTP server, in turn, see the connection coming from the agent, but never receives the \'\'USER anonymous\'\' command.
Any Help welcome
Link to post
Share on other sites
3 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.