DX NetOps

  • 1.  Option to run one script for multiple alarms using Right-click option in Spectrum OneClick

    Posted 09-04-2014 07:13 AM

    Hi All,

     

    Does anybody know if there is a way to perform a right-click in Spectrum which passes attributes for each of those alarms (e.g.: Alarm title and AlarmID) that runs 1 script which then iterates through each alarm and processes them?

     

    I can currently do this for 1 alarm, but it's still a pain to have to go and manually update each other alarm with the ticket Id of the Ticketing system afterwards!

     

    We are looking at for example being able to right-click multiple alarms and raise 1 request for all of those alarms, and then update some attributes with the request number (from the ticketing system).


    Is this possible? Has anyone managed to get something like this working?


    Thanks


    Frank



  • 2.  Re: Option to run one script for multiple alarms using Right-click option in Spectrum OneClick

    Posted 09-10-2014 01:19 PM

    I'll raise a Support incident for this one! Thanks.



  • 3.  Re: Option to run one script for multiple alarms using Right-click option in Spectrum OneClick
    Best Answer

    Posted 05-26-2015 05:33 PM

    As this just came up again, I thought I would post this here.

     

    This can now be done with versions

        9.3 H02, H03

        9.4.2, 9.4.2.1

     

    When selecting multiple alarms OneClick can execute a script for each of the alarms selected

     

    For this to work you will need one of the above versions and also need to add

     

     

     

     

    <run-for-multiple-alarms />

     

    Right before

     

    </launch-web-server-script>

     

    $SPECROOT/custom/console/config/custom-menu-config.xml

     

    Example

    <menu name="Client Cases">

    <item name="Submit Incident"> 

      <action>

         <launch-web-server-script>

            <command>

                    C:/spectrum/tmp/manual_incident.bat {0} {1}

            </command>

              <param>

                   <attribute> AlarmAttrID.ALARM_ID</attribute>

              </param>

              <param>

                    <attribute>AttributeID.NETWORK_ADDRESS</attribute>

               </param>

              <display-exit-status>

                 <status code="1">Could not open file</status>

                 <status code="2">Bad parameter</status>

                 <status code="3">Could not connect to the server</status>

                 <status default="true">Unknown error code {0}</status>

            </display-exit-status>

            <run-for-multiple-alarms />

          </launch-web-server-script>

        </action>

      </item>

    </menu>

     


    -Greg



  • 4.  Re: Option to run one script for multiple alarms using Right-click option in Spectrum OneClick

    Posted 05-27-2015 07:06 AM

    Thanks Greg, I'll try this out this weekend!

     

    This looks like it will run multiple scripts x times. What I was looking for was running 1 script with x items, but this should do for now!


    Regards,

     

    Frank



  • 5.  Re: Option to run one script for multiple alarms using Right-click option in Spectrum OneClick

    Posted 05-27-2015 12:01 PM

    Hi frank,

     

        You are trying to create one ticket for multiple alarms with all alarm details?So it can help me also .



  • 6.  Re: Option to run one script for multiple alarms using Right-click option in Spectrum OneClick

    Posted 10-11-2016 09:52 AM

    Hello Frank,

     

    one of our customers would like to use this feature as well, but it is not working as expected.

    Our customer would like to to set multiple devices in maintenance by selecting several alarms and use a script called set_Maintenance_On.sh.

    If only one alarm is selected, the device having this alarm can be set in maintenance using this script without any problem.

    If more than one alarm is selected, the option for enabling maintenance via this script is grayed out.

    Following you see the entry within the custom-menu-config.xml:

     

      <menu name="Maintenance">
        <item name="Set Maintenance On">
          <privilege>
            <name>Maintenance</name>
            <any-access/>
          </privilege>
          <popup-visibility>when-filter-passed</popup-visibility>
          <action>
            <context>com.aprisma.spectrum.app.topo.client.render.ModelContext </context>
            <context>com.aprisma.spectrum.app.alarm.client.group.AlarmContext</context>
              <filter>
                <and>
                  <not>
                  <attribute-list id="AttributeID.MTYPE_HANDLE">
                     0x1046e,
                     0x1046f,
                     0x3dc0001
                  </attribute-list>
                  </not>
                 <has-attribute>AttributeID.NETWORK_ADDRESS</has-attribute>
                </and>
              </filter>

     

            <launch-web-server-script>
               <command>
                 /nms/data/scripts/spectrum/OC_scripts/Maintenance/set_Maintenance_On.sh {0} {1}
               </command>
              <param>
              <attribute>AttributeID.NETWORK_ADDRESS</attribute>
              </param>
              <param>
              <expression>
                com.aprisma.spectrum.app.util.context.DefaultApplicationContext.getGlobalParameter
                (com.aprisma.spectrum.app.util.context.ApplicationContext.USER_PARAMETER_NAME)
              </expression>
              </param>
              <display-output stdout="t"/>
            <run-for-multiple-alarms />
            </launch-web-server-script>
          </action>
        </item>

     

    Do you (or anybody else) have an idea, why the option is grayed out when more than one alarm is selected?

     

    Is the use of <run-for-multiple-alarms /> wrong in this example?

     

    Any hints, I would be very thankful!

     

    BR,

    René



  • 7.  Re: Option to run one script for multiple alarms using Right-click option in Spectrum OneClick

    Posted 10-11-2016 10:10 AM

    Hi René,

     

    Sorry to say I haven't progressed much further with this as we ended up writing scripts which the NOC ran from the servers using the REST API. Not as ideal as what you want to do but at the same time allow us to set many devices into maintenance. (We didn't use Maintenance mode, but instead set attributes which removed them from one filter to another. This was because they still wanted to have the ability to see what was going on with the device but didn't want it to be visible in the usual filters. Maintenance mode didn't let them do this).

     

    I've never looked at this since. I hope you manage to find out if this works as it's been something a few people I know have been trying to do. Did you raise a ticket for this?

     

    Good luck. 

     

    Frank



  • 8.  Re: Option to run one script for multiple alarms using Right-click option in Spectrum OneClick

    Posted 10-13-2016 03:48 AM

    Hi Frank,

     

    thanks for your replay. I have opened a support ticket now.

     

    Best regards,

    René



  • 9.  Re: Option to run one script for multiple alarms using Right-click option in Spectrum OneClick

    Posted 01-26-2016 09:12 AM

    Hi Gregory, I cannot make it work a ascript from a oneclick (only webserver and over linux)

     

      <item name="PacketLoss">

            <popup-visibility>when-enabled</popup-visibility>

             <action>

                <launch-web-server-script>

                     <command>expect /opt/Spectrum/test-packetloss.sh {0}</command>

                     <param>

                          <attribute>AttributeID.NETWORK_ADDRESS</attribute>

                     </param>

                    </launch-web-server-script>

           </action>

      </item>

     

    Running it manually work perfect, but from oneclick nothing happends, what Im missing? the script must be on poller or webserver?

     

    Thanks!

    Diego MP



  • 10.  Re: Option to run one script for multiple alarms using Right-click option in Spectrum OneClick

    Posted 01-26-2016 10:44 AM

    Nevermind, i forget some tags.. its working now

     

    <context>com.aprisma.spectrum.app.topo.client.render.ModelContext </context>
    <context>com.aprisma.spectrum.app.alarm.client.group.AlarmContext </context>


  • 11.  Re: Option to run one script for multiple alarms using Right-click option in Spectrum OneClick

    Posted 10-21-2016 01:36 AM

    Hi All,

     

    I am looking similar functionality like right click an alarm and send email with specific format to raise incident in BMC Remedy.

    I trying it with script and external email utility as format we of email we cant change in Spectrum (manual email not via setscript)

     

    i am using following code:

     

    <menu name="Tools">
       <item name="Remedy">
          <action>
          <launch-web-server-script>
                <command>
                         E:/Email/Remedy1.bat {0}
                </command>
                 <param>
                      <attribute> AlarmAttrID.CAUSE_CODE</attribute>
                 </param>
           </launch-web-server-script>
          </action>
       </item>
    </menu>

     

    I have tested it manually by giving an input and its working.

    But from menu its not

     

    Regards

    Ajit C