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 action encode

Agent action encode

Scheduled Pinned Locked Moved Support
5 Posts 2 Posters 20.4k 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.
  • M
    M
    MarcusH
    wrote on last edited by
    #1

    Trying to create an action that runs a script but as soon as i have char åäö in parameter it seems like it fails to run the process, have agent in debuglevel 6 and no error shows up it runs process and it shows PID for it.

    I have verified that everything i can think of is utf8

    made debug script that logs to file if run Action=debug:/agent/script/ping.sh --message "$1"

    $node.executeAgentCommand("debug","test") runs fine and log files are created
    $node.executeAgentCommand("debug","testå") is executed according to agent log and gets PID but no logs are created and i can't figure any more deeper way to debug

    Running agent 5.2.6 on Debian 12 in docker

    if i run script in docker cli it works with åäö only fails when agent runs the script.

    Any tips or known issues?

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

      Something as simple as
      Action=debug:echo "$1" >> /tmp/a.txt
      works for me with these letters. But I did not try in Docker, can you check if this works there?

      Can you show your ping.sh script?

      1 Reply Last reply
      0
      • M
        M
        MarcusH
        wrote on last edited by
        #3
        #!/bin/sh
        # /agent/script/ping.sh
        LOG=/agent/script/logs
        mkdir -p "$LOG"
        
        TS="$(date -u +%Y%m%dT%H%M%SZ)"
        {
          echo "----- $TS -----"
          echo "PWD: $(pwd)"
          echo "USER: $(id)"
          echo "ARGV_STR: $*"
        } >> "$LOG/ping.txt"
        
        printf '%s\n' "$@" | od -An -t x1 >> "$LOG/ping-bytes.hex" 2>/dev/null || true
        

        i tried Action=debug:echo "$1" >> /agent/script/a.txt also to have it as simple as possible and
        $node.executeAgentCommand("debug","test") creates a.txt containing test
        $node.executeAgentCommand("debug","testå") does not create a.txt, not error in agent log just "Execution of external action debug (echo "testå" >> /agent/script/a.txt) started"

        If i run echo "testå" >> /agent/script/a.txt manually in same docker agent is running a.txt is created as utf8 and containing testå

        1 Reply Last reply
        0
        • M
          M
          MarcusH
          wrote on last edited by
          #4

          Tested with agent running on full debian 12 VM and no issue with åäö in action making this something with my docker setup it seems like.

          it is the official docker setup from github though, will see if i have messed something up.

          1 Reply Last reply
          0
          • M
            M
            MarcusH
            wrote on last edited by
            #5

            Found the issue, docker ran with POSIX had to add

            ENV LANG=C.UTF-8
            ENV LC_ALL=C.UTF-8

            Now it works with åäö

            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