ExternalParameterShellExec configuration[Solved]
-
Hi to all!
I'm trying to set up the ExternalParameterShellExec in my NetXMS, but I'm having some issues in accomplish my goal. Before you ask, I already read this post and I followed the instructions in it, but I need help anyway.
First of all, I'm working on a test system, set up in this way:- A virtual machine, where NetXMS server and agent are installed.
- A phisical local machine, where NetXMS consolle and agent are installed.
Just to test the ExternalParameterShellExec, I want to create a parameter in the phisical machine (2) which executes a Perl script. This script is very simple and executes a ls on the virtual machine using ssh. This is my perl script's code:
#!/usr/bin/perl use Net::SSH::Perl; my $host = "IP"; my $usr = "USER"; my $pwd = "PASSWORD"; my $ssh = Net::SSH::Perl->new($host); my $command ="ls -l"; $ssh->login($usr,$pwd); print+($ssh->cmd($command))[0], "\n"; __END__This script works, I've tested it running it directly from unix shell in the local machine (2). So, as written in this post, i set up the local machine's agent to execute this script. Agent's config file is:
MasterServers = XXX, YYY EnableSubagentAutoload = yes LogFile = /var/log/nxagentd.log FileStore = /tmp ListenAddress = 0.0.0.0 EnableActions = yes SubAgent=portcheck.nsm ExternalParameterShellExec ProvaExternal:/PATH/ProvaSSH.plI execute the node's poll and then, in DCI, I expect to find ProvaExternal as parameter provided by the agent. But I can't find ProvaExternal anywhere in the DCI. What's the issue here? What am I doing wrong?
Thanks in advance for the help!
-
ExternalParameterShellExec ProvaExternal:/PATH/ProvaSSH.plChange it to
ExternalParameterShellExec=ProvaExternal:/PATH/ProvaSSH.pl -
It worked! Thank you Alex! It was so easy, but here is explained without "=". I suggest you to modify that sticky topic, if it's possible, because it's really useful!
Thanks again! -
Thanks for the tip, I've fixed that topic.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login