NetXMS Support Forum

English Support => General Support => Topic started by: Lanpingner on April 07, 2019, 09:41:23 PM

Title: Run ssh command through agent
Post by: Lanpingner on April 07, 2019, 09:41:23 PM
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
Title: Re: Run ssh command through agent
Post by: Victor Kirhenshtein on April 09, 2019, 10:28:00 AM
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