Seiji Takeuchi (Customer) asked a question.

I would like to ask how to use Active Script Performance monitor.

I'm having a problem to configure Active Script Performance monitor.

​

I checked web manual and some discussions, however I can't get it.

​

My requirement is below.

​

I would like to get a value of device's memory utilization as a performance monitor.

According to the vendor of this device, the memory utilization is calculated by the following formula.

​

memory utilization

= [The value of "hrStorageUsed" which "hrStorageDescr" is ”Physical memory”] – [The value of "hrStorageUsed" which "hrStorageDescr" is ”Cached memory”] – [The value of "hrStorageUsed" which "hrStorageDescr" is "Memory buffers”]

/ [The value of "hrStorageSize" which "hrStorageDescr" is ”Physical memory”]

​

I checked about performance monitors and found out, (I mean guessing cause haven't completed yet, anyway) Active Script Performance monitor is the solution for this requirement.

​

So, the first, I started to configure to get some SNMP OID.

Like "hrStorageUsed" can be got by polling "1.3.6.1.2.1.25.2.3.1.6" and instance of it.

​

So I configured some variables with WUG.

After that, I have no idea to use them to complete the formula.

​

Actually, I have no knowledge of any VB nor J Scripts.

I really know only basics of it.

 

Please someone help me and tell me if the solution is correct, and describe how to use and build Active Script Performance monitor.

 

Thanks,

​


  • Ricardo Rodrigues (Progress Software)

    Hi @Seiji Takeuchi (Customer)​ ,

     

    This post may help: https://community.progress.com/s/question/0D54Q0000A3KcvNSQS/how-to-monitor-systemuptime-kpi-in-wug-2202-version?fromEmail=1&s1oid=00D3000000007FS&s1nid=0DB4Q000000Gn0b&s1uid=0054Q00000FO2Yn&s1ext=0&emkind=chatterPostNotification&emtm=1674469172974&OpenCommentForEdit=1

     

    In your case, you will collect each SNMP OID in a different variable (A, B, C) and do the math (A = (A - B - C) / A) before displaying A.

     

    Hope this helps.

     

    Selected as Best
  • Seiji Takeuchi (Customer)

    Thanks, Ricardo!!

    ​

    I configured as the image attached and below commands,

    it works perfectly.

    ​

    =========

    'Sending log message to the WhatsUp Event Viewer

    Context.LogMessage "Checking Address=" & Context.GetProperty("Address")

    ​

    'Get the value of the reference variable A

    A = Context.GetReferenceVariable("A") 

    ​

    'Get the value of the reference variable B

    B = Context.GetReferenceVariable("B") 

    ​

    'Get the value of the reference variable C

    C = Context.GetReferenceVariable("C") 

    ​

    'Get the value of the reference variable D

    D = Context.GetReferenceVariable("D") 

    ​

    A = (A - B - C) / D

    ​

    'Set the performance monitor value to graph

    Context.SetValue A

    =========

    ​

    Just let me ask one more little thing.

    ​​

    Looking at the graph, this monitor looks like it returns the result of a calculation as a number.​

    Is there a way to display this calculation result as a percentage? Just like any other memory usage monitor.

     

    Thanks

    • WUG02
  • Ricardo Rodrigues (Progress Software)

    Hi @Seiji Takeuchi (Customer)​ , it's my pleasure to help.

     

    You can use

     

    A = (A - B - C) / D * 100

     

    to get a value between 0 and 100 (%). It will not show the label '%' close to the numbers (like '29 %' for example), but the values will range from 0 to 100.

     

    Also, you can customize your dashboard by adding multiple graphs: Add Reports (on the top right corner) -> Performance -> Custom Performance Monitor. Then you can configure one of them to show data in a fixed scale between 0 and 100 (click in the settings engine on the top right of the graph) and finally configure it to show only the performance monitors that have values between 0 and 100.

     

     

  • 'Sending log message to the WhatsUp Event Viewer

    Context.LogMessage "Checking Address=" & Context.GetProperty("Address")

     

    'Get the value of the reference variable A

    A = Context.GetReferenceVariable("A") 

     

    'Get the value of the reference variable B

    B = Context.GetReferenceVariable("B")  

     

    'Get the value of the reference variable C

    C = Context.GetReferenceVariable("C")  

     

    'Get the value of the reference variable D

    D = Context.GetReferenceVariable("D")  

     

    E = CDbl (B)  + CDbl (C) + CDbl (D)

     

    F = CDbl (E)/A

     

    G = 1 - CDbl (F)

     

    H = CDbl (G)*100

     

     

     

    'Set the performance monitor value to graph

    Context.SetValue H

     

     

    good day