AIOps

AIOps

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.


#ITAutomation
#AIOps
#CloudPakforAIOps
#AIOps

 View Only
  • 1.  Dash Webgui tool function

    Posted 9 days ago

    Hi, we have a requirement to create a tool that will invoke javascript but also need it to execute SQL as well. We cannot seem to get this to work. 

    Example 

    script(foreach="true",language="JavaScript")
      {

    some code 

    if (x=1) {

    }

    else {

    sql(foreach="true",url="$(SERVER)/_tb37b/ael/Tool/Controller")
      {
        structure
        {
          text(data="update alerts.status set Location='")
          variable(name="username")
          text(data=");\u000d\n")
        }
      }

    }

    Any ideas on how we can get the above to work? 

    And once this is created manually, it can't be pulled in via the Dash Admin Tools function and edited because it will only save the SQL or Javascript part, depending on what tab is open when you click save. 



    ------------------------------
    Prem Sahota
    ------------------------------


  • 2.  RE: Dash Webgui tool function

    Posted 8 days ago

    Hi Prem,

    tools are either/or - you can't combine SQL and Javascript.

    And given that the javascript-Tool runs in the user's browser, it doesn't have any access to the ObjectServer.

    Not sure what you need to achieve - if you need javascript functions in the user's browser and want to modify the event, then one way I can think of is to launch a cgi-script from the javascript-Tool. The cgi then could modify the event via nco_sql. Not at all ideal, but would work.

    If you just need to run different SQLs based on a variable x, consider adding the variable to the update's where clause (I'm using Severity instead of your x in the example):

    update alerts.status set Location='%username' where Serial in ( $selected_rows.Serial ) and Severity < 3;
    update alerts.status set Customer='%username' where Serial in ( $selected_rows.Serial ) and Severity >=3;

    If you need the user to enter the "x" value you can even use a prompt to retrieve the info from the user.

    HTH,

    Michael



    ------------------------------
    Michael Troitzsch
    Solution Architect
    DICOS GmbH
    Darmstadt
    ------------------------------



  • 3.  RE: Dash Webgui tool function

    Posted 6 days ago

    Unclassified | Non classifié


     

    The javascript calling a cgi-script may be the best option for us. Can javascript call a script locally on the server? Can anyone provide an example on how to call a local script from within Javascript.






  • 4.  RE: Dash Webgui tool function

    Posted 7 days ago

    or you could your code in an impact policy 
    do your javascript and then do a eventenrichment in the same policy

    and have a simple http call to to restapi to launch it..
    https://www.ibm.com/docs/en/tivoli-netcoolimpact/7.1.0?topic=servers-accessing-policies-remotely-using-rest-api

    if you have impact that is :-)



    ------------------------------
    mario schuerewegen
    IBM
    Brussels
    ------------------------------



  • 5.  RE: Dash Webgui tool function

    Posted 6 days ago
    To add logic or developments, for example in Java, you must use Impact, create the project, policy, and service, then create the automation from AIOPS so that when it detects the rule, it calls the Impact automation. Currently, AIOPS has limitations in logic and rules, unlike what could be done in Omnibus. Another possibility is to have a Linux server, create the integration via SSH, and generate the programs/scripts to call and then execute remotely. The third option is to integrate an Ansible server and call the automation.

    Regards





  • 6.  RE: Dash Webgui tool function

    Posted 6 days ago

    Saury.  its a webgui question  :-)  so no aiops..  but NOI



    ------------------------------
    mario schuerewegen
    IBM
    Brussels
    ------------------------------



  • 7.  RE: Dash Webgui tool function

    Posted 5 days ago

    For Omnibus, you must create the tool and within the tool call the script, which must be on the Omnibus server. The tool sends the script parameters and the script calls the Java or Python. Another option is to use Impact and create an operator view so that when you run it from the menu, the operator view opens.

    If you'd like, you can give me an example of what you want to do so I can give you some guidance.

    Regards!





  • 8.  RE: Dash Webgui tool function

    Posted 5 days ago

    Unclassified | Non classifié


     

    Hi, the tool has to be created in Dash as that is where the Operators initiate any action against an event by right-clicking and then selecting the desired tool to be executed.