Implemented

Add Application Name variable to Windows Powershell script component

I am deploying Windows Powershell script components to monitor Windows Scheduled Tasks.  I am currently using the Script Argument field to provide the name of the scheduled task,

but it would be great if I could simply substitute the name of the application (the same name as the task in my case), e.g. an ${ApplicationName} variable.

  • Unfortunately there is not at this time.

  • Although from aLTeReGo's list above, I think I already know the answer to my question, I will ask anyway in case I am wrong.

    Having the ability to use the threshold values in a script by referencing the associated variables is great.  However if you don't know the equation term (ie: greater than, equal to, etc.) then you cannot evaluate, within the script, what the Event status will be when the script results get back to Orion.  While that is the better argument for needing it available, my need is actually so that I can display a representation for the term (ie: >, =, etc.) along with the set threshold values in my response (ex: "(>80/90)" for Warning at greater than 80 and Critical at greater than 90).  This makes is easier for our Engineers who don't have edit access to the Application Monitors to see what the currents settings are/were at the time of the Event trigger whether they are viewing in the webpages or in the Alert email sent out.

    So is there a variable that says what equation term is being used for each Script Output?

  • I actually did run into a problem but your help did get me further along as usual.  I also did figure a way around the issue and would like to share my findings.  At the end, I am also making some suggestions which support earlier product enhancement requests I have submitted.

    Before the addition of the "Display Name" field I was creating the "Unique ID" names using a number at the beginning in order to organize the order in which the output fields and values display on the SAM webpages.  So the Unique names looked something like the following:

    "Unique ID" value

    01_DB_Stat

    02_DB_Nam

    ...

    09_Growth_Avail

    10_Threshold_Levels

    This gave me something similar to this with order of fields that I wanted:

    pastedImage_3.png

    When the "Display Name" field was introduced I was hoping that I could then put a more readable name in that field and that the order on the SAM webpages would still be based on the "Unique ID" field.  So my plan was similar to the following:

    "Unique ID" value

    "Display Name" value

    01_DB_Stat

    Database Status

    02_DB_Nam

    Database Name

    ...

    ...

    09_Growth_AvailGrowth Available

    10_Threshold_Levels

    Threshold Settings

    However I quickly found that the order on the SAM webpages would follow the "Display Name" which was a bit of a let down.  So I just continued using the naming convention I had been using for both the "Unique ID" and "Display Name" values.  (As a side note, either basing the order on the "Unique ID" field or providing a new field that allow you to have the order you want on the SAM webpage, would be very helpful.  But I digress...)  So here is the new names I came up with at that point:

    "Unique ID" value

    "Display Name" value

    01_DB_Stat

    01 Database Status

    02_DB_Nam

    02 Database Name

    ...

    ...

    09_Growth_Avail

    09 Growth Available

    10_Threshold_Levels

    10 Threshold Settings

    So now there is this Threshold variable situation.  As I stated in my previous post, the syntax you provided works great.  That is until you have a combination of a "Display Name" that uses a dot-number combination and/or that has spaces in them, such as ${Threshold.Warning.09 Growth Available} or ${Threshold.Critical.09 Growth Available} and where the threshold value is blank.  It appears that SAM only generates the variable if the particular threshold field in Orion is not blank.  Otherwise the variable is not created.  Then when the Perl script tries to use the variable, Perl fails.  So now if I am going to keep the order on the SAM webpage and also expect that a threshold value may be blank, I have to redesign the "Display Name" again.  In this case, I added an underscores again because they are the least intrusive to the looks of the name.  Here is the new values:

    "Unique ID" value

    "Display Name" value

    01_DB_Stat

    _01_Database_Status

    02_DB_Nam

    _02_Database_Name

    ...

    ...

    09_Growth_Avail

    _09_Growth_Available

    10_Threshold_Levels

    _10_Threshold_Settings

    While I can do this, it seems to me like it defeats the purpose of the "Display Name".  To address everything I have mentioned here, it seem like a better design would be to have the threshold variables use the "Unique ID" value as well as using the "Unique ID" value determine the order of the items on the SAM webpages.  That would then leave the user free to insert whatever "Display Name" they wanted to use.  The "Display Name" could then be more reader friendly on the SAM webpages without dictating the order of the items in the listing.

    Hopefully that made sense...  If any questions, please let me know...

    Mike

  • OK...  That was what I was trying in my original post and it was not working.  Of course now that aLTeReGo is involved it works.  I have a partner like that as well.  Many attempts to accomplish something fail until he gets involved and then all works.  Thanks again aLTeReGo.

  • format for using the Threshold macros in multi-value scripts is ${Threshold.Warning.DisplayName} or ${Threshold.Critical.DisplayName}


    multi-value script output.png


    multi-value script macro.png