Target with multiple ips and alert only if all fail testing

Please let me know how I can do this :slight_smile:

@999cgm, welcome to the community!

Here are three key concepts in NetBeez:

  1. Alerts: Triggered when specific alert conditions are met. These conditions are assessed on a per-test basis.
  2. Incidents: Triggered when alerting thresholds surpass a per-entity limit, such as Agent, Target, or Wifi network.
  3. Notifications: Sent to configured channels (e.g., email, Slack, Splunk, MS Teams, Pagerduty) when an Alert or Incident is activated.

For Incidents, Agent and Wifi incidents are assessed on a per test-type basis (e.g., all ping tests are grouped). However, Target incidents are evaluated on a per-test-template basis (e.g., all ping tests to are grouped separately from those to

From your query, it seems you want to tally tests of a target on a per test-type basis, as done for Agents and Wifi, and apply this only for specific targets, retaining the default functionality for others.

Currently, our frontend doesn’t offer this feature. However, I discovered it’s feasible via the backend. If you’re acquainted with our backend, follow these steps:

Step 1: Establish a new Target Incident Detector for per-test-type incident evaluation.

Enter the rails console:

# as root:
$ dxec docker-compose_nb-api_1 bundle exec rails c

then within the console:

> incident_detector = IncidentDetector.create(name: "Target Incident Detector by TestType", threshold_mix: {merge: [{filter: [{filter: [{var:""},{'==':[{var:"test_type_id"}, 1]}]}, {'>=': [{var:"percentage_alerting"}, 0.8]}]}, {filter: [{filter: [{var:""},{'==':[{var:"test_type_id"}, 2]}]}, {'>=': [{var:"percentage_alerting"}, 0.8]}]}, {filter: [{filter: [{var:""},{'==':[{var:"test_type_id"}, 3]}]}, {'>=': [{var:"percentage_alerting"}, 0.8]}]}, {filter: [{filter: [{var:""},{'==':[{var:"test_type_id"}, 4]}]}, {'>=': [{var:"percentage_alerting"}, 0.8]}]}]}, group_by_clause: ["test_type_id"], incident_reporting_entity_type: "NbTarget")
=> 4

This command provides the id for the incident detector, activating when 80% of similar tests signal an alert.

Step 2: Modify the Incident Detector for the desired target.

> target = NbTarget.find_by_name("My target name")
> target.incident_detector_instances.last.update(incident_detector_id: 4)

Step 3: Reboot the message server service to apply the change.

$ nb-docker-compose up -d --force-recreate --no-deps nb-msgsrv nb-commsrv

If you need assistance, DM me or submit a support ticket. We’re here to help.