Need help trying to figure out this DataSource I found online.
Hey everyone. I found this DataSource online that monitors if an SFTP connection is working. The source is here: blog.mikesuding.com/2017/04/08/monitor-sftp-site-connection-and-login/
Unfortunately, I haven't been able to get the groovy script working. There's not much documentation that comes with the script. The only info it provides says to set the sftp.site = wowie.us, sftp-user = mike, sftp-pass = ***. Now, I'm sure that I'm supposed to using my OWN sftp site, my OWN sftp user, and my OWN sftp pass, but I could be wrong. The other thing I'm confused about is where In the groovy script I'm supposed to change these properties. Inside the "Applies To" textfield, it's automatically populated with sftp.site && sftp.user && sftp.pass, but isn't this field supposed to be for the device that you want the datasource attached to? If it's asking me to substitute the variables here, then how do I do that? I'm unsure of the syntax.
There's also a few function calls in the groovy script.
def host = hostProps.get("sftp.site")
def user = hostProps.get("sftp.user")
def pass = hostProps.get("sftp.pass")
def port = hostProps.get("port") ?: '22';
It seems reasonable that this is where I want substitute my own sftp credentials. Of course, when I do this and run it, I return a error that says "Host cannot be NULL". Something is breaking, and I don't know what it is.