I'm trying to use SSH to push commands to devices through netXMS
I'm using $node->executeSSHCommand to push commands, but how do I use multiple lines of text? I know on MikroTik I can separate commands with a semi-colon, i.e.
This isn't viable for very long commands especially those with scripts in them that might be 50 lines or more. I can't compress them into a single line
So how do I do something like....
Or even inside a variable
This syntax is not valid in NetXMS. So how do I do it? I need SSH scripts to be human readable and editable. Impossible with very long single liners
I'm using $node->executeSSHCommand to push commands, but how do I use multiple lines of text? I know on MikroTik I can separate commands with a semi-colon, i.e.
Code Select
$node->executeSSHCommand(":log warning test;:log warning test2;:log warning test3");
This isn't viable for very long commands especially those with scripts in them that might be 50 lines or more. I can't compress them into a single line
So how do I do something like....
Code Select
$node->executeSSHCommand("
:log warning test
:log warning test2
:log warning test3
");
Or even inside a variable
Code Select
MyBigScript = {
:log warning test
:log warning test2
:log warning test3
};
$node->executeSSHCommand(MyBigScript);
This syntax is not valid in NetXMS. So how do I do it? I need SSH scripts to be human readable and editable. Impossible with very long single liners