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. [Solved]Action configuration - Issue with command execution on management server

[Solved]Action configuration - Issue with command execution on management server

Scheduled Pinned Locked Moved Support
4 Posts 2 Posters 36.7k 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.
  • V
    V
    vishal21
    wrote on last edited by
    #1

    I am trying to integrate NetXMS with CA Unicenter in order to generate automated tickets.

    For this I am using a utility from CA called "cawto". With this utility I can send an event to the CA NSM server with the alert message as generated by NetXMS. Based on the received event, CA NSM then creates ticket in CA Unicenter. I am using below command as an Action in NetXMS to send the events to NSM.

    //opt//CA//SharedComponents//ccs//bin//cawto -n waqnsm91 NETXMS - ALERT - %n - %a - %m
    

    Where waqnsm91 is my CA NSM server.

    Condition 1:This works perfectly and I can see an event in CA NSM when the contents of message variable %m is in plane text or without any special characters like below,
    %m = Node down.

    Condition 2: But the command execution fails if the contents of message variable %m is having some characters like " or () or / .

    Ex.
    %m = Interface "Ethernet100/1/47 (Temp Laptop Connections)" changed state to DOWN (IP Addr: 0.0.0.0/0.0.0.0, IfIndex: 526584704)

    In this case, since the message contains the IfName and IfAlias it comes with a slash / and the bracket () which causes the execution to fail.

    To verify this I am executing a parallel action as below,

    echo HOST - %n - %a - %m >> //home//vishalb//netxms.log
    

    Please help me to get this fixed if anyone also faced this issue.

    Thanks in Advance.

    Vishal Babrekar

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

      Hi!

      You have to escape text properly before passing to command line, or enclose text in quotes. Try to define your command as

      /opt/CA/SharedComponents/ccs/bin/cawto -n waqnsm91 NETXMS - ALERT - %n - %a - '%m'
      

      Btw, you don't need to put / twice - only the backslash (\).

      Alternative approach could be to use NXSL script to escape special characters in event message with backslash.

      Best regards,
      Victor

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

        Great!! Thanks Victor.

        Adding the '%m' seems to have fixed this issue. Because I am seeing the desired output in my log file //home//vishalb//netxms.log. I am now checking with my CA team if they are receiving it correctly or not. I'll update you soon.

        Thanks,
        Vishal Babrekar

        1 Reply Last reply
        0
        • V
          V
          vishal21
          wrote on last edited by
          #4

          Hi Victor,

          Its now confirmed that CA NSM is receiving NetXMS alerts correctly and now they also started auto generated incident creation in CA Unicenter. So we can confirm that this integration of NetXMS with CA Unicenter worked well.

          For those who are also looking for integrating NetXMS with CA Unicenter for creation of auto generated incidents can also refer this.

          Thanks,
          Vishal Babrekar

          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