DX NetOps

 View Only
  • 1.  Oneclick service side execution button

    Posted Feb 17, 2021 06:23 AM
    Hi,

    I want to att a button in oneclick that execute a script on serverside, but before execution it should open a popup for adding more information. I know how to forward alarm information, but not how to create a popup to add more info before service side execution. If I also could present a dropdown list for the operator in the popup, I would be even more happy!

    /Roberth


  • 2.  RE: Oneclick service side execution button

    Broadcom Employee
    Posted Feb 25, 2021 11:19 AM
    Hi Robert,

    what you want it is not possible using a Oneclick console popup.

    My proposal is that you launch your action using a JSP page in Oneclick tomcat where you pass alarm information. That JSP page return a HTML with a form, including alarm data in hidden fields, to gather additional info. When user submit the form, a JSP (same or new) executes the script with the form input and reports the result.

    The user would only interact with one web page.

    Make sense?
    Regards


  • 3.  RE: Oneclick service side execution button

    Posted Feb 26, 2021 03:44 AM
    Edited by Robert Edberg Feb 26, 2021 03:45 AM
    Seems like a working solution. Is there any doc or guide on how to set this Up?

    /Roberth


  • 4.  RE: Oneclick service side execution button

    Broadcom Employee
    Posted Feb 26, 2021 03:52 AM
    Hi Robert,

    setting up a menu action to open a web browser is in the documentation

    https://techdocs.broadcom.com/us/en/ca-enterprise-software/it-operations-management/spectrum/10-4-3/customizing/oneclick-customization/customizing-the-oneclick-console-menu.html#concept.dita_13c8c10d37f0d977cb8c786c509bc435cf365932_AddaNewMenuItem

    The part related to JSP is not. There are multiple examples to create a JSP in Internet.

    If you give me some details I could create an example for you.

    Regards


  • 5.  RE: Oneclick service side execution button

    Posted Feb 26, 2021 05:13 AM
    OK, In this case I do not want to forward any attributes from Spectrum. I just a "emergency button" which opens a form were operator could choose a "receiver team" and a "message field" - which when received on server side will post the information to our notification platform API. The API part I have control over, so all I need is to present the form for the operators and to retrive the posted fields to backend script. The idea was to use Spectrum for this without rely on external web resources. And I know both web coding and Spectrum xml structures, so if you give me a jsp example, I think I can do the rest.

    /Roberth


  • 6.  RE: Oneclick service side execution button

    Broadcom Employee
    Posted Feb 26, 2021 06:00 AM
      |   view attached
    Hi Robert,

    attached a JSP example to copy in $SPECROOT/tomcat/webapps/spectrum/custom/index.jsp

    mkdir $SPECROOT/tomcat/webapps/spectrum/custom
    cp emergency.txt $SPECROOT/tomcat/webapps/spectrum/custom/emergency.jsp
    chown -R spectrum.spectrum $SPECROOT/tomcat/webapps/spectrum/custom

    The reason to place it under spectrum folder is the user will need to have been authenticated.

    This JSP can be invoked as from oneclick menu:

    <launch-browser> <url>http://<oneclick>:<port>/spectrum/custom/emergency.jsp</url> </launch-browser>

    In the example attached, team and message parameters are received by the JSP and an echo bash command is executed. Feel free to change it

    Regards



    Attachment(s)

    txt
    emergency.txt   2 KB 1 version


  • 7.  RE: Oneclick service side execution button

    Posted Feb 26, 2021 06:53 AM
    Superthanx Jose! Will have a closer look at it and will report back result.

    /Roberth