ExternalParameterShellExec configuration[Solved]

Started by BlackMamba, June 19, 2013, 01:18:26 PM

Previous topic - Next topic

BlackMamba

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:
1) A virtual machine, where NetXMS server and agent are installed.
2) 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.pl

I 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!

Alex Kirhenshtein

ExternalParameterShellExec ProvaExternal:/PATH/ProvaSSH.pl

Change it to

ExternalParameterShellExec=ProvaExternal:/PATH/ProvaSSH.pl

BlackMamba

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!

Alex Kirhenshtein