|
| 1 | +# Windows Active Directory mixin |
| 2 | +The Windows Active Directory mixin is a set of configurable Grafana dashboards and alerts. |
| 3 | + |
| 4 | +The Windows Active Directory mixin contains the following dashboards: |
| 5 | + |
| 6 | +- Windows Active Directory overview |
| 7 | +- Windows logs |
| 8 | + |
| 9 | +and the following alerts: |
| 10 | + |
| 11 | +- WindowsActiveDirectoryHighPendingReplicationOperations |
| 12 | +- WindowsActiveDirectoryHighReplicationSyncRequestFailures |
| 13 | +- WindowsActiveDirectoryHighPasswordChange |
| 14 | +- WindowsActiveDirectoryMetricsDown |
| 15 | + |
| 16 | +## Windows Active Directory overview |
| 17 | +The Windows Active Directory overview dashboard provides details on alerts, LDAP operations and requests, bind operations, replication traffic, and database operations. |
| 18 | + |
| 19 | + |
| 20 | + |
| 21 | +# Windows logs |
| 22 | +The Windows logs dashboard provides details on incoming Windows application, security, and system logs. |
| 23 | + |
| 24 | + |
| 25 | +Windows logs are enabled by default in the `config.libsonnet` and can be disabled by setting `enableLokiLogs` to `false`. Then run `make` again to regenerate the dashboard: |
| 26 | + |
| 27 | +``` |
| 28 | +{ |
| 29 | + _config+:: { |
| 30 | + enableLokiLogs: false, |
| 31 | + }, |
| 32 | +} |
| 33 | +``` |
| 34 | + |
| 35 | +For the selectors to properly work with the Windows logs ingested into your logs datasource, please also include the matching `instance` and `job` labels in the [scrape configs](https://grafana.com/docs/loki/latest/clients/promtail/configuration/#scrape_configs) to match the labels for ingested metrics. |
| 36 | + |
| 37 | +```yaml |
| 38 | + - job_name: integrations/windows-exporter-application |
| 39 | + windows_events: |
| 40 | + use_incoming_timestamp: true |
| 41 | + eventlog_name: 'Application' |
| 42 | + bookmark_path: "./bookmarks-app.xml" |
| 43 | + xpath_query: '*' |
| 44 | + locale: 1033 |
| 45 | + labels: |
| 46 | + job: integrations/windows_exporter |
| 47 | + instance: '<your-instance-name>' # must match instance used in windows_exporter |
| 48 | + relabel_configs: |
| 49 | + - source_labels: ['computer'] |
| 50 | + target_label: 'agent_hostname' |
| 51 | + pipeline_stages: |
| 52 | + - json: |
| 53 | + expressions: |
| 54 | + source: source |
| 55 | + level: levelText |
| 56 | + - labels: |
| 57 | + source: |
| 58 | + level: |
| 59 | + - job_name: integrations/windows-exporter-system |
| 60 | + windows_events: |
| 61 | + use_incoming_timestamp: true |
| 62 | + bookmark_path: "./bookmarks-sys.xml" |
| 63 | + eventlog_name: "System" |
| 64 | + xpath_query: '*' |
| 65 | + locale: 1033 |
| 66 | + # - 1033 to force English language |
| 67 | + # - 0 to use default Windows locale |
| 68 | + labels: |
| 69 | + job: integrations/windows_exporter |
| 70 | + instance: '<your-instance-name>' # must match instance used in windows_exporter |
| 71 | + relabel_configs: |
| 72 | + - source_labels: ['computer'] |
| 73 | + target_label: 'agent_hostname' |
| 74 | + pipeline_stages: |
| 75 | + - json: |
| 76 | + expressions: |
| 77 | + source: source |
| 78 | + level: levelText |
| 79 | + - labels: |
| 80 | + source: |
| 81 | + level: |
| 82 | + - job_name: integrations/windows-exporter-security |
| 83 | + windows_events: |
| 84 | + use_incoming_timestamp: true |
| 85 | + bookmark_path: "./bookmarks-sys.xml" |
| 86 | + eventlog_name: "Security" |
| 87 | + xpath_query: '*' |
| 88 | + locale: 1033 |
| 89 | + # - 1033 to force English language |
| 90 | + # - 0 to use default Windows locale |
| 91 | + labels: |
| 92 | + job: integrations/windows_exporter |
| 93 | + instance: '<your-instance-name>' # must match instance used in windows_exporter |
| 94 | + relabel_configs: |
| 95 | + - source_labels: ['computer'] |
| 96 | + target_label: 'agent_hostname' |
| 97 | + pipeline_stages: |
| 98 | + - json: |
| 99 | + expressions: |
| 100 | + source: source |
| 101 | + level: levelText |
| 102 | + - labels: |
| 103 | + source: |
| 104 | + level: |
| 105 | + |
| 106 | +``` |
| 107 | + |
| 108 | +## Alerts overview |
| 109 | +- WindowsActiveDirectoryHighPendingReplicationOperations: There is a high number of pending replication operations in Active Directory. A high number of pending operations sustained over a period of time can indicate a problem with replication. |
| 110 | +- WindowsActiveDirectoryHighReplicationSyncRequestFailures: There are a number of replication synchronization request failures. These can cause authentication failures, outdated information being propagated across domain controllers, and potentially data loss or inconsistencies.' |
| 111 | +- WindowsActiveDirectoryHighPasswordChange: There is a high number of password changes. This may indicate unauthorized changes or attacks. |
| 112 | +- WindowsActiveDirectoryMetricsDown: Windows Active Directory metrics are down. |
| 113 | + |
| 114 | +Default thresholds can be configured in `config.libsonnet`. |
| 115 | + |
| 116 | +```js |
| 117 | +{ |
| 118 | + _configs+:: { |
| 119 | + // alerts thresholds |
| 120 | + alertsHighPendingReplicationOperations: 50, // count |
| 121 | + alertsHighReplicationSyncRequestFailures: 0, // count |
| 122 | + alertsHighPasswordChanges: 25, //count |
| 123 | + alertsMetricsDownJobName: 'integrations/windows', |
| 124 | + } |
| 125 | +} |
| 126 | +``` |
| 127 | + |
| 128 | +## Install tools |
| 129 | +```bash |
| 130 | +go install github.com/jsonnet-bundler/jsonnet-bundler/cmd/jb@latest |
| 131 | +go install github.com/monitoring-mixins/mixtool/cmd/mixtool@latest |
| 132 | +``` |
| 133 | + |
| 134 | +For linting and formatting, you would also need `jsonnetfmt` installed. If you |
| 135 | +have a working Go development environment, it's easiest to run the following: |
| 136 | + |
| 137 | +```bash |
| 138 | +go install github.com/google/go-jsonnet/cmd/jsonnetfmt@latest |
| 139 | +``` |
| 140 | + |
| 141 | +The files in `dashboards_out` need to be imported |
| 142 | +into your Grafana server. The exact details will be depending on your environment. |
| 143 | + |
| 144 | +`prometheus_alerts.yaml` needs to be imported into Prometheus. |
| 145 | + |
| 146 | +## Generate dashboards and alerts |
| 147 | +Edit `config.libsonnet` if required and then build JSON dashboard files for Grafana: |
| 148 | + |
| 149 | +```bash |
| 150 | +make |
| 151 | +``` |
| 152 | + |
| 153 | +For more advanced uses of mixins, see |
| 154 | +https://github.com/monitoring-mixins/docs. |
0 commit comments