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 class | MGCWardenAuditHealthBatch |
| Menu item | MGCWardenAuditHealthMenuItem, label Audit health monitor |
| Menu path | System administration → Setup → Audit health monitor |
| Who may run it | MGCWardenAuditAdministrationPriv (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 toggle | None. run() reads no feature toggle |
| Company scope | Installation-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 default | No. Nothing in the product creates a batch job for it |
| Recurrence | You choose. The rules' window and re-alert settings assume a regular run; see Choosing a recurrence |
| Setup-gap rules watching it | AuditHealthNotScheduled (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 record | The rule rows themselves (State, LastObservedValue, LastEvaluatedDateTime), and one alert row per notified breach |
| Overlap guard | Not 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 callsMGCWardenAuditHealthBatch::evaluateNow(), which runs the samerun(). - 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.
| Rule | Metric | Threshold | Window | Severity | What it means |
|---|---|---|---|---|---|
WRITERLAG | WriterLagSeconds | 900 | - | Warning | The oldest capture still waiting is more than 15 minutes old, one shipped dedup window |
QUEUEDEPTH | QueueDepth | 80,000 | - | Warning | More than 80% of the shipped queue capacity is waiting. Lower-priority tiers are already shedding at this depth by design |
DROPRATE | DropCountInWindow | 0 | 60 minutes | Error | Any 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 field | Effect |
|---|---|
Enabled | Only enabled rules are evaluated |
ThresholdValue | Breach when observed > threshold |
WindowMinutes | Used by DropCountInWindow only; 0 or less is treated as 60 |
Severity | Severity of the execution exception a breach files |
ReAlertMinutes | A 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
- Seeds the shipped rules if the table is empty.
- 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
pessimisticlockand writesLastObservedValue,LastEvaluatedDateTimeandState(BreachedorOk). On a breach it stampsLastBreachDateTime, and if no alert was ever sent, or the re-alert interval has passed, stampsLastAlertDateTimeand decides to notify; - after the commit, if it decided to notify,
raiseAlert:- inserts an
MGCWardenAuditHealthAlertrow (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
HealthRuleBreachself-audit row in the store. The detail names a rule and two numbers and no person.
- inserts an
- measures the value through
- 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
WRITERLAGandQUEUEDEPTHbreach because nothing drains the queue. See Audit queue writer. AlertRecipientsset 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
| Direction | Table or object | What |
|---|---|---|
| Reads, inserts (seed), updates | MGCWardenAuditHealthRule | Rules and their state |
| Reads | MGCWardenAuditQueue, MGCWardenAuditDropTally | The measurements |
| Inserts | MGCWardenAuditHealthAlert | One row per notified breach |
| Inserts | EventInbox | In-client alerts, pop-up, no email |
| Inserts | MGCWardenExecutionException | One per notified breach at the rule's severity; one Error per rule that could not be evaluated |
| Inserts | MGCWardenAuditEvent, MGCWardenAuditDetailParam | One SelfAudit row per notified breach |
| Reads | MGCWardenAuditParameters | AlertRecipients |
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, throughMGCWardenAuditOperationalEntityPriv. - Setup gaps:
AuditHealthNotScheduledwhen 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
| Symptom | Cause 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 breached | The writer is not running, is overlapping itself, or is not keeping up. See Audit queue writer |
DROPRATE breached | Captures 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 notify | The re-alert interval has not passed since the last notification, or no recipient resolves to a user |
| A rule shows Unknown | It 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
SelfAuditrow, 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.