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 error

ExternalParameterShellExec error

Scheduled Pinned Locked Moved Support
2 Posts 2 Posters 11.5k 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.
  • A
    A
    Abraxas
    wrote on last edited by
    #1

    Hi,
    I've bene using NetXMS for a long time, but I recently moved to a new set of servers and rain into some strange problems.
    I have the following script:
    #! /bin/bash
    LOG_FILE="/var/log/rating_engine.log"
    STATE=`/etc/init.d/vrrpd show_state`;
    if [[ ! -f "/tmp/ccup_running.lock" ]]; then
      if [ "$STATE" = "State is master." ]; then
              LAST_RUN=`tac $LOG_FILE | grep -m 1 "Billing ended" | tr -s ' ' | cut -d ' ' -f 1,2`
              LAST_RUN_DATE=$(date -ud "$LAST_RUN" +'%s')
              CURRENT_DATE=`date +%s`
              TIME_DIFF=$((CURRENT_DATE-LAST_RUN_DATE))

              if [ $TIME_DIFF -gt 180 ];then
                      echo "1"
              else
                      echo "0"
              fi
      else
              echo "0"
      fi
    else
      echo "0"
    fi
    The script returns 0 or 1, as needed, but on the NetXMS server I only have 0s

    In all older versions it has been working fine. On the new ones (NetXMS Core Agent Version 4.1.333 Build 4.1-333-gf37ab67d18 (UNICODE) in this case), the server always sees 0.
    When I try nxget from the server, I get:

    tac: write error: Broken pipe

    Also I noticed the when I try to add this as a new parameter for that node, I see the data type as "string" I am returning 0 or 1, and used to set these as Integer. How can I change the data type from the agent?

    1 Reply Last reply
    0
    • F
      F
      Filipp Sudanov
      wrote on last edited by
      #2

      At some point external parameters started to capture STDERR in addition to STDOUT. Most probably your script produces some sort of textual error that is being captured. Then NetXMS tries to interpret it as integer and this way it becomes 0.

      You can check with nxget

      nxget IP_ADDRESS_OF_AGENT name_of_the_parameter
      
      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