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. Agent Config (Action / ExternalParam)

Agent Config (Action / ExternalParam)

Scheduled Pinned Locked Moved Support
3 Posts 2 Posters 135.0k 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.
  • J
    J
    jdl
    wrote on last edited by
    #1

    Dear all,

    Could some one, please, elaborate a bit on how to configure AND use "Action", "ExternalParameter" and "ExternalParameterShellExec"?
    The available documentation presents a "dead loop" in section "Agent configuration" pointers are pointing to this same section for more details...
    Unfortunately, I did not find any complete explanation on this forum though there are some very interseting topics.

    Many Thanks in advance for your help/support. ;D

    Expected info:

    • Syntax for action definition in nxagentd.conf (not in doc)
    • How to use returned / collected info in NetXMS console for both action and external parameter

    A nice way would be to explain how to - for example - execute a script or system command (ping, ps or netstat), extract some info after treatment of the output (grep, wc, cut, sed and the like), define event and threshold related to returned info.

    Suggestion: copy/past your contribution to the user manualย  ๐Ÿ˜‰

    1 Reply Last reply
    0
    • J
      J
      jdl
      wrote on last edited by
      #2

      Well as I managed to get through some of this by myself, I'm summarizing a small "HowTo" so you can as well enjoy...

      Actions
      Actions can be defined on the server using the panel "Actions". Very easy, one shall only follow the kind of wizard.
      So far I only used the sending of email for which one shall not forget to define both SMTP server (SMTPserver parameter) and server email address (SMTPFromAddr parameter)

      Using the macros provided on the last page of the user manual, one can easily format both email content and subject.

      Note, if you want to put several email addresses for destination, use the ";" to separate them. Funny is that as recipient you don't see who else has received the email from NetXMS.

      ExternalParameter and ExternalParameterShellExec
      The difference is explained somewhere in the forum or user manual. The ShellExec is to be used for those processes or parameters that are interpreted by some additional process: bash, perl or the like.

      Then in your agent configuration file (pay attention to respect the declaration order see Log Parser issue in this forum) you define the script you want to run and that is providing the data which will be collected to get graphed or monitored in order to generate alarms.

      Syntax is:
      ExternalParameterShellExec=<data_collection_name>{(*)}: <script_path> {$1} {$2} .. {$i}
      where <data_collection_name> will be your reference to be used in the data collection definition in NetXMS console, you will have to append (*) to the name if you have parameters to provide. Those parameters are represented by the optional $1, $2... $i. As many as you have parameters.

      So example:
      ExternalParameterShellExec=my_data_coll(*): /home/netxms/my_mon_script.pl $1 $2
      This states that you will provide 2 parameters to the script my_mon_script.pl in the data collection definition

      Pay attention that in bash the value is returned using echo which in perl, this value is returned by printing out to the standard output. Do not use exit or return.

      Pay attention... starting your script by /usr/bin/perl my_mon_script.pl will not call a bash... while ./my_mon_script.pl does! Taouw... as Homer says ๐Ÿ˜ฎ

      Data collection
      Now in NetXMS console you want to define the data collection based on this script.

      You will have to select the NetXMS Agent as origin and insert your <data_collection_name> which by the way you will not find in the available list. I did not try but I would suggest not to use any existing data collection name... Possible conflict or simply possible problem easy to avoid - play it safe and simple ๐Ÿ˜‰
      There enter as well your parameter(s) if any required.
      Up to you to tweak / transform the data or define your threshold.

      Hope this helps
      Regards,

      Jdamien

      ----

      Update, Alex: see also http://wiki.netxms.org/wiki/ExternalParametersProvider

      1 Reply Last reply
      0
      • V
        V
        Victor Kirhenshtein
        wrote on last edited by
        #3

        Thank you for excellent howto! I'll probably never manage to write so long text ๐Ÿ™‚

        Some comments and corrections:

        @jdl said in Agent Config (Action / ExternalParam):

        which by the way you will not find in the available list

        You will, but only after next configuration poll for that node. To prevent sending request for supported parameters to agent each time you press "Select" button in console, server reads list of supported parameters during configuration poll (each hour by default) and caches it. You should either wait for next configuration poll or force immediate configuration poll from console using Poll -> Configuration menu.

        @jdl said in Agent Config (Action / ExternalParam):

        I did not try but I would suggest not to use any existing data collection name... Possible conflict or simply possible problem easy to avoid - play it safe and simple ๐Ÿ˜‰

        In fact, you can use names of existing parameters - if you do, built-in parameter's handler will be replaced by your script. Normally, this should be avoided, but sometimes it may help - for example, if built-in implementation of certain parameter is buggy, and you are able to provide replacement script as workaround.

        Best regards,
        Victor

        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