Outbound integration on xMatters agent fails with TypeError

Not Yet Reviewed

Hi,

Following the example to execute a script on an xMatters Agent on Windows for an outbound integration (copy of the example below). I always get an error TypeError: Cannot get property "1" of null

I see the failing line is the "var script = Shell.script...".

Any ideas of what could be the issue???

 

if (osname.startsWith('Windows')) 

   // create a script and pass some parameters into it.
   var script = Shell.script(function () {/* REM #### PLACE YOUR .BAT SCRIPT BETWEEN HERE ##### 
   cd c:\ 
   dir echo 
   echo This user ${user} from ${company}
   echo %date% %time% : Hostname is %computername%
   REM ##### AND HERE #### */ }, 
   {user: "Mary McBride", company: "xMatters"}); 

   // Execute it console.log("Output:");

 

Regards,

RB

0

Comments

2 comments
Date Votes

Please sign in to leave a comment.

  • Hey RB,

       I ran into that a while back as well. I thought they fixed the example script, sorry about that. The issue is you can't have a space between the */ and the closing }. 

    So try this:

     

       // create a script and pass some parameters into it.
       var script = Shell.script(function () {/* REM #### PLACE YOUR .BAT SCRIPT BETWEEN HERE ##### 
       cd c:\ 
       dir echo 
       echo This user ${user} from ${company}
       echo %date% %time% : Hostname is %computername%
       REM ##### AND HERE #### */}, // NOTICE THERE IS NO SPACE AFTER THE */
       {user: "Mary McBride", company: "xMatters"}); 

     

    I'll see if we can update the doc and relax the parser. 

    Let me know how it goes!

    --- Travis

     

    0
  • This just recently, today, came in handy for me as well. Thanks for the input Travis :)

    0

Didn't find what you were looking for?

New post