Topic
  • 6 replies
  • Latest Post - ‏2012-10-09T15:17:07Z by SystemAdmin
SystemAdmin
SystemAdmin
1283 Posts

Pinned topic OMNIbus 7.3.1 Tools script

‏2012-09-26T20:22:48Z |
Is it possible to do sql in a script tool (javascript). If so please provide an example.
Updated on 2012-10-09T15:17:07Z at 2012-10-09T15:17:07Z by SystemAdmin
  • EngBernie
    EngBernie
    7 Posts

    Re: OMNIbus 7.3.1 Tools script

    ‏2012-09-27T05:58:47Z  
    There is a section in the administration guide for Omnibus. This is a link for script tool creation on WebGUI 7.3.1 but there are guides for other versions as well if you search the online guide (search for 'script tools').

    http://publib.boulder.ibm.com/infocenter/tivihelp/v8r1/topic/com.ibm.netcool_OMNIbus.doc_7.3.1/webtop/wip/task/web_cust_creatingscripttools.html
  • MarkByford
    MarkByford
    23 Posts

    Re: OMNIbus 7.3.1 Tools script

    ‏2012-09-27T08:13:32Z  
    Hi,

    Actually it depends. I suppose that you could in theory craft a script tool that POSTS data to a registered CGI that then runs some SQL against the ObjectServer. However, it seems a roundabout way to do things when there are SQL tools available.

    Is there any particular reason that you want to use a script tool (instead of an SQL tool)?

    Mark
  • jeffri
    jeffri
    20 Posts

    Re: OMNIbus 7.3.1 Tools script

    ‏2012-09-27T08:34:10Z  
    Hi,

    Actually it depends. I suppose that you could in theory craft a script tool that POSTS data to a registered CGI that then runs some SQL against the ObjectServer. However, it seems a roundabout way to do things when there are SQL tools available.

    Is there any particular reason that you want to use a script tool (instead of an SQL tool)?

    Mark
    Hi,

    Mark's right. At the moment CGI is pretty much the only way to do it.

    In the meantime please review the RFE at http://www.ibm.com/developerworks/rfe/execute?use_case=viewRfe&CR_ID=25354 to see if your use case is similar to that of the RFE's. If so, please consider adding your vote to the RFE and optionally add a comment there as well. If not, you can also raise a new RFE with your specific use case.

    Cheers,
    Jeffri
  • SystemAdmin
    SystemAdmin
    1283 Posts

    Re: OMNIbus 7.3.1 Tools script

    ‏2012-09-27T11:58:42Z  
    Thank you for you posts. I have been through the manuals. Example in manuals always seem to show the simplest use case. I guess I could have added more info myself. I already have cgi script to do all that I need but I was trying to see if I could use JavaScript to do the work instead. It seems that the scripts would be a lot simpler.

    Below is a very simple example that I would like to do. It is not complete because I need to know how to update the event based on the decision. Any help would be greatly appreciated. If this can not be done it would be appreciated if a developer in the know would indicate that. Thanks again for you posts.
    if ( "{@Status}" == "OPEN" && "{@OwnerUID}" == "Nobody") {

    // Here I would like to set Status to ACK
    alert("did ACK -> {@Status} ");
    }
    else
    {
    alert("Event already ACK by ");
    }
  • jeffri
    jeffri
    20 Posts

    Re: OMNIbus 7.3.1 Tools script

    ‏2012-10-03T18:16:18Z  
    Thank you for you posts. I have been through the manuals. Example in manuals always seem to show the simplest use case. I guess I could have added more info myself. I already have cgi script to do all that I need but I was trying to see if I could use JavaScript to do the work instead. It seems that the scripts would be a lot simpler.

    Below is a very simple example that I would like to do. It is not complete because I need to know how to update the event based on the decision. Any help would be greatly appreciated. If this can not be done it would be appreciated if a developer in the know would indicate that. Thanks again for you posts.
    if ( "{@Status}" == "OPEN" && "{@OwnerUID}" == "Nobody") {

    // Here I would like to set Status to ACK
    alert("did ACK -> {@Status} ");
    }
    else
    {
    alert("Event already ACK by ");
    }
    Hi,

    You can consider me as a developer in-the-know. I can state definitively that it is not possible to perform SQL updates via Script tools, nor is it possible to perform Javascript-like conditional logic in SQL tools.

    The only thing that's somewhat close to it is by using a SQL tool with a 'where' clause to the effect of:
    update ... where Serial=@Serial and Status='OPEN' and OwnerUID=65534;
    (Caveat: I've not tried this out, so the syntax may be wrong.)

    In this case executing the tool against an event whose Status is not OPEN or OwnerUID is something other than 65534 (Nobody) will not do anything (no-op), but I think the journal part of the tool will still be carried out. Also, the no-op will be silent - there's no indication to the operator that the tool execution didn't do anything.

    Hth,
    Jeffri
  • SystemAdmin
    SystemAdmin
    1283 Posts

    Re: OMNIbus 7.3.1 Tools script

    ‏2012-10-09T15:17:07Z  
    Jeffri Thank you for your post. In my opinion it would have made for an easier solution. I guess I will not be using the javascript method for much at this point in time. Thanks again.