Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (Flatly)
  • No Skin
Collapse
Brand Logo

NetXMS Forum

  1. Home
  2. Support
  3. ExternalParameterShellExec configuration[Solved]

ExternalParameterShellExec configuration[Solved]

Scheduled Pinned Locked Moved Support
4 Posts 2 Posters 17.2k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B
    B
    BlackMamba
    wrote on last edited by
    #1

    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!

    1 Reply Last reply
    0
    • A
      A
      Alex Kirhenshtein
      wrote on last edited by
      #2
      ExternalParameterShellExec ProvaExternal:/PATH/ProvaSSH.pl
      

      Change it to

      ExternalParameterShellExec=ProvaExternal:/PATH/ProvaSSH.pl
      
      1 Reply Last reply
      0
      • B
        B
        BlackMamba
        wrote on last edited by
        #3

        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!

        1 Reply Last reply
        0
        • A
          A
          Alex Kirhenshtein
          wrote on last edited by
          #4

          Thanks for the tip, I've fixed that topic.

          1 Reply Last reply
          0

          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
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          Powered by NodeBB Contributors
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups