Run ssh command through agent

Started by Lanpingner, April 07, 2019, 09:41:23 PM

Previous topic - Next topic

Lanpingner

Hi every one

I would like to to run a ssh command through my agent as a script
I puted the subagent in the nxagentd.conf
SubAgent = ssh.nsm

I tried this

Ssh.command(ip,"username","password","reboot now")
and i got back this

Error 11 in line 1: Function not found

Does anybody have any idea why this dont want to work?
Thanks for any help

Victor Kirhenshtein

Hi,

it is not NXSL function, but list provided by agent. You can call it from NXSL script like this:

AgentReadList($node, "SSH.Command(ip,login,password,command");

Use string concatenation to insert dynamic values.

Best regards,
Victor