Start a Conversation

This post is more than 5 years old

Solved!

Go to Solution

883

February 10th, 2015 21:00

Customize notify from dynamic model

Hi Guys,

We have customized polling new OIDs with dynamic model.

Now, we get the notifies in SAM.

Our new request is customizing notify with threshold value and real attribute value. The team want to check the value directly from log console.

For instance,

instrument SNMP {

        iveCpuUtil = "1.3.6.1.4.1.12532.10"

};

        readonly instrumented attribute int iveCpuUtil;

        event HighiveCpuUtil

        "Indicates that the percentage of iveCpuUtil exceeds OverrunCpuUtilThreshold"

  = if iveCpuUtil > 0

  check (iveCpuUtil > OverrunCpuUtilThreshold);

        export HighiveCpuUtil;

I want to customize the event text from "Indicates that the percentage of iveCpuUtil exceeds OverrunCpuUtilThreshold" to "Indicates that the percentage of " + iveCpuUtil + " exceeds + " + OverrunCpuUtilThreshold

Unfortunately, the syntax is wrong.

Is there any way to make it?

Thank you.

BR

Xin

17 Posts

February 16th, 2015 03:00

For reasons of efficiency the event text is a static string, so you cannot add dynamic values to it. If this was not the case then it would be necessary to update the event text on every notification after every polling cycle.

The simplest work around is to utilise the Details tab. If you create a function as follows: -

readony string HighiveCpuUtil_attributes()

"Returns event data for the HighiveCpuUtil event"

definition:

return    "LIST      - iveCpuUtil"

          "          - OverrunCpuUtilThreshold";

Then for each active instance of the event you will get a details tab which when opened will pull the latest values direct from the source domain.

A more complex solution would be to write a subscription adapter which subscribed to changes on the specified attributes across all instances and updated a UserDef field on any active notifications. This is not something I have ever personally done, so cannot give you any sample code.

Alan

2 Posts

February 24th, 2015 22:00

Hi Alan,

Thank you so much for your help.

I have test your workaround, it is working for me.

Thank you again.

BR

Xin

No Events found!

Top