How to configure action in event process policy rule with java api
-
HI,
The work I tried to do is when some threshold reached , an alarm should be recorded.Setting threshold is done with java api(version 1.1.6),and configuring action(simply generate an alarm) in java console is OK,too.But when I try to do add action with java api , I don't know what action id should be used here.
I wonder if there is some introduction about the original action of netxms?For example , the id for the action of "generate an alarm". -
Hi!
Alarm generation and actions are different things. For generating alarm you do not need an action - it's just special attributes in event processing policy rule. To set rule to generate alarm, do the following (assuming you already have rule object called "rule" of type EventProcessingPolicyRule):
rule.setFlags(rule.getFlags() | EventProcessingPolicyRule.GENERATE_ALARM); rule.setAlarmMessage("%m"); // it's an example, you can specify your real alarm message here rule.setAlarmSeverity(0); // specify your severity rule.setAlarmKey(""); // specify alarm keyand to set rule to terminate alarm:
rule.setFlags(rule.getFlags() | EventProcessingPolicyRule.GENERATE_ALARM); rule.setAlarmSeverity(Severity.UNMANAGED); // Severity UNMANAGED indicates alarm termination rule rule.setAlarmKey(""); // specify alarm keyAlso, you can take a look at property pages in nxmc-epp plugin in management console.
Best regards,
Victor -
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login