DX Operational Intelligence

Expand all | Collapse all

SOI Alarm Enrichment for 2 variables

  • 1.  SOI Alarm Enrichment for 2 variables

    Posted 07-30-2018 07:43 AM

    Brahma

    Dear Brahma/Team,

     

    I need an assistance regarding the alarm enrichment issue which I am facing currently. Actually I am trying to pass 2 variable as arguments in a single policy so that I can set it to 2 custom user attributes. However it looks like for single variable it works fine. For the 2nd one it is not printing the value instead it is appended with attrribute1. Please find the below screen shot and script for your reference.

     

    Alarm Message:

     

    A "Veritas Backup Failure" event has occurred, from Host_systemEDGE device, named MNDCEMSTND15.uidai.com.

     

    BackupJobID=100612
    BackupJobStatusErrorCode=98
    BackupPolicyName=NDMP_Backup1
    BackupScheduleName=Daily_Inc
    ClientServerName=Server_2
    Owner=root
    BackupMasterServerName=hdcsymbkpmas

     

    VBS:

     

    clientserver1=WScript.Arguments(0)
    segments=Split(clientserver1," ")
    pstr=segments(0)
    client=Replace(pstr, " ", "")
    WScript.Echo "clientserver,",client

     

    errorcode1=WScript.Arguments(1)
    segments1=Split(errorcode1," ")
    pstr1=segments1(0)
    error=Replace(pstr1, " ", "")
    WScript.Echo "errorcode,",error

     

    Policy:

     

     

    Output:

     

    #@@



  • 2.  Re: SOI Alarm Enrichment for 2 variables

    Posted 07-30-2018 08:11 AM

    Hi Mukul,

     

    Can you run the VB Script manually by passing the message and see if you are able to print both Variable 1 & Variable 2?

    Or, you may update the VB Script to write the output into .log file and see if the script is working

     

    Thanks

    Brahma



  • 3.  Re: SOI Alarm Enrichment for 2 variables

    Posted 07-30-2018 08:30 AM

    1.  The below VB code says, you are returning “errorcode” but isn’t “errorcode1” that you should return?

     

     

    errorcode1=WScript.Arguments(1)

    segments1=Split(errorcode1," ")

    pstr1=segments1(0)

    error=Replace(pstr1, " ", "")

    WScript.Echo "errorcode,",error

     

      1.  Print this output into a .log file to see the return value



  • 4.  Re: SOI Alarm Enrichment for 2 variables

    Posted 07-30-2018 08:47 AM
      |   view attached

    Yes, I can print both value. errorcode is mentioned custom attribute 10. Please see the previous screen shot in the post.

     

     

     

     

     

    Best Regards,

    Md Mukul Hasan | UIDAI EMS Team

    HCL Infotech Limited

    Email: hasan.md@hcl.com<mailto:hasan.md@hcl.com> | md.mukulhasan@uidai.net.in

    Mob: +91-9985836245



  • 5.  Re: SOI Alarm Enrichment for 2 variables

    Posted 07-30-2018 09:58 AM

    Hi Mukul,

     

    If you are sure that the vb script runs from command line and printing expected value, then try with below syntax as the script expecting paired values, it should be in below format

     

    WScript.Echo "retval1,India,retval2,USA"

     

    Note:     Variable retval1 gets “India”

                    Variable retval2 gets “USA”

     

    Thanks

    Brahma



  • 6.  Re: SOI Alarm Enrichment for 2 variables

    Posted 07-30-2018 10:17 AM
      |   view attached

    Thanks Brahma. In that case nothing is printing. Please see the last print output.

     

     

     

     

    Best Regards,

    Md Mukul Hasan | UIDAI EMS Team

    HCL Infotech Limited

    Email: hasan.md@hcl.com<mailto:hasan.md@hcl.com> | md.mukulhasan@uidai.net.in

    Mob: +91-9985836245



  • 7.  Re: SOI Alarm Enrichment for 2 variables

    Posted 07-30-2018 11:01 AM

    Can you try with this…

     

    WScript.Echo "clientserver",client,"errorcode",errorcode1



  • 8.  Re: SOI Alarm Enrichment for 2 variables

    Posted 07-30-2018 11:25 AM

    No luck sirji. Let me open a case and will work on it tomorrow over webex.

     

     

    Best Regards,

    Md Mukul Hasan | UIDAI EMS Team

    HCL Infotech Limited

    Email: hasan.md@hcl.com<mailto:hasan.md@hcl.com> | md.mukulhasan@uidai.net.in

    Mob: +91-9985836245



  • 9.  Re: SOI Alarm Enrichment for 2 variables

    Posted 07-30-2018 11:33 AM

    Support Case raised:  01153639



  • 10.  Re: SOI Alarm Enrichment for 2 variables

    Posted 07-31-2018 08:56 AM

    The output has to be a paired list, separated by comma.

    Thus, the (single) ECHO command in the script should be:

    WScript.Echo "clientserver,",client,",errorcode,",error

    • clienserver is the first variable name, followed by "," as part of the string
    • client is the value of the first variable
    • errorcode is the second variable name, preceded and followed by "," as part of the string
    • error is the value of the second variable

    Per your example, the output of that line would be:

    "clientserver,Server 2,errorcode,98"

     

    Remove the two single output lines from your script, e.g. 

    WScript.Echo "clientserver,",client

    WScript.Echo "errorcode,",error

     

    MichaelBoehm