Skip to main content

Audit sensor health monitor

The audit health monitor measures how the audit sensor is running (writer lag, queue depth, dropped captures) against a set of threshold rules and raises an alert on each breach. It watches the capture pipeline, not the evidence.

At a glance​

Batch classMGCWardenAuditHealthBatch
Menu itemMGCWardenAuditHealthMenuItem, label Audit health monitor
Menu pathSystem administration → Setup → Audit health monitor
Who may run itMGCWardenAuditAdministrationPriv (granted at Update) → MGCWardenAuditAdministrationDuty → Warden audit administrator (MGCWardenAuditAdministrator). The API operation MGCWardenBatchService.runAuditHealth is granted on the same privilege and re-checks the same menu item. Evaluate now on the Audit sensor health page runs the same evaluation through MGCWardenAuditHealthEvaluateAction, granted on the same privilege
Feature toggleNone. run() reads no feature toggle
Company scopeInstallation-wide. The rules (MGCWardenAuditHealthRule), the alerts (MGCWardenAuditHealthAlert), the capture queue and the drop tally are all shared tables, so one run in any company measures everything. The execution exceptions it files land in the company it runs in
Scheduled by defaultNo. Nothing in the product creates a batch job for it
RecurrenceYou choose. The rules' window and re-alert settings assume a regular run; see Choosing a recurrence
Setup-gap rules watching itAuditHealthNotScheduled (code AUDITHEALTH): at least one health rule is enabled and no job of this class carries a recurrence in any company. A recurrence in any company clears it
Run recordThe rule rows themselves (State, LastObservedValue, LastEvaluatedDateTime), and one alert row per notified breach
Overlap guardNot guarded by MGCWardenBatchOverlapGuard. Each rule's state is written under pessimisticlock, so two evaluations at once cannot both notify

Purpose and business justification​

A dropped capture is evidence that will never exist. A writer that falls behind by more than the dedup window changes what is stored, not just when. Neither of these is visible from the evidence itself, so the monitor measures them and tells someone.

Each breach is recorded three ways: an alert row on the administrator's worklist, an execution exception at the rule's severity, and a SelfAudit row in the audit store. Reviewing the alert never touches the store row, so triage cannot erase the fact that a breach happened.

How and when it is triggered​

  • Scheduled from the menu item, with a recurrence, in any one company.
  • Run now from the same menu item. canRunInNewSession() returns true.
  • Evaluate now on Audit sensor health (MGCWardenAuditHealth). It calls MGCWardenAuditHealthBatch::evaluateNow(), which runs the same run().
  • API: MGCWardenBatchService.runAuditHealth.

Configuration and scheduling options​

No dialog fields; pack() returns conNull(). The rules are configured on Audit health alert rules (MGCWardenAuditHealthRules), opened from the Warden Audit workspace.

On the first run, if the rule table is empty, MGCWardenAuditHealthRule::defaultRules() seeds three rules. It never re-seeds once any rule exists, so a rule you delete stays deleted.

RuleMetricThresholdWindowSeverityWhat it means
WRITERLAGWriterLagSeconds900-WarningThe oldest capture still waiting is more than 15 minutes old, one shipped dedup window
QUEUEDEPTHQueueDepth80,000-WarningMore than 80% of the shipped queue capacity is waiting. Lower-priority tiers are already shedding at this depth by design
DROPRATEDropCountInWindow060 minutesErrorAny capture was dropped in the last hour

Each seeded rule has Re-alert minutes 60 and is enabled. A rule is breached when the observed value is greater than its threshold.

Rule fieldEffect
EnabledOnly enabled rules are evaluated
ThresholdValueBreach when observed > threshold
WindowMinutesUsed by DropCountInWindow only; 0 or less is treated as 60
SeveritySeverity of the execution exception a breach files
ReAlertMinutesA rule that stays breached is re-notified at most once per this many minutes; 0 or less notifies on every run

Alert recipients are MGCWardenAuditParameters.AlertRecipients (Warden audit parameters), the same semicolon-separated list of user IDs the writer's drop alert uses. See Configuration reference.

Choosing a recurrence. The re-alert interval only suppresses repeat notifications; it does not make the monitor run. A run every few minutes notices a breach within minutes and, with the shipped re-alert of 60 minutes, notifies at most hourly while it lasts. A run less often than the DROPRATE window (60 minutes) can miss a drop altogether: drops older than the window are not counted. Each run reads the queue and the drop tally, which is cheap.

What it does​

  1. Seeds the shipped rules if the table is empty.
  2. For each enabled rule (evaluateRule):
    • measures the value through MGCWardenAuditHealthMetrics::observedValue, the same code the health page uses:
      • WriterLagSeconds: seconds since the oldest undropped queue row was enqueued; 0 when the queue is empty;
      • QueueDepth: count of undropped queue rows;
      • DropCountInWindow: drops the writer has already tallied (MGCWardenAuditDropTally) plus drops still flagged in the queue, both inside the window;
    • in one transaction, reads the rule under pessimisticlock and writes LastObservedValue, LastEvaluatedDateTime and State (Breached or Ok). On a breach it stamps LastBreachDateTime, and if no alert was ever sent, or the re-alert interval has passed, stamps LastAlertDateTime and decides to notify;
    • after the commit, if it decided to notify, raiseAlert:
      • inserts an MGCWardenAuditHealthAlert row (rule, metric, observed, threshold, severity, Reviewed = No);
      • sends an in-client alert to every recipient through MGCWardenAuditAlertSender::send (best effort; failures are swallowed);
      • files an execution exception at the rule's severity, Warden audit health rule breached ...;
      • records a HealthRuleBreach self-audit row in the store. The detail names a rule and two numbers and no person.
  3. Writes Warden audit health: N rule(s) evaluated, N breached.

The state is written on every run whether or not anyone is notified; the workspace tiles read the state, not the alerts.

Dependencies and prerequisites​

  • The audit writer running, or WRITERLAG and QUEUEDEPTH breach because nothing drains the queue. See Audit queue writer.
  • AlertRecipients set to user IDs that resolve, if anyone is to be notified. With no recipients the alert row, the exception and the store row are still written.

Inputs and outputs​

DirectionTable or objectWhat
Reads, inserts (seed), updatesMGCWardenAuditHealthRuleRules and their state
ReadsMGCWardenAuditQueue, MGCWardenAuditDropTallyThe measurements
InsertsMGCWardenAuditHealthAlertOne row per notified breach
InsertsEventInboxIn-client alerts, pop-up, no email
InsertsMGCWardenExecutionExceptionOne per notified breach at the rule's severity; one Error per rule that could not be evaluated
InsertsMGCWardenAuditEvent, MGCWardenAuditDetailParamOne SelfAudit row per notified breach
ReadsMGCWardenAuditParametersAlertRecipients

Logging and monitoring​

  • Audit sensor health shows the live metrics, per-tier volume and the alerts, with Evaluate now and Mark reviewed. It is opened from the Warden Audit workspace (System administration → Setup → Warden Audit); it has no entry of its own in the menu.
  • Audit health alert rules, also opened from the Warden Audit workspace.
  • The workspace has two tiles: Health rules breached and Unreviewed health alerts.
  • The data entity Warden audit health alerts (MGCWardenAuditHealthAlertEntity) is read only, through MGCWardenAuditOperationalEntityPriv.
  • Setup gaps: AuditHealthNotScheduled when health rules are enabled and the monitor has no recurrence in any company; the row counts the enabled rules. Without a schedule no rule is evaluated and no breach alerts anyone.

Screenshot to add: the Audit sensor health page with one breached rule and its unreviewed alert.

Errors, recovery and troubleshooting​

SymptomCause and recovery
Error Warden audit health rule R could not be evaluated.That rule's measurement or state write threw. The other rules were still evaluated. Run again; if it repeats, check the rule's metric and the queue table
Error Warden audit health monitor failed.The run failed outside the per-rule loop, for example while seeding. Nothing after the failure ran
WRITERLAG or QUEUEDEPTH breachedThe writer is not running, is overlapping itself, or is not keeping up. See Audit queue writer
DROPRATE breachedCaptures were dropped because the queue was at a tier's ceiling. Evidence was lost for that interval; raise the queue capacity or the writer's frequency
A breach did not notifyThe re-alert interval has not passed since the last notification, or no recipient resolves to a user
A rule shows UnknownIt has not been evaluated since it was seeded or created

The class does not implement BatchRetryable. run() catches every failure, so the task ends normally.

Impact on other functionality​

  • Retention cleanup deletes alerts older than the evidence window, but only those already reviewed. An unreviewed alert is never purged. See Warden retention cleanup.
  • Audit store. Each notified breach appends a SelfAudit row, which is control evidence and cannot be purged.
  • Reviewing an alert (Mark reviewed) stamps the reviewer's subject reference and time. It does not touch the execution exception or the store row.