| 1 | // SPDX-License-Identifier: GPL-3.0-or-later |
| 2 | |
| 3 | #include "windows_plugin.h" |
| 4 | #include "windows-internals.h" |
| 5 | |
| 6 | struct adfs_certificate { |
| 7 | bool charts_created; |
| 8 | |
| 9 | // AD/ADFS |
| 10 | RRDSET *st_adfs_login_connection_failures; |
| 11 | RRDDIM *rd_adfs_login_connection_failures; |
| 12 | |
| 13 | RRDSET *st_adfs_certificate_authentications_total; |
| 14 | RRDDIM *rd_adfs_certificate_authentications_total; |
| 15 | |
| 16 | // DB Artifacts |
| 17 | RRDSET *st_adfs_db_artifact_failure_total; |
| 18 | RRDDIM *rd_adfs_db_artifact_failure_total; |
| 19 | |
| 20 | RRDSET *st_adfs_db_artifact_query_time_seconds_total; |
| 21 | RRDDIM *rd_adfs_db_artifact_query_time_seconds_total; |
| 22 | |
| 23 | // DB Config |
| 24 | RRDSET *st_adfs_db_config_failures; |
| 25 | RRDDIM *rd_adfs_db_config_failures; |
| 26 | |
| 27 | RRDSET *st_adfs_db_config_query_time_seconds_total; |
| 28 | RRDDIM *rd_adfs_db_config_query_time_seconds_total; |
| 29 | |
| 30 | // Auth |
| 31 | RRDSET *st_adfs_device_authentications_total; |
| 32 | RRDDIM *rd_adfs_device_authentications_total; |
| 33 | |
| 34 | RRDSET *st_adfs_extranet_account_lockouts_total; |
| 35 | RRDDIM *rd_adfs_extranet_account_lockouts_total; |
| 36 | |
| 37 | RRDSET *st_adfs_external_authentications; |
| 38 | RRDDIM *rd_adfs_external_authentications_success; |
| 39 | RRDDIM *rd_adfs_external_authentications_failure; |
| 40 | |
| 41 | RRDSET *st_adfs_federation_authentications; |
| 42 | RRDDIM *rd_adfs_federation_authentications; |
| 43 | |
| 44 | RRDSET *st_adfs_federation_metadata_authentications; |
| 45 | RRDDIM *rd_adfs_federation_metadata_authentications; |
| 46 | |
| 47 | // OAuth |
| 48 | RRDSET *st_adfs_oauth_authorization_requests_total; |
| 49 | RRDDIM *rd_adfs_oauth_authorization_requests_total; |
| 50 | |
| 51 | RRDSET *st_adfs_oauth_client_authentications; |
| 52 | RRDDIM *rd_adfs_oauth_client_authentications_success; |
| 53 | RRDDIM *rd_adfs_oauth_client_authentications_failure; |
| 54 | |
| 55 | RRDSET *st_adfs_oauth_client_credentials_requests; |
| 56 | RRDDIM *rd_adfs_oauth_client_credentials_requests_success; |
| 57 | RRDDIM *rd_adfs_oauth_client_credentials_requests_failure; |
| 58 | |
| 59 | RRDSET *st_adfs_oauth_client_privkey_jwt_authentications; |
| 60 | RRDDIM *rd_adfs_oauth_client_privkey_jwt_authentications_success; |
| 61 | RRDDIM *rd_adfs_oauth_client_privkey_jwt_authentications_failure; |
| 62 | |
| 63 | RRDSET *st_adfs_oauth_client_secret_basic_authentications; |
| 64 | RRDDIM *rd_adfs_oauth_client_secret_basic_authentications_success; |
| 65 | RRDDIM *rd_adfs_oauth_client_secret_basic_authentications_failure; |
| 66 | |
| 67 | RRDSET *st_adfs_oauth_client_secret_post_authentications; |
| 68 | RRDDIM *rd_adfs_oauth_client_secret_post_authentications_success; |
| 69 | RRDDIM *rd_adfs_oauth_client_secret_post_authentications_failure; |
| 70 | |
| 71 | RRDSET *st_adfs_oauth_client_windows_authentications; |
| 72 | RRDDIM *rd_adfs_oauth_client_windows_authentications_success_total; |
| 73 | RRDDIM *rd_adfs_oauth_client_windows_authentications_failure_total; |
| 74 | |
| 75 | RRDSET *st_adfs_oauth_logon_certificate_requests; |
| 76 | RRDDIM *rd_adfs_oauth_logon_certificate_requests_success_total; |
| 77 | RRDDIM *rd_adfs_oauth_logon_certificate_requests_failure_total; |
| 78 | |
| 79 | RRDSET *st_adfs_oauth_password_grant_requests; |
| 80 | RRDDIM *rd_adfs_oauth_password_grant_requests_success; |
| 81 | RRDDIM *rd_adfs_oauth_password_grant_requests_failure; |
| 82 | |
| 83 | RRDSET *st_adfs_oauth_token_requests_success; |
| 84 | RRDDIM *rd_adfs_oauth_token_requests_success; |
| 85 | |
| 86 | // Requests |
| 87 | RRDSET *st_adfs_passive_requests_total; |
| 88 | RRDDIM *rd_adfs_passive_requests_total; |
| 89 | |
| 90 | RRDSET *st_adfs_passport_authentications_total; |
| 91 | RRDDIM *rd_adfs_passport_authentications_total; |
| 92 | |
| 93 | RRDSET *st_adfs_password_change_requests; |
| 94 | RRDDIM *rd_adfs_password_change_requests_success; |
| 95 | RRDDIM *rd_adfs_password_change_requests_failure; |
| 96 | |
| 97 | RRDSET *st_adfs_samlp_token_requests_success_total; |
| 98 | RRDDIM *rd_adfs_samlp_token_requests_success_total; |
| 99 | |
| 100 | RRDSET *st_adfs_wstrust_token_requests_success_total; |
| 101 | RRDDIM *rd_adfs_wstrust_token_requests_success_total; |
| 102 | |
| 103 | RRDSET *st_adfs_sso_authentications; |
| 104 | RRDDIM *rd_adfs_sso_authentications_success; |
| 105 | RRDDIM *rd_adfs_sso_authentications_failure; |
| 106 | |
| 107 | RRDSET *st_adfs_token_requests_total; |
| 108 | RRDDIM *rd_adfs_token_requests_total; |
| 109 | |
| 110 | RRDSET *st_adfs_user_password_authentications; |
| 111 | RRDDIM *rd_adfs_user_password_authentications_success; |
| 112 | RRDDIM *rd_adfs_user_password_authentications_failure; |
| 113 | |
| 114 | RRDSET *st_adfs_windows_integrated_authentications_total; |
| 115 | RRDDIM *rd_adfs_windows_integrated_authentications_total; |
| 116 | |
| 117 | RRDSET *st_adfs_wsfed_token_requests_success_total; |
| 118 | RRDDIM *rd_adfs_wsfed_token_requests_success_total; |
| 119 | |
| 120 | // AD/ADFS |
| 121 | COUNTER_DATA ADFSLoginConnectionFailure; |
| 122 | COUNTER_DATA ADFSCertificateAuthentications; |
| 123 | |
| 124 | // DB Artifacts |
| 125 | COUNTER_DATA ADFSDBArtifactFailures; |
| 126 | COUNTER_DATA ADFSDBArtifactQueryTimeSeconds; |
| 127 | |
| 128 | // DB Config |
| 129 | COUNTER_DATA ADFSDBConfigFailures; |
| 130 | COUNTER_DATA ADFSDBConfigQueryTimeSeconds; |
| 131 | |
| 132 | // Auth |
| 133 | COUNTER_DATA ADFSDeviceAuthentications; |
| 134 | COUNTER_DATA ADFSExtranetAccountLockouts; |
| 135 | COUNTER_DATA ADFSExternalAuthenticationsSuccess; |
| 136 | COUNTER_DATA ADFSExternalAuthenticationsFailure; |
| 137 | COUNTER_DATA ADFSFederationAuthentications; |
| 138 | COUNTER_DATA ADFSFederationMetadataAuthentications; |
| 139 | COUNTER_DATA ADFSOauthAuthorizationRequests; |
| 140 | |
| 141 | // OAUTH |
| 142 | COUNTER_DATA ADFSOauthClientAuthenticationsSuccess; |
| 143 | COUNTER_DATA ADFSOauthClientAuthenticationsFailure; |
| 144 | COUNTER_DATA ADFSOauthClientCredentialsSuccess; |
| 145 | COUNTER_DATA ADFSOauthClientCredentialsFailure; |
| 146 | COUNTER_DATA ADFSOauthClientPrivkeyJwtAuthenticationSuccess; |
| 147 | COUNTER_DATA ADFSOauthClientPrivkeyJwtAuthenticationFailure; |
| 148 | COUNTER_DATA ADFSOauthClientSecretBasicAuthenticationsSuccess; |
| 149 | COUNTER_DATA ADFSOauthClientSecretBasicAuthenticationsFailure; |
| 150 | COUNTER_DATA ADFSOauthClientSecretPostAuthenticationsSuccess; |
| 151 | COUNTER_DATA ADFSOauthClientSecretPostAuthenticationsFailure; |
| 152 | COUNTER_DATA ADFSOauthClientWindowsAuthenticationsSuccess; |
| 153 | COUNTER_DATA ADFSOauthClientWindowsAuthenticationsFailure; |
| 154 | COUNTER_DATA ADFSOauthLogonCertificateRequestsSuccess; |
| 155 | COUNTER_DATA ADFSOauthLogonCertificateRequestsFailure; |
| 156 | COUNTER_DATA ADFSOauthPasswordGrantRequestsSuccess; |
| 157 | COUNTER_DATA ADFSOauthPasswordGrantRequestsFailure; |
| 158 | COUNTER_DATA ADFSOauthTokenRequestsSuccess; |
| 159 | |
| 160 | // Requests |
| 161 | COUNTER_DATA ADFSPassiveRequests; |
| 162 | COUNTER_DATA ADFSPassportAuthentications; |
| 163 | COUNTER_DATA ADFSPasswordChangeRequestsSuccess; |
| 164 | COUNTER_DATA ADFSPasswordChangeRequestsFailure; |
| 165 | COUNTER_DATA ADFSSAMLPTokenRequests; |
| 166 | COUNTER_DATA ADFSWSTrustTokenRequestsSuccess; |
| 167 | COUNTER_DATA ADFSSSOAuthenticationsSuccess; |
| 168 | COUNTER_DATA ADFSSSOAuthenticationsFailure; |
| 169 | COUNTER_DATA ADFSTokenRequests; |
| 170 | COUNTER_DATA ADFSUserPasswordAuthenticationsSuccess; |
| 171 | COUNTER_DATA ADFSUserPasswordAuthenticationsFailure; |
| 172 | COUNTER_DATA ADFSWindowsIntegratedAuthentications; |
| 173 | COUNTER_DATA ADFSWSFedTokenRequestsSuccess; |
| 174 | } adfs = { |
| 175 | .charts_created = false, |
| 176 | |
| 177 | // AD/ADFS |
| 178 | .st_adfs_login_connection_failures = NULL, |
| 179 | .st_adfs_certificate_authentications_total = NULL, |
| 180 | |
| 181 | // DB Artifacts |
| 182 | .st_adfs_db_artifact_failure_total = NULL, |
| 183 | .st_adfs_db_artifact_query_time_seconds_total = NULL, |
| 184 | |
| 185 | // DB Config |
| 186 | .st_adfs_db_config_failures = NULL, |
| 187 | .st_adfs_db_config_query_time_seconds_total = NULL, |
| 188 | |
| 189 | // Auth |
| 190 | .st_adfs_device_authentications_total = NULL, |
| 191 | .st_adfs_extranet_account_lockouts_total = NULL, |
| 192 | .st_adfs_external_authentications = NULL, |
| 193 | .st_adfs_federation_authentications = NULL, |
| 194 | .st_adfs_federation_metadata_authentications = NULL, |
| 195 | |
| 196 | // OAuth |
| 197 | .st_adfs_oauth_authorization_requests_total = NULL, |
| 198 | .st_adfs_oauth_client_authentications = NULL, |
| 199 | .st_adfs_oauth_client_credentials_requests = NULL, |
| 200 | .st_adfs_oauth_client_privkey_jwt_authentications = NULL, |
| 201 | .st_adfs_oauth_client_secret_basic_authentications = NULL, |
| 202 | .st_adfs_oauth_client_secret_post_authentications = NULL, |
| 203 | .st_adfs_oauth_client_windows_authentications = NULL, |
| 204 | .st_adfs_oauth_logon_certificate_requests = NULL, |
| 205 | .st_adfs_oauth_password_grant_requests = NULL, |
| 206 | .st_adfs_oauth_token_requests_success = NULL, |
| 207 | |
| 208 | // Requests |
| 209 | .st_adfs_passive_requests_total = NULL, |
| 210 | .st_adfs_passport_authentications_total = NULL, |
| 211 | .st_adfs_password_change_requests = NULL, |
| 212 | .st_adfs_samlp_token_requests_success_total = NULL, |
| 213 | .st_adfs_wstrust_token_requests_success_total = NULL, |
| 214 | .st_adfs_sso_authentications = NULL, |
| 215 | .st_adfs_token_requests_total = NULL, |
| 216 | .st_adfs_user_password_authentications = NULL, |
| 217 | .st_adfs_windows_integrated_authentications_total = NULL, |
| 218 | .st_adfs_wsfed_token_requests_success_total = NULL, |
| 219 | |
| 220 | // AD/ADFS |
| 221 | .ADFSLoginConnectionFailure.key = "AD Login Connection Failures", |
| 222 | .ADFSCertificateAuthentications.key = "Certificate Authentications", |
| 223 | |
| 224 | // DB Artifacts |
| 225 | .ADFSDBArtifactFailures.key = "Artifact Database Connection Failures", |
| 226 | .ADFSDBArtifactQueryTimeSeconds.key = "Average Artifact Database Query Time", |
| 227 | |
| 228 | // DB Config |
| 229 | .ADFSDBConfigFailures.key = "Configuration Database Connection Failures", |
| 230 | .ADFSDBConfigQueryTimeSeconds.key = "Average Config Database Query Time", |
| 231 | |
| 232 | // Auth |
| 233 | .ADFSDeviceAuthentications.key = "Device Authentications", |
| 234 | .ADFSExtranetAccountLockouts.key = "Extranet Account Lockouts", |
| 235 | .ADFSExternalAuthenticationsSuccess.key = "External Authentications", |
| 236 | .ADFSExternalAuthenticationsFailure.key = "External Authentication Failures", |
| 237 | .ADFSFederationAuthentications.key = "Federated Authentications", |
| 238 | .ADFSFederationMetadataAuthentications.key = "Federation Metadata Requests", |
| 239 | .ADFSOauthAuthorizationRequests.key = "OAuth AuthZ Requests", |
| 240 | |
| 241 | // OAuth |
| 242 | .ADFSOauthClientAuthenticationsSuccess.key = "OAuth Client Authentications", |
| 243 | .ADFSOauthClientAuthenticationsFailure.key = "OAuth Client Authentications Failures", |
| 244 | .ADFSOauthClientCredentialsSuccess.key = "OAuth Client Credentials Requests", |
| 245 | .ADFSOauthClientCredentialsFailure.key = "OAuth Client Credentials Request Failures", |
| 246 | .ADFSOauthClientPrivkeyJwtAuthenticationSuccess.key = "OAuth Client Private Key Jwt Authentications", |
| 247 | .ADFSOauthClientPrivkeyJwtAuthenticationFailure.key = "OAuth Client Private Key Jwt Authentication Failures", |
| 248 | .ADFSOauthClientSecretBasicAuthenticationsSuccess.key = "OAuth Client Secret Basic Authentications", |
| 249 | .ADFSOauthClientSecretBasicAuthenticationsFailure.key = "OAuth Client Secret Basic Authentication Failures", |
| 250 | .ADFSOauthClientSecretPostAuthenticationsSuccess.key = "OAuth Client Secret Post Authentications", |
| 251 | .ADFSOauthClientSecretPostAuthenticationsFailure.key = "OAuth Client Secret Post Authentication Failures", |
| 252 | .ADFSOauthClientWindowsAuthenticationsSuccess.key = "OAuth Client Windows Integrated Authentications", |
| 253 | .ADFSOauthClientWindowsAuthenticationsFailure.key = "OAuth Client Windows Integrated Authentication Failures", |
| 254 | .ADFSOauthLogonCertificateRequestsSuccess.key = "OAuth Logon Certificate Token Requests", |
| 255 | .ADFSOauthLogonCertificateRequestsFailure.key = "OAuth Logon Certificate Request Failures", |
| 256 | .ADFSOauthPasswordGrantRequestsSuccess.key = "OAuth Password Grant Requests", |
| 257 | .ADFSOauthPasswordGrantRequestsFailure.key = "OAuth Password Grant Request Failures", |
| 258 | .ADFSOauthTokenRequestsSuccess.key = "OAuth Token Requests", |
| 259 | |
| 260 | // Requests |
| 261 | .ADFSPassiveRequests.key = "Passive Requests", |
| 262 | .ADFSPassportAuthentications.key = "Microsoft Passport Authentications", |
| 263 | .ADFSPasswordChangeRequestsSuccess.key = "Password Change Successful Requests", |
| 264 | .ADFSPasswordChangeRequestsFailure.key = "Password Change Failed Requests", |
| 265 | .ADFSSAMLPTokenRequests.key = "SAML-P Token Requests", |
| 266 | .ADFSWSTrustTokenRequestsSuccess.key = "WS-Trust Token Requests", |
| 267 | .ADFSSSOAuthenticationsSuccess.key = "SSO Authentications", |
| 268 | .ADFSSSOAuthenticationsFailure.key = "SSO Authentication Failures", |
| 269 | .ADFSTokenRequests.key = "Token Requests", |
| 270 | .ADFSUserPasswordAuthenticationsSuccess.key = "U/P Authentications", |
| 271 | .ADFSUserPasswordAuthenticationsFailure.key = "U/P Authentication Failures", |
| 272 | .ADFSWindowsIntegratedAuthentications.key = "Windows Integrated Authentications", |
| 273 | .ADFSWSFedTokenRequestsSuccess.key = "WS-Fed Token Requests", |
| 274 | }; |
| 275 | |
| 276 | void netdata_adfs_login_connection_failures(PERF_DATA_BLOCK *pDataBlock, PERF_OBJECT_TYPE *pObjectType, int update_every) |
| 277 | { |
| 278 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &adfs.ADFSLoginConnectionFailure)) { |
| 279 | return; |
| 280 | } |
| 281 | |
| 282 | if (!adfs.st_adfs_login_connection_failures) { |
| 283 | adfs.st_adfs_login_connection_failures = rrdset_create_localhost( |
| 284 | "adfs", |
| 285 | "ad_login_connection_failures", |
| 286 | NULL, |
| 287 | "ad", |
| 288 | "adfs.ad_login_connection_failures", |
| 289 | "Connection failures", |
| 290 | "failures/s", |
| 291 | PLUGIN_WINDOWS_NAME, |
| 292 | "PerflibADFS", |
| 293 | PRIO_ADFS_LOGIN_CONNECTION_FAILURES_TOTAL, |
| 294 | update_every, |
| 295 | RRDSET_TYPE_LINE); |
| 296 | |
| 297 | adfs.rd_adfs_login_connection_failures = |
| 298 | rrddim_add(adfs.st_adfs_login_connection_failures, "connection", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 299 | } |
| 300 | |
| 301 | rrddim_set_by_pointer( |
| 302 | adfs.st_adfs_login_connection_failures, |
| 303 | adfs.rd_adfs_login_connection_failures, |
| 304 | (collected_number)adfs.ADFSLoginConnectionFailure.current.Data); |
| 305 | rrdset_done(adfs.st_adfs_login_connection_failures); |
| 306 | } |
| 307 | |
| 308 | void netdata_adfs_certificate_authentications( |
| 309 | PERF_DATA_BLOCK *pDataBlock, |
| 310 | PERF_OBJECT_TYPE *pObjectType, |
| 311 | int update_every) |
| 312 | { |
| 313 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &adfs.ADFSCertificateAuthentications)) { |
| 314 | return; |
| 315 | } |
| 316 | |
| 317 | if (!adfs.st_adfs_certificate_authentications_total) { |
| 318 | adfs.st_adfs_certificate_authentications_total = rrdset_create_localhost( |
| 319 | "adfs", |
| 320 | "certificate_authentications", |
| 321 | NULL, |
| 322 | "ad", |
| 323 | "adfs.certificate_authentications", |
| 324 | "User Certificate authentications", |
| 325 | "authentications/s", |
| 326 | PLUGIN_WINDOWS_NAME, |
| 327 | "PerflibADFS", |
| 328 | PRIO_ADFS_CERTIFICATE_AUTHENTICATION_TOTAL, |
| 329 | update_every, |
| 330 | RRDSET_TYPE_LINE); |
| 331 | |
| 332 | adfs.rd_adfs_certificate_authentications_total = rrddim_add( |
| 333 | adfs.st_adfs_certificate_authentications_total, "authentications", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 334 | } |
| 335 | |
| 336 | rrddim_set_by_pointer( |
| 337 | adfs.st_adfs_certificate_authentications_total, |
| 338 | adfs.rd_adfs_certificate_authentications_total, |
| 339 | (collected_number)adfs.ADFSCertificateAuthentications.current.Data); |
| 340 | rrdset_done(adfs.st_adfs_certificate_authentications_total); |
| 341 | } |
| 342 | |
| 343 | void netdata_adfs_db_artifacts_failure(PERF_DATA_BLOCK *pDataBlock, PERF_OBJECT_TYPE *pObjectType, int update_every) |
| 344 | { |
| 345 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &adfs.ADFSDBArtifactFailures)) { |
| 346 | return; |
| 347 | } |
| 348 | |
| 349 | if (!adfs.st_adfs_db_artifact_failure_total) { |
| 350 | adfs.st_adfs_db_artifact_failure_total = rrdset_create_localhost( |
| 351 | "adfs", |
| 352 | "db_artifact_failures", |
| 353 | NULL, |
| 354 | "db artifact", |
| 355 | "adfs.db_artifact_failures", |
| 356 | "Connection failures to the artifact database", |
| 357 | "failures/s", |
| 358 | PLUGIN_WINDOWS_NAME, |
| 359 | "PerflibADFS", |
| 360 | PRIO_ADFS_DB_ARTIFACT_FAILURE_TOTAL, |
| 361 | update_every, |
| 362 | RRDSET_TYPE_LINE); |
| 363 | |
| 364 | adfs.rd_adfs_db_artifact_failure_total = |
| 365 | rrddim_add(adfs.st_adfs_db_artifact_failure_total, "connection", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 366 | } |
| 367 | |
| 368 | rrddim_set_by_pointer( |
| 369 | adfs.st_adfs_db_artifact_failure_total, |
| 370 | adfs.rd_adfs_db_artifact_failure_total, |
| 371 | (collected_number)adfs.ADFSDBArtifactFailures.current.Data); |
| 372 | rrdset_done(adfs.st_adfs_db_artifact_failure_total); |
| 373 | } |
| 374 | |
| 375 | void netdata_adfs_db_artifacts_query_time_seconds( |
| 376 | PERF_DATA_BLOCK *pDataBlock, |
| 377 | PERF_OBJECT_TYPE *pObjectType, |
| 378 | int update_every) |
| 379 | { |
| 380 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &adfs.ADFSDBArtifactQueryTimeSeconds)) { |
| 381 | return; |
| 382 | } |
| 383 | |
| 384 | if (!adfs.st_adfs_db_artifact_query_time_seconds_total) { |
| 385 | adfs.st_adfs_db_artifact_query_time_seconds_total = rrdset_create_localhost( |
| 386 | "adfs", |
| 387 | "db_artifact_query_time_seconds", |
| 388 | NULL, |
| 389 | "db artifact", |
| 390 | "adfs.db_artifact_query_time_seconds", |
| 391 | "Time taken for an artifact database query", |
| 392 | "seconds/s", |
| 393 | PLUGIN_WINDOWS_NAME, |
| 394 | "PerflibADFS", |
| 395 | PRIO_ADFS_DB_ARTIFACT_QUERY_TIME_SECONDS_TOTAL, |
| 396 | update_every, |
| 397 | RRDSET_TYPE_LINE); |
| 398 | |
| 399 | adfs.rd_adfs_db_artifact_query_time_seconds_total = rrddim_add( |
| 400 | adfs.st_adfs_db_artifact_query_time_seconds_total, "query_time", NULL, 1, 1000, RRD_ALGORITHM_INCREMENTAL); |
| 401 | } |
| 402 | |
| 403 | rrddim_set_by_pointer( |
| 404 | adfs.st_adfs_db_artifact_query_time_seconds_total, |
| 405 | adfs.rd_adfs_db_artifact_query_time_seconds_total, |
| 406 | (collected_number)adfs.ADFSDBArtifactQueryTimeSeconds.current.Data); |
| 407 | rrdset_done(adfs.st_adfs_db_artifact_query_time_seconds_total); |
| 408 | } |
| 409 | |
| 410 | void netdata_adfs_db_config_failure(PERF_DATA_BLOCK *pDataBlock, PERF_OBJECT_TYPE *pObjectType, int update_every) |
| 411 | { |
| 412 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &adfs.ADFSDBConfigFailures)) { |
| 413 | return; |
| 414 | } |
| 415 | |
| 416 | if (!adfs.st_adfs_db_config_failures) { |
| 417 | adfs.st_adfs_db_config_failures = rrdset_create_localhost( |
| 418 | "adfs", |
| 419 | "db_config_failures", |
| 420 | NULL, |
| 421 | "db config", |
| 422 | "adfs.db_config_failures", |
| 423 | "Connection failures to the configuration database", |
| 424 | "failures/s", |
| 425 | PLUGIN_WINDOWS_NAME, |
| 426 | "PerflibADFS", |
| 427 | PRIO_ADFS_DB_CONFIG_FAILURE_TOTAL, |
| 428 | update_every, |
| 429 | RRDSET_TYPE_LINE); |
| 430 | |
| 431 | adfs.rd_adfs_db_config_failures = |
| 432 | rrddim_add(adfs.st_adfs_db_config_failures, "connection", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 433 | } |
| 434 | |
| 435 | rrddim_set_by_pointer( |
| 436 | adfs.st_adfs_db_config_failures, |
| 437 | adfs.rd_adfs_db_config_failures, |
| 438 | (collected_number)adfs.ADFSDBConfigFailures.current.Data); |
| 439 | rrdset_done(adfs.st_adfs_db_config_failures); |
| 440 | } |
| 441 | |
| 442 | void netdata_adfs_db_config_query_time_seconds( |
| 443 | PERF_DATA_BLOCK *pDataBlock, |
| 444 | PERF_OBJECT_TYPE *pObjectType, |
| 445 | int update_every) |
| 446 | { |
| 447 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &adfs.ADFSDBConfigQueryTimeSeconds)) { |
| 448 | return; |
| 449 | } |
| 450 | |
| 451 | if (!adfs.st_adfs_db_config_query_time_seconds_total) { |
| 452 | adfs.st_adfs_db_config_query_time_seconds_total = rrdset_create_localhost( |
| 453 | "adfs", |
| 454 | "db_config_query_time_seconds", |
| 455 | NULL, |
| 456 | "db config", |
| 457 | "adfs.db_config_query_time_seconds", |
| 458 | "Time taken for a configuration database query", |
| 459 | "seconds/s", |
| 460 | PLUGIN_WINDOWS_NAME, |
| 461 | "PerflibADFS", |
| 462 | PRIO_ADFS_DB_CONFIG_QUERY_TIME_SECONDS_TOTAL, |
| 463 | update_every, |
| 464 | RRDSET_TYPE_LINE); |
| 465 | |
| 466 | adfs.rd_adfs_db_config_query_time_seconds_total = rrddim_add( |
| 467 | adfs.st_adfs_db_config_query_time_seconds_total, "query_time", NULL, 1, 1000, RRD_ALGORITHM_INCREMENTAL); |
| 468 | } |
| 469 | |
| 470 | rrddim_set_by_pointer( |
| 471 | adfs.st_adfs_db_config_query_time_seconds_total, |
| 472 | adfs.rd_adfs_db_config_query_time_seconds_total, |
| 473 | (collected_number)adfs.ADFSDBConfigQueryTimeSeconds.current.Data); |
| 474 | rrdset_done(adfs.st_adfs_db_config_query_time_seconds_total); |
| 475 | } |
| 476 | |
| 477 | void netdata_adfs_device_authentications(PERF_DATA_BLOCK *pDataBlock, PERF_OBJECT_TYPE *pObjectType, int update_every) |
| 478 | { |
| 479 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &adfs.ADFSDeviceAuthentications)) { |
| 480 | return; |
| 481 | } |
| 482 | |
| 483 | if (!adfs.st_adfs_device_authentications_total) { |
| 484 | adfs.st_adfs_device_authentications_total = rrdset_create_localhost( |
| 485 | "adfs", |
| 486 | "device_authentications", |
| 487 | NULL, |
| 488 | "auth", |
| 489 | "adfs.device_authentications", |
| 490 | "Device authentications", |
| 491 | "authentications/s", |
| 492 | PLUGIN_WINDOWS_NAME, |
| 493 | "PerflibADFS", |
| 494 | PRIO_ADFS_DEVICE_AUTHENTICATIONS_TOTAL, |
| 495 | update_every, |
| 496 | RRDSET_TYPE_LINE); |
| 497 | |
| 498 | adfs.rd_adfs_device_authentications_total = rrddim_add( |
| 499 | adfs.st_adfs_device_authentications_total, "authentications", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 500 | } |
| 501 | |
| 502 | rrddim_set_by_pointer( |
| 503 | adfs.st_adfs_device_authentications_total, |
| 504 | adfs.rd_adfs_device_authentications_total, |
| 505 | (collected_number)adfs.ADFSDeviceAuthentications.current.Data); |
| 506 | rrdset_done(adfs.st_adfs_device_authentications_total); |
| 507 | } |
| 508 | |
| 509 | void netdata_adfs_extranet_account_lockouts( |
| 510 | PERF_DATA_BLOCK *pDataBlock, |
| 511 | PERF_OBJECT_TYPE *pObjectType, |
| 512 | int update_every) |
| 513 | { |
| 514 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &adfs.ADFSExtranetAccountLockouts)) { |
| 515 | return; |
| 516 | } |
| 517 | |
| 518 | if (!adfs.st_adfs_extranet_account_lockouts_total) { |
| 519 | adfs.st_adfs_extranet_account_lockouts_total = rrdset_create_localhost( |
| 520 | "adfs", |
| 521 | "extranet_account_lockouts", |
| 522 | NULL, |
| 523 | "auth", |
| 524 | "adfs.extranet_account_lockouts", |
| 525 | "Extranet account lockouts", |
| 526 | "lockouts/s", |
| 527 | PLUGIN_WINDOWS_NAME, |
| 528 | "PerflibADFS", |
| 529 | PRIO_ADFS_EXTRANET_ACCOUNT_LOCKOUTS_TOTAL, |
| 530 | update_every, |
| 531 | RRDSET_TYPE_LINE); |
| 532 | |
| 533 | adfs.rd_adfs_extranet_account_lockouts_total = rrddim_add( |
| 534 | adfs.st_adfs_extranet_account_lockouts_total, "lockouts", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 535 | } |
| 536 | |
| 537 | rrddim_set_by_pointer( |
| 538 | adfs.st_adfs_extranet_account_lockouts_total, |
| 539 | adfs.rd_adfs_extranet_account_lockouts_total, |
| 540 | (collected_number)adfs.ADFSExtranetAccountLockouts.current.Data); |
| 541 | rrdset_done(adfs.st_adfs_extranet_account_lockouts_total); |
| 542 | } |
| 543 | |
| 544 | void netdata_adfs_external_authentications(PERF_DATA_BLOCK *pDataBlock, PERF_OBJECT_TYPE *pObjectType, int update_every) |
| 545 | { |
| 546 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &adfs.ADFSExternalAuthenticationsSuccess) || |
| 547 | !perflibGetObjectCounter(pDataBlock, pObjectType, &adfs.ADFSExternalAuthenticationsFailure)) { |
| 548 | return; |
| 549 | } |
| 550 | |
| 551 | if (!adfs.st_adfs_external_authentications) { |
| 552 | adfs.st_adfs_external_authentications = rrdset_create_localhost( |
| 553 | "adfs", |
| 554 | "external_authentications", |
| 555 | NULL, |
| 556 | "auth", |
| 557 | "adfs.external_authentications", |
| 558 | "Authentications from external MFA providers", |
| 559 | "authentications/s", |
| 560 | PLUGIN_WINDOWS_NAME, |
| 561 | "PerflibADFS", |
| 562 | PRIO_ADFS_EXTERNAL_AUTHENTICATION_TOTAL, |
| 563 | update_every, |
| 564 | RRDSET_TYPE_LINE); |
| 565 | |
| 566 | adfs.rd_adfs_external_authentications_success = |
| 567 | rrddim_add(adfs.st_adfs_external_authentications, "success", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 568 | |
| 569 | adfs.rd_adfs_external_authentications_failure = |
| 570 | rrddim_add(adfs.st_adfs_external_authentications, "failure", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 571 | } |
| 572 | |
| 573 | rrddim_set_by_pointer( |
| 574 | adfs.st_adfs_external_authentications, |
| 575 | adfs.rd_adfs_external_authentications_success, |
| 576 | (collected_number)adfs.ADFSExternalAuthenticationsSuccess.current.Data); |
| 577 | |
| 578 | rrddim_set_by_pointer( |
| 579 | adfs.st_adfs_external_authentications, |
| 580 | adfs.rd_adfs_external_authentications_failure, |
| 581 | (collected_number)adfs.ADFSExternalAuthenticationsFailure.current.Data); |
| 582 | |
| 583 | rrdset_done(adfs.st_adfs_external_authentications); |
| 584 | } |
| 585 | |
| 586 | void netdata_adfs_federated_authentications(PERF_DATA_BLOCK *pDataBlock, PERF_OBJECT_TYPE *pObjectType, int update_every) |
| 587 | { |
| 588 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &adfs.ADFSFederationAuthentications)) { |
| 589 | return; |
| 590 | } |
| 591 | |
| 592 | if (!adfs.st_adfs_federation_authentications) { |
| 593 | adfs.st_adfs_federation_authentications = rrdset_create_localhost( |
| 594 | "adfs", |
| 595 | "federated_authentications", |
| 596 | NULL, |
| 597 | "auth", |
| 598 | "adfs.federated_authentications", |
| 599 | "Authentications from Federated Sources", |
| 600 | "authentications/s", |
| 601 | PLUGIN_WINDOWS_NAME, |
| 602 | "PerflibADFS", |
| 603 | PRIO_ADFS_FEDERATION_AUTHENTICATION_TOTAL, |
| 604 | update_every, |
| 605 | RRDSET_TYPE_LINE); |
| 606 | |
| 607 | adfs.rd_adfs_federation_authentications = rrddim_add( |
| 608 | adfs.st_adfs_federation_authentications, "authentications", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 609 | } |
| 610 | |
| 611 | rrddim_set_by_pointer( |
| 612 | adfs.st_adfs_federation_authentications, |
| 613 | adfs.rd_adfs_federation_authentications, |
| 614 | (collected_number)adfs.ADFSFederationAuthentications.current.Data); |
| 615 | |
| 616 | rrdset_done(adfs.st_adfs_federation_authentications); |
| 617 | } |
| 618 | |
| 619 | void netdata_adfs_federation_metadata_authentications( |
| 620 | PERF_DATA_BLOCK *pDataBlock, |
| 621 | PERF_OBJECT_TYPE *pObjectType, |
| 622 | int update_every) |
| 623 | { |
| 624 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &adfs.ADFSFederationMetadataAuthentications)) { |
| 625 | return; |
| 626 | } |
| 627 | |
| 628 | if (!adfs.st_adfs_federation_metadata_authentications) { |
| 629 | adfs.st_adfs_federation_metadata_authentications = rrdset_create_localhost( |
| 630 | "adfs", |
| 631 | "federation_metadata_requests", |
| 632 | NULL, |
| 633 | "auth", |
| 634 | "adfs.federation_metadata_requests", |
| 635 | "Federation Metadata requests", |
| 636 | "requests/s", |
| 637 | PLUGIN_WINDOWS_NAME, |
| 638 | "PerflibADFS", |
| 639 | PRIO_ADFS_FEDERATION_REQUESTS_AUTHENTICATION_TOTAL, |
| 640 | update_every, |
| 641 | RRDSET_TYPE_LINE); |
| 642 | |
| 643 | adfs.rd_adfs_federation_metadata_authentications = rrddim_add( |
| 644 | adfs.st_adfs_federation_metadata_authentications, "requests", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 645 | } |
| 646 | |
| 647 | rrddim_set_by_pointer( |
| 648 | adfs.st_adfs_federation_metadata_authentications, |
| 649 | adfs.rd_adfs_federation_metadata_authentications, |
| 650 | (collected_number)adfs.ADFSFederationMetadataAuthentications.current.Data); |
| 651 | |
| 652 | rrdset_done(adfs.st_adfs_federation_metadata_authentications); |
| 653 | } |
| 654 | |
| 655 | void netdata_adfs_oauth_authorization_requests( |
| 656 | PERF_DATA_BLOCK *pDataBlock, |
| 657 | PERF_OBJECT_TYPE *pObjectType, |
| 658 | int update_every) |
| 659 | { |
| 660 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &adfs.ADFSOauthAuthorizationRequests)) { |
| 661 | return; |
| 662 | } |
| 663 | |
| 664 | if (!adfs.st_adfs_oauth_authorization_requests_total) { |
| 665 | adfs.st_adfs_oauth_authorization_requests_total = rrdset_create_localhost( |
| 666 | "adfs", |
| 667 | "oauth_authorization_requests", |
| 668 | NULL, |
| 669 | "oauth", |
| 670 | "adfs.oauth_authorization_requests", |
| 671 | "Incoming requests to the OAuth Authorization endpoint", |
| 672 | "requests/s", |
| 673 | PLUGIN_WINDOWS_NAME, |
| 674 | "PerflibADFS", |
| 675 | PRIO_ADFS_OAUTH_AUTHORIZED_REQUEST, |
| 676 | update_every, |
| 677 | RRDSET_TYPE_LINE); |
| 678 | |
| 679 | adfs.rd_adfs_oauth_authorization_requests_total = rrddim_add( |
| 680 | adfs.st_adfs_oauth_authorization_requests_total, "requests", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 681 | } |
| 682 | |
| 683 | rrddim_set_by_pointer( |
| 684 | adfs.st_adfs_oauth_authorization_requests_total, |
| 685 | adfs.rd_adfs_oauth_authorization_requests_total, |
| 686 | (collected_number)adfs.ADFSOauthAuthorizationRequests.current.Data); |
| 687 | |
| 688 | rrdset_done(adfs.st_adfs_oauth_authorization_requests_total); |
| 689 | } |
| 690 | |
| 691 | void netdata_adfs_oauth_client_authentication( |
| 692 | PERF_DATA_BLOCK *pDataBlock, |
| 693 | PERF_OBJECT_TYPE *pObjectType, |
| 694 | int update_every) |
| 695 | { |
| 696 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &adfs.ADFSOauthClientAuthenticationsSuccess) || |
| 697 | !perflibGetObjectCounter(pDataBlock, pObjectType, &adfs.ADFSOauthClientAuthenticationsFailure)) { |
| 698 | return; |
| 699 | } |
| 700 | |
| 701 | if (!adfs.st_adfs_oauth_client_authentications) { |
| 702 | adfs.st_adfs_oauth_client_authentications = rrdset_create_localhost( |
| 703 | "adfs", |
| 704 | "oauth_client_authentications", |
| 705 | NULL, |
| 706 | "oauth", |
| 707 | "adfs.oauth_client_authentications", |
| 708 | "OAuth client authentications", |
| 709 | "authentications/s", |
| 710 | PLUGIN_WINDOWS_NAME, |
| 711 | "PerflibADFS", |
| 712 | PRIO_ADFS_OAUTH_CLIENT_AUTHORIZATION_REQUEST, |
| 713 | update_every, |
| 714 | RRDSET_TYPE_LINE); |
| 715 | |
| 716 | adfs.rd_adfs_oauth_client_authentications_success = |
| 717 | rrddim_add(adfs.st_adfs_oauth_client_authentications, "success", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 718 | |
| 719 | adfs.rd_adfs_oauth_client_authentications_failure = rrddim_add( |
| 720 | adfs.st_adfs_oauth_client_authentications, "failure", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 721 | } |
| 722 | |
| 723 | rrddim_set_by_pointer( |
| 724 | adfs.st_adfs_oauth_client_authentications, |
| 725 | adfs.rd_adfs_oauth_client_authentications_success, |
| 726 | (collected_number)adfs.ADFSOauthClientAuthenticationsSuccess.current.Data); |
| 727 | |
| 728 | rrddim_set_by_pointer( |
| 729 | adfs.st_adfs_oauth_client_authentications, |
| 730 | adfs.rd_adfs_oauth_client_authentications_failure, |
| 731 | (collected_number)adfs.ADFSOauthClientAuthenticationsFailure.current.Data); |
| 732 | |
| 733 | rrdset_done(adfs.st_adfs_oauth_client_authentications); |
| 734 | } |
| 735 | |
| 736 | void netdata_adfs_oauth_client_credentials_requests( |
| 737 | PERF_DATA_BLOCK *pDataBlock, |
| 738 | PERF_OBJECT_TYPE *pObjectType, |
| 739 | int update_every) |
| 740 | { |
| 741 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &adfs.ADFSOauthClientCredentialsSuccess) || |
| 742 | !perflibGetObjectCounter(pDataBlock, pObjectType, &adfs.ADFSOauthClientCredentialsFailure)) { |
| 743 | return; |
| 744 | } |
| 745 | |
| 746 | if (!adfs.st_adfs_oauth_client_credentials_requests) { |
| 747 | adfs.st_adfs_oauth_client_credentials_requests = rrdset_create_localhost( |
| 748 | "adfs", |
| 749 | "oauth_client_credentials_requests", |
| 750 | NULL, |
| 751 | "oauth", |
| 752 | "adfs.oauth_client_credentials_requests", |
| 753 | "OAuth client credentials requests", |
| 754 | "requests/s", |
| 755 | PLUGIN_WINDOWS_NAME, |
| 756 | "PerflibADFS", |
| 757 | PRIO_ADFS_OAUTH_CLIENT_CREDENTIAL_REQUEST, |
| 758 | update_every, |
| 759 | RRDSET_TYPE_LINE); |
| 760 | |
| 761 | adfs.rd_adfs_oauth_client_credentials_requests_success = rrddim_add( |
| 762 | adfs.st_adfs_oauth_client_credentials_requests, "success", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 763 | |
| 764 | adfs.rd_adfs_oauth_client_credentials_requests_failure = rrddim_add( |
| 765 | adfs.st_adfs_oauth_client_credentials_requests, "failure", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 766 | } |
| 767 | |
| 768 | rrddim_set_by_pointer( |
| 769 | adfs.st_adfs_oauth_client_credentials_requests, |
| 770 | adfs.rd_adfs_oauth_client_credentials_requests_success, |
| 771 | (collected_number)adfs.ADFSOauthClientCredentialsSuccess.current.Data); |
| 772 | |
| 773 | rrddim_set_by_pointer( |
| 774 | adfs.st_adfs_oauth_client_credentials_requests, |
| 775 | adfs.rd_adfs_oauth_client_credentials_requests_failure, |
| 776 | (collected_number)adfs.ADFSOauthClientCredentialsFailure.current.Data); |
| 777 | |
| 778 | rrdset_done(adfs.st_adfs_oauth_client_credentials_requests); |
| 779 | } |
| 780 | |
| 781 | void netdata_adfs_oauth_client_privkey_jwt_authentications( |
| 782 | PERF_DATA_BLOCK *pDataBlock, |
| 783 | PERF_OBJECT_TYPE *pObjectType, |
| 784 | int update_every) |
| 785 | { |
| 786 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &adfs.ADFSOauthClientPrivkeyJwtAuthenticationSuccess) || |
| 787 | !perflibGetObjectCounter(pDataBlock, pObjectType, &adfs.ADFSOauthClientPrivkeyJwtAuthenticationFailure)) { |
| 788 | return; |
| 789 | } |
| 790 | |
| 791 | if (!adfs.st_adfs_oauth_client_privkey_jwt_authentications) { |
| 792 | adfs.st_adfs_oauth_client_privkey_jwt_authentications = rrdset_create_localhost( |
| 793 | "adfs", |
| 794 | "oauth_client_privkey_jwt_authentications", |
| 795 | NULL, |
| 796 | "oauth", |
| 797 | "adfs.oauth_client_privkey_jwt_authentications", |
| 798 | "OAuth client private key JWT authentications", |
| 799 | "authentications/s", |
| 800 | PLUGIN_WINDOWS_NAME, |
| 801 | "PerflibADFS", |
| 802 | PRIO_ADFS_OAUTH_CLIENT_PRV_KEY_JWT_AUTH, |
| 803 | update_every, |
| 804 | RRDSET_TYPE_LINE); |
| 805 | |
| 806 | adfs.rd_adfs_oauth_client_privkey_jwt_authentications_success = rrddim_add( |
| 807 | adfs.st_adfs_oauth_client_privkey_jwt_authentications, "success", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 808 | |
| 809 | adfs.rd_adfs_oauth_client_privkey_jwt_authentications_failure = rrddim_add( |
| 810 | adfs.st_adfs_oauth_client_privkey_jwt_authentications, "failure", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 811 | } |
| 812 | |
| 813 | rrddim_set_by_pointer( |
| 814 | adfs.st_adfs_oauth_client_privkey_jwt_authentications, |
| 815 | adfs.rd_adfs_oauth_client_privkey_jwt_authentications_success, |
| 816 | (collected_number)adfs.ADFSOauthClientPrivkeyJwtAuthenticationSuccess.current.Data); |
| 817 | |
| 818 | rrddim_set_by_pointer( |
| 819 | adfs.st_adfs_oauth_client_privkey_jwt_authentications, |
| 820 | adfs.rd_adfs_oauth_client_privkey_jwt_authentications_failure, |
| 821 | (collected_number)adfs.ADFSOauthClientPrivkeyJwtAuthenticationFailure.current.Data); |
| 822 | |
| 823 | rrdset_done(adfs.st_adfs_oauth_client_privkey_jwt_authentications); |
| 824 | } |
| 825 | |
| 826 | void netdata_adfs_oauth_client_secret_basic_authentications( |
| 827 | PERF_DATA_BLOCK *pDataBlock, |
| 828 | PERF_OBJECT_TYPE *pObjectType, |
| 829 | int update_every) |
| 830 | { |
| 831 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &adfs.ADFSOauthClientSecretBasicAuthenticationsSuccess) || |
| 832 | !perflibGetObjectCounter(pDataBlock, pObjectType, &adfs.ADFSOauthClientSecretBasicAuthenticationsFailure)) { |
| 833 | return; |
| 834 | } |
| 835 | |
| 836 | if (!adfs.st_adfs_oauth_client_secret_basic_authentications) { |
| 837 | adfs.st_adfs_oauth_client_secret_basic_authentications = rrdset_create_localhost( |
| 838 | "adfs", |
| 839 | "oauth_client_secret_basic_authentications", |
| 840 | NULL, |
| 841 | "oauth", |
| 842 | "adfs.oauth_client_secret_basic_authentications", |
| 843 | "OAuth client secret basic authentications", |
| 844 | "authentications/s", |
| 845 | PLUGIN_WINDOWS_NAME, |
| 846 | "PerflibADFS", |
| 847 | PRIO_ADFS_OAUTH_CLIENT_SECRET_BASIC_AUTH, |
| 848 | update_every, |
| 849 | RRDSET_TYPE_LINE); |
| 850 | |
| 851 | adfs.rd_adfs_oauth_client_secret_basic_authentications_success = rrddim_add( |
| 852 | adfs.st_adfs_oauth_client_secret_basic_authentications, "success", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 853 | |
| 854 | adfs.rd_adfs_oauth_client_secret_basic_authentications_failure = rrddim_add( |
| 855 | adfs.st_adfs_oauth_client_secret_basic_authentications, "failure", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 856 | } |
| 857 | |
| 858 | rrddim_set_by_pointer( |
| 859 | adfs.st_adfs_oauth_client_secret_basic_authentications, |
| 860 | adfs.rd_adfs_oauth_client_secret_basic_authentications_success, |
| 861 | (collected_number)adfs.ADFSOauthClientSecretBasicAuthenticationsSuccess.current.Data); |
| 862 | |
| 863 | rrddim_set_by_pointer( |
| 864 | adfs.st_adfs_oauth_client_secret_basic_authentications, |
| 865 | adfs.rd_adfs_oauth_client_secret_basic_authentications_failure, |
| 866 | (collected_number)adfs.ADFSOauthClientSecretBasicAuthenticationsFailure.current.Data); |
| 867 | |
| 868 | rrdset_done(adfs.st_adfs_oauth_client_secret_basic_authentications); |
| 869 | } |
| 870 | |
| 871 | void netdata_adfs_oauth_client_secret_post_authentications( |
| 872 | PERF_DATA_BLOCK *pDataBlock, |
| 873 | PERF_OBJECT_TYPE *pObjectType, |
| 874 | int update_every) |
| 875 | { |
| 876 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &adfs.ADFSOauthClientSecretPostAuthenticationsSuccess) || |
| 877 | !perflibGetObjectCounter(pDataBlock, pObjectType, &adfs.ADFSOauthClientSecretPostAuthenticationsFailure)) { |
| 878 | return; |
| 879 | } |
| 880 | |
| 881 | if (!adfs.st_adfs_oauth_client_secret_post_authentications) { |
| 882 | adfs.st_adfs_oauth_client_secret_post_authentications = rrdset_create_localhost( |
| 883 | "adfs", |
| 884 | "oauth_client_secret_post_authentications", |
| 885 | NULL, |
| 886 | "oauth", |
| 887 | "adfs.oauth_client_secret_post_authentications", |
| 888 | "OAuth client secret post authentications", |
| 889 | "authentications/s", |
| 890 | PLUGIN_WINDOWS_NAME, |
| 891 | "PerflibADFS", |
| 892 | PRIO_ADFS_OAUTH_CLIENT_SECRET_POST_AUTH, |
| 893 | update_every, |
| 894 | RRDSET_TYPE_LINE); |
| 895 | |
| 896 | adfs.rd_adfs_oauth_client_secret_post_authentications_success = rrddim_add( |
| 897 | adfs.st_adfs_oauth_client_secret_post_authentications, "success", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 898 | |
| 899 | adfs.rd_adfs_oauth_client_secret_post_authentications_failure = rrddim_add( |
| 900 | adfs.st_adfs_oauth_client_secret_post_authentications, "failure", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 901 | } |
| 902 | |
| 903 | rrddim_set_by_pointer( |
| 904 | adfs.st_adfs_oauth_client_secret_post_authentications, |
| 905 | adfs.rd_adfs_oauth_client_secret_post_authentications_success, |
| 906 | (collected_number)adfs.ADFSOauthClientSecretPostAuthenticationsSuccess.current.Data); |
| 907 | |
| 908 | rrddim_set_by_pointer( |
| 909 | adfs.st_adfs_oauth_client_secret_post_authentications, |
| 910 | adfs.rd_adfs_oauth_client_secret_post_authentications_failure, |
| 911 | (collected_number)adfs.ADFSOauthClientSecretPostAuthenticationsFailure.current.Data); |
| 912 | |
| 913 | rrdset_done(adfs.st_adfs_oauth_client_secret_post_authentications); |
| 914 | } |
| 915 | |
| 916 | void netdata_adfs_oauth_client_windows_authentications( |
| 917 | PERF_DATA_BLOCK *pDataBlock, |
| 918 | PERF_OBJECT_TYPE *pObjectType, |
| 919 | int update_every) |
| 920 | { |
| 921 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &adfs.ADFSOauthClientWindowsAuthenticationsSuccess) || |
| 922 | !perflibGetObjectCounter(pDataBlock, pObjectType, &adfs.ADFSOauthClientWindowsAuthenticationsFailure)) { |
| 923 | return; |
| 924 | } |
| 925 | |
| 926 | if (!adfs.st_adfs_oauth_client_windows_authentications) { |
| 927 | adfs.st_adfs_oauth_client_windows_authentications = rrdset_create_localhost( |
| 928 | "adfs", |
| 929 | "oauth_client_windows_authentications", |
| 930 | NULL, |
| 931 | "oauth", |
| 932 | "adfs.oauth_client_windows_authentications", |
| 933 | "OAuth client windows integrated authentications", |
| 934 | "authentications/s", |
| 935 | PLUGIN_WINDOWS_NAME, |
| 936 | "PerflibADFS", |
| 937 | PRIO_ADFS_OAUTH_CLIENT_WINDOWS_AUTH, |
| 938 | update_every, |
| 939 | RRDSET_TYPE_LINE); |
| 940 | |
| 941 | adfs.rd_adfs_oauth_client_windows_authentications_success_total = rrddim_add( |
| 942 | adfs.st_adfs_oauth_client_windows_authentications, "success", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 943 | |
| 944 | adfs.rd_adfs_oauth_client_windows_authentications_failure_total = rrddim_add( |
| 945 | adfs.st_adfs_oauth_client_windows_authentications, "failure", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 946 | } |
| 947 | |
| 948 | rrddim_set_by_pointer( |
| 949 | adfs.st_adfs_oauth_client_windows_authentications, |
| 950 | adfs.rd_adfs_oauth_client_windows_authentications_success_total, |
| 951 | (collected_number)adfs.ADFSOauthClientWindowsAuthenticationsSuccess.current.Data); |
| 952 | |
| 953 | rrddim_set_by_pointer( |
| 954 | adfs.st_adfs_oauth_client_windows_authentications, |
| 955 | adfs.rd_adfs_oauth_client_windows_authentications_failure_total, |
| 956 | (collected_number)adfs.ADFSOauthClientWindowsAuthenticationsFailure.current.Data); |
| 957 | |
| 958 | rrdset_done(adfs.st_adfs_oauth_client_windows_authentications); |
| 959 | } |
| 960 | |
| 961 | void netdata_adfs_oauth_logon_certificate_request( |
| 962 | PERF_DATA_BLOCK *pDataBlock, |
| 963 | PERF_OBJECT_TYPE *pObjectType, |
| 964 | int update_every) |
| 965 | { |
| 966 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &adfs.ADFSOauthLogonCertificateRequestsSuccess) || |
| 967 | !perflibGetObjectCounter(pDataBlock, pObjectType, &adfs.ADFSOauthLogonCertificateRequestsFailure)) { |
| 968 | return; |
| 969 | } |
| 970 | |
| 971 | if (!adfs.st_adfs_oauth_logon_certificate_requests) { |
| 972 | adfs.st_adfs_oauth_logon_certificate_requests = rrdset_create_localhost( |
| 973 | "adfs", |
| 974 | "oauth_logon_certificate_requests", |
| 975 | NULL, |
| 976 | "oauth", |
| 977 | "adfs.oauth_logon_certificate_requests", |
| 978 | "OAuth logon certificate requests", |
| 979 | "requests/s", |
| 980 | PLUGIN_WINDOWS_NAME, |
| 981 | "PerflibADFS", |
| 982 | PRIO_ADFS_OAUTH_CLIENT_LOGON_CERTIFICATE_REQUEST, |
| 983 | update_every, |
| 984 | RRDSET_TYPE_LINE); |
| 985 | |
| 986 | adfs.rd_adfs_oauth_logon_certificate_requests_success_total = |
| 987 | rrddim_add(adfs.st_adfs_oauth_logon_certificate_requests, "success", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 988 | |
| 989 | adfs.rd_adfs_oauth_logon_certificate_requests_failure_total = |
| 990 | rrddim_add(adfs.st_adfs_oauth_logon_certificate_requests, "failure", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 991 | } |
| 992 | |
| 993 | rrddim_set_by_pointer( |
| 994 | adfs.st_adfs_oauth_logon_certificate_requests, |
| 995 | adfs.rd_adfs_oauth_logon_certificate_requests_success_total, |
| 996 | (collected_number)adfs.ADFSOauthLogonCertificateRequestsSuccess.current.Data); |
| 997 | |
| 998 | rrddim_set_by_pointer( |
| 999 | adfs.st_adfs_oauth_logon_certificate_requests, |
| 1000 | adfs.rd_adfs_oauth_logon_certificate_requests_failure_total, |
| 1001 | (collected_number)adfs.ADFSOauthLogonCertificateRequestsFailure.current.Data); |
| 1002 | |
| 1003 | rrdset_done(adfs.st_adfs_oauth_logon_certificate_requests); |
| 1004 | } |
| 1005 | |
| 1006 | void netdata_adfs_oauth_password_grant_requests( |
| 1007 | PERF_DATA_BLOCK *pDataBlock, |
| 1008 | PERF_OBJECT_TYPE *pObjectType, |
| 1009 | int update_every) |
| 1010 | { |
| 1011 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &adfs.ADFSOauthPasswordGrantRequestsSuccess) || |
| 1012 | !perflibGetObjectCounter(pDataBlock, pObjectType, &adfs.ADFSOauthPasswordGrantRequestsFailure)) { |
| 1013 | return; |
| 1014 | } |
| 1015 | |
| 1016 | if (!adfs.st_adfs_oauth_password_grant_requests) { |
| 1017 | adfs.st_adfs_oauth_password_grant_requests = rrdset_create_localhost( |
| 1018 | "adfs", |
| 1019 | "oauth_password_grant_requests", |
| 1020 | NULL, |
| 1021 | "oauth", |
| 1022 | "adfs.oauth_password_grant_requests", |
| 1023 | "OAuth password grant requests", |
| 1024 | "authentications/s", |
| 1025 | PLUGIN_WINDOWS_NAME, |
| 1026 | "PerflibADFS", |
| 1027 | PRIO_ADFS_OAUTH_TOKEN_REQUESTS_SUCCESS, |
| 1028 | update_every, |
| 1029 | RRDSET_TYPE_LINE); |
| 1030 | |
| 1031 | adfs.rd_adfs_oauth_password_grant_requests_success = |
| 1032 | rrddim_add(adfs.st_adfs_oauth_password_grant_requests, "success", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 1033 | |
| 1034 | adfs.rd_adfs_oauth_password_grant_requests_failure = |
| 1035 | rrddim_add(adfs.st_adfs_oauth_password_grant_requests, "failure", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 1036 | } |
| 1037 | |
| 1038 | rrddim_set_by_pointer( |
| 1039 | adfs.st_adfs_oauth_password_grant_requests, |
| 1040 | adfs.rd_adfs_oauth_password_grant_requests_success, |
| 1041 | (collected_number)adfs.ADFSOauthPasswordGrantRequestsSuccess.current.Data); |
| 1042 | |
| 1043 | rrddim_set_by_pointer( |
| 1044 | adfs.st_adfs_oauth_password_grant_requests, |
| 1045 | adfs.rd_adfs_oauth_password_grant_requests_failure, |
| 1046 | (collected_number)adfs.ADFSOauthPasswordGrantRequestsFailure.current.Data); |
| 1047 | |
| 1048 | rrdset_done(adfs.st_adfs_oauth_password_grant_requests); |
| 1049 | } |
| 1050 | |
| 1051 | void netdata_adfs_oauth_token_requests_success( |
| 1052 | PERF_DATA_BLOCK *pDataBlock, |
| 1053 | PERF_OBJECT_TYPE *pObjectType, |
| 1054 | int update_every) |
| 1055 | { |
| 1056 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &adfs.ADFSOauthTokenRequestsSuccess)) { |
| 1057 | return; |
| 1058 | } |
| 1059 | |
| 1060 | if (!adfs.st_adfs_oauth_token_requests_success) { |
| 1061 | adfs.st_adfs_oauth_token_requests_success = rrdset_create_localhost( |
| 1062 | "adfs", |
| 1063 | "oauth_token_requests_success", |
| 1064 | NULL, |
| 1065 | "oauth", |
| 1066 | "adfs.oauth_token_requests", |
| 1067 | "Successful RP token requests over OAuth protocol", |
| 1068 | "requests/s", |
| 1069 | PLUGIN_WINDOWS_NAME, |
| 1070 | "PerflibADFS", |
| 1071 | PRIO_ADFS_OAUTH_CLIENT_CREDENTIAL_REQUEST, |
| 1072 | update_every, |
| 1073 | RRDSET_TYPE_LINE); |
| 1074 | |
| 1075 | adfs.rd_adfs_oauth_token_requests_success = |
| 1076 | rrddim_add(adfs.st_adfs_oauth_token_requests_success, "success", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 1077 | } |
| 1078 | |
| 1079 | rrddim_set_by_pointer( |
| 1080 | adfs.st_adfs_oauth_token_requests_success, |
| 1081 | adfs.rd_adfs_oauth_token_requests_success, |
| 1082 | (collected_number)adfs.ADFSOauthTokenRequestsSuccess.current.Data); |
| 1083 | |
| 1084 | rrdset_done(adfs.st_adfs_oauth_token_requests_success); |
| 1085 | } |
| 1086 | |
| 1087 | void netdata_adfs_passive_requests_chart(PERF_DATA_BLOCK *pDataBlock, PERF_OBJECT_TYPE *pObjectType, int update_every) |
| 1088 | { |
| 1089 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &adfs.ADFSPassiveRequests)) { |
| 1090 | return; |
| 1091 | } |
| 1092 | |
| 1093 | if (!adfs.st_adfs_passive_requests_total) { |
| 1094 | adfs.st_adfs_passive_requests_total = rrdset_create_localhost( |
| 1095 | "adfs", |
| 1096 | "passive_requests", |
| 1097 | NULL, |
| 1098 | "requests", |
| 1099 | "adfs.passive_requests", |
| 1100 | "Passive requests", |
| 1101 | "requests/s", |
| 1102 | PLUGIN_WINDOWS_NAME, |
| 1103 | "PerflibADFS", |
| 1104 | PRIO_ADFS_PASSIVE_REQUESTS, |
| 1105 | update_every, |
| 1106 | RRDSET_TYPE_LINE); |
| 1107 | |
| 1108 | adfs.rd_adfs_passive_requests_total = |
| 1109 | rrddim_add(adfs.st_adfs_passive_requests_total, "passive", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 1110 | } |
| 1111 | |
| 1112 | rrddim_set_by_pointer( |
| 1113 | adfs.st_adfs_passive_requests_total, |
| 1114 | adfs.rd_adfs_passive_requests_total, |
| 1115 | (collected_number)adfs.ADFSPassiveRequests.current.Data); |
| 1116 | |
| 1117 | rrdset_done(adfs.st_adfs_passive_requests_total); |
| 1118 | } |
| 1119 | |
| 1120 | void netdata_adfs_passport_authentications_chart( |
| 1121 | PERF_DATA_BLOCK *pDataBlock, |
| 1122 | PERF_OBJECT_TYPE *pObjectType, |
| 1123 | int update_every) |
| 1124 | { |
| 1125 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &adfs.ADFSPassportAuthentications)) { |
| 1126 | return; |
| 1127 | } |
| 1128 | |
| 1129 | if (!adfs.st_adfs_passport_authentications_total) { |
| 1130 | adfs.st_adfs_passport_authentications_total = rrdset_create_localhost( |
| 1131 | "adfs", |
| 1132 | "passport_authentications", |
| 1133 | NULL, |
| 1134 | "auth", |
| 1135 | "adfs.passport_authentications", |
| 1136 | "Microsoft Passport SSO authentications", |
| 1137 | "authentications/s", |
| 1138 | PLUGIN_WINDOWS_NAME, |
| 1139 | "PerflibADFS", |
| 1140 | PRIO_ADFS_PASSPORT_AUTHENTICATOR, |
| 1141 | update_every, |
| 1142 | RRDSET_TYPE_LINE); |
| 1143 | |
| 1144 | adfs.rd_adfs_passport_authentications_total = |
| 1145 | rrddim_add(adfs.st_adfs_passport_authentications_total, "passport", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 1146 | } |
| 1147 | |
| 1148 | rrddim_set_by_pointer( |
| 1149 | adfs.st_adfs_passport_authentications_total, |
| 1150 | adfs.rd_adfs_passport_authentications_total, |
| 1151 | (collected_number)adfs.ADFSPassportAuthentications.current.Data); |
| 1152 | |
| 1153 | rrdset_done(adfs.st_adfs_passport_authentications_total); |
| 1154 | } |
| 1155 | |
| 1156 | void netdata_adfs_password_change_request(PERF_DATA_BLOCK *pDataBlock, PERF_OBJECT_TYPE *pObjectType, int update_every) |
| 1157 | { |
| 1158 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &adfs.ADFSPasswordChangeRequestsSuccess) || |
| 1159 | !perflibGetObjectCounter(pDataBlock, pObjectType, &adfs.ADFSPasswordChangeRequestsFailure)) { |
| 1160 | return; |
| 1161 | } |
| 1162 | |
| 1163 | if (!adfs.st_adfs_password_change_requests) { |
| 1164 | adfs.st_adfs_password_change_requests = rrdset_create_localhost( |
| 1165 | "adfs", |
| 1166 | "password_change_requests", |
| 1167 | NULL, |
| 1168 | "auth", |
| 1169 | "adfs.password_change_requests", |
| 1170 | "Password change requests", |
| 1171 | "requests/s", |
| 1172 | PLUGIN_WINDOWS_NAME, |
| 1173 | "PerflibADFS", |
| 1174 | PRIO_ADFS_PASSWORD_CHANGE_REQUEST, |
| 1175 | update_every, |
| 1176 | RRDSET_TYPE_LINE); |
| 1177 | |
| 1178 | adfs.rd_adfs_password_change_requests_success = |
| 1179 | rrddim_add(adfs.st_adfs_password_change_requests, "success", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 1180 | |
| 1181 | adfs.rd_adfs_password_change_requests_failure = |
| 1182 | rrddim_add(adfs.st_adfs_password_change_requests, "failure", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 1183 | } |
| 1184 | |
| 1185 | rrddim_set_by_pointer( |
| 1186 | adfs.st_adfs_password_change_requests, |
| 1187 | adfs.rd_adfs_password_change_requests_success, |
| 1188 | (collected_number)adfs.ADFSPasswordChangeRequestsSuccess.current.Data); |
| 1189 | |
| 1190 | rrddim_set_by_pointer( |
| 1191 | adfs.st_adfs_password_change_requests, |
| 1192 | adfs.rd_adfs_password_change_requests_failure, |
| 1193 | (collected_number)adfs.ADFSPasswordChangeRequestsFailure.current.Data); |
| 1194 | |
| 1195 | rrdset_done(adfs.st_adfs_password_change_requests); |
| 1196 | } |
| 1197 | |
| 1198 | void netdata_adfs_samlp_token_requests(PERF_DATA_BLOCK *pDataBlock, PERF_OBJECT_TYPE *pObjectType, int update_every) |
| 1199 | { |
| 1200 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &adfs.ADFSSAMLPTokenRequests)) { |
| 1201 | return; |
| 1202 | } |
| 1203 | |
| 1204 | if (!adfs.st_adfs_samlp_token_requests_success_total) { |
| 1205 | adfs.st_adfs_samlp_token_requests_success_total = rrdset_create_localhost( |
| 1206 | "adfs", |
| 1207 | "samlp_token_requests_success", |
| 1208 | NULL, |
| 1209 | "requests", |
| 1210 | "adfs.samlp_token_requests_success", |
| 1211 | "Successful RP token requests over SAML-P protocol", |
| 1212 | "requests/s", |
| 1213 | PLUGIN_WINDOWS_NAME, |
| 1214 | "PerflibADFS", |
| 1215 | PRIO_ADFS_SAMLP_TOKEN_REQUESTS, |
| 1216 | update_every, |
| 1217 | RRDSET_TYPE_LINE); |
| 1218 | |
| 1219 | adfs.rd_adfs_samlp_token_requests_success_total = rrddim_add( |
| 1220 | adfs.st_adfs_samlp_token_requests_success_total, "success", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 1221 | } |
| 1222 | |
| 1223 | rrddim_set_by_pointer( |
| 1224 | adfs.st_adfs_samlp_token_requests_success_total, |
| 1225 | adfs.rd_adfs_samlp_token_requests_success_total, |
| 1226 | (collected_number)adfs.ADFSSAMLPTokenRequests.current.Data); |
| 1227 | |
| 1228 | rrdset_done(adfs.st_adfs_samlp_token_requests_success_total); |
| 1229 | } |
| 1230 | |
| 1231 | void netdata_adfs_wstrust_token_requests(PERF_DATA_BLOCK *pDataBlock, PERF_OBJECT_TYPE *pObjectType, int update_every) |
| 1232 | { |
| 1233 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &adfs.ADFSWSTrustTokenRequestsSuccess)) { |
| 1234 | return; |
| 1235 | } |
| 1236 | |
| 1237 | if (!adfs.st_adfs_wstrust_token_requests_success_total) { |
| 1238 | adfs.st_adfs_wstrust_token_requests_success_total = rrdset_create_localhost( |
| 1239 | "adfs", |
| 1240 | "wstrust_token_requests_success", |
| 1241 | NULL, |
| 1242 | "requests", |
| 1243 | "adfs.wstrust_token_requests_success", |
| 1244 | "Successful RP token requests over WS-Trust protocol", |
| 1245 | "requests/s", |
| 1246 | PLUGIN_WINDOWS_NAME, |
| 1247 | "PerflibADFS", |
| 1248 | PRIO_ADFS_WSTRUST_TOKEN_SUCCESS, |
| 1249 | update_every, |
| 1250 | RRDSET_TYPE_LINE); |
| 1251 | |
| 1252 | adfs.rd_adfs_wstrust_token_requests_success_total = rrddim_add( |
| 1253 | adfs.st_adfs_wstrust_token_requests_success_total, "success", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 1254 | } |
| 1255 | |
| 1256 | rrddim_set_by_pointer( |
| 1257 | adfs.st_adfs_wstrust_token_requests_success_total, |
| 1258 | adfs.rd_adfs_wstrust_token_requests_success_total, |
| 1259 | (collected_number)adfs.ADFSWSTrustTokenRequestsSuccess.current.Data); |
| 1260 | |
| 1261 | rrdset_done(adfs.st_adfs_wstrust_token_requests_success_total); |
| 1262 | } |
| 1263 | |
| 1264 | void netdata_adfs_sso_authentications(PERF_DATA_BLOCK *pDataBlock, PERF_OBJECT_TYPE *pObjectType, int update_every) |
| 1265 | { |
| 1266 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &adfs.ADFSSSOAuthenticationsSuccess) || |
| 1267 | !perflibGetObjectCounter(pDataBlock, pObjectType, &adfs.ADFSSSOAuthenticationsFailure)) { |
| 1268 | return; |
| 1269 | } |
| 1270 | |
| 1271 | if (!adfs.st_adfs_sso_authentications) { |
| 1272 | adfs.st_adfs_sso_authentications = rrdset_create_localhost( |
| 1273 | "adfs", |
| 1274 | "sso_authentications", |
| 1275 | NULL, |
| 1276 | "auth", |
| 1277 | "adfs.sso_authentications", |
| 1278 | "SSO authentications", |
| 1279 | "authentications/s", |
| 1280 | PLUGIN_WINDOWS_NAME, |
| 1281 | "PerflibADFS", |
| 1282 | PRIO_ADFS_SSO_AUTH, |
| 1283 | update_every, |
| 1284 | RRDSET_TYPE_LINE); |
| 1285 | |
| 1286 | adfs.rd_adfs_sso_authentications_success = |
| 1287 | rrddim_add(adfs.st_adfs_sso_authentications, "success", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 1288 | |
| 1289 | adfs.rd_adfs_sso_authentications_failure = |
| 1290 | rrddim_add(adfs.st_adfs_sso_authentications, "failure", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 1291 | } |
| 1292 | |
| 1293 | rrddim_set_by_pointer( |
| 1294 | adfs.st_adfs_sso_authentications, |
| 1295 | adfs.rd_adfs_sso_authentications_success, |
| 1296 | (collected_number)adfs.ADFSSSOAuthenticationsSuccess.current.Data); |
| 1297 | |
| 1298 | rrddim_set_by_pointer( |
| 1299 | adfs.st_adfs_sso_authentications, |
| 1300 | adfs.rd_adfs_sso_authentications_failure, |
| 1301 | (collected_number)adfs.ADFSSSOAuthenticationsFailure.current.Data); |
| 1302 | |
| 1303 | rrdset_done(adfs.st_adfs_sso_authentications); |
| 1304 | } |
| 1305 | |
| 1306 | void netdata_adfs_token_request(PERF_DATA_BLOCK *pDataBlock, PERF_OBJECT_TYPE *pObjectType, int update_every) |
| 1307 | { |
| 1308 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &adfs.ADFSTokenRequests)) { |
| 1309 | return; |
| 1310 | } |
| 1311 | |
| 1312 | if (!adfs.st_adfs_token_requests_total) { |
| 1313 | adfs.st_adfs_token_requests_total = rrdset_create_localhost( |
| 1314 | "adfs", |
| 1315 | "token_requests", |
| 1316 | NULL, |
| 1317 | "requests", |
| 1318 | "adfs.token_requests", |
| 1319 | "Token access requests", |
| 1320 | "requests/s", |
| 1321 | PLUGIN_WINDOWS_NAME, |
| 1322 | "PerflibADFS", |
| 1323 | PRIO_ADFS_TOKEN_REQUEST, |
| 1324 | update_every, |
| 1325 | RRDSET_TYPE_LINE); |
| 1326 | |
| 1327 | adfs.rd_adfs_token_requests_total = |
| 1328 | rrddim_add(adfs.st_adfs_token_requests_total, "requests", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 1329 | } |
| 1330 | |
| 1331 | rrddim_set_by_pointer( |
| 1332 | adfs.st_adfs_token_requests_total, |
| 1333 | adfs.rd_adfs_token_requests_total, |
| 1334 | (collected_number)adfs.ADFSTokenRequests.current.Data); |
| 1335 | |
| 1336 | rrdset_done(adfs.st_adfs_token_requests_total); |
| 1337 | } |
| 1338 | |
| 1339 | void netdata_adfs_user_pass_auth(PERF_DATA_BLOCK *pDataBlock, PERF_OBJECT_TYPE *pObjectType, int update_every) |
| 1340 | { |
| 1341 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &adfs.ADFSUserPasswordAuthenticationsSuccess) || |
| 1342 | !perflibGetObjectCounter(pDataBlock, pObjectType, &adfs.ADFSUserPasswordAuthenticationsFailure)) { |
| 1343 | return; |
| 1344 | } |
| 1345 | |
| 1346 | if (!adfs.st_adfs_user_password_authentications) { |
| 1347 | adfs.st_adfs_user_password_authentications = rrdset_create_localhost( |
| 1348 | "adfs", |
| 1349 | "userpassword_authentications", |
| 1350 | NULL, |
| 1351 | "auth", |
| 1352 | "adfs.userpassword_authentications", |
| 1353 | "AD U/P authentications", |
| 1354 | "authentications/s", |
| 1355 | PLUGIN_WINDOWS_NAME, |
| 1356 | "PerflibADFS", |
| 1357 | PRIO_ADFS_USER_PASS_AUTH, |
| 1358 | update_every, |
| 1359 | RRDSET_TYPE_LINE); |
| 1360 | |
| 1361 | adfs.rd_adfs_user_password_authentications_success = |
| 1362 | rrddim_add(adfs.st_adfs_user_password_authentications, "success", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 1363 | |
| 1364 | adfs.rd_adfs_user_password_authentications_failure = |
| 1365 | rrddim_add(adfs.st_adfs_user_password_authentications, "failure", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 1366 | } |
| 1367 | |
| 1368 | rrddim_set_by_pointer( |
| 1369 | adfs.st_adfs_user_password_authentications, |
| 1370 | adfs.rd_adfs_user_password_authentications_success, |
| 1371 | (collected_number)adfs.ADFSUserPasswordAuthenticationsSuccess.current.Data); |
| 1372 | |
| 1373 | rrddim_set_by_pointer( |
| 1374 | adfs.st_adfs_user_password_authentications, |
| 1375 | adfs.rd_adfs_user_password_authentications_failure, |
| 1376 | (collected_number)adfs.ADFSUserPasswordAuthenticationsFailure.current.Data); |
| 1377 | |
| 1378 | rrdset_done(adfs.st_adfs_user_password_authentications); |
| 1379 | } |
| 1380 | |
| 1381 | void netdata_windows_integrated_auth(PERF_DATA_BLOCK *pDataBlock, PERF_OBJECT_TYPE *pObjectType, int update_every) |
| 1382 | { |
| 1383 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &adfs.ADFSWindowsIntegratedAuthentications)) { |
| 1384 | return; |
| 1385 | } |
| 1386 | |
| 1387 | if (!adfs.st_adfs_windows_integrated_authentications_total) { |
| 1388 | adfs.st_adfs_windows_integrated_authentications_total = rrdset_create_localhost( |
| 1389 | "adfs", |
| 1390 | "windows_integrated_authentications", |
| 1391 | NULL, |
| 1392 | "auth", |
| 1393 | "adfs.windows_integrated_authentications", |
| 1394 | "Windows integrated authentications using Kerberos or NTLM", |
| 1395 | "authentications/s", |
| 1396 | PLUGIN_WINDOWS_NAME, |
| 1397 | "PerflibADFS", |
| 1398 | PRIO_ADFS_TRUST_TOKEN_SUCCESS, |
| 1399 | update_every, |
| 1400 | RRDSET_TYPE_LINE); |
| 1401 | |
| 1402 | adfs.rd_adfs_windows_integrated_authentications_total = rrddim_add( |
| 1403 | adfs.st_adfs_windows_integrated_authentications_total, |
| 1404 | "authentications", |
| 1405 | NULL, |
| 1406 | 1, |
| 1407 | 1, |
| 1408 | RRD_ALGORITHM_INCREMENTAL); |
| 1409 | } |
| 1410 | |
| 1411 | rrddim_set_by_pointer( |
| 1412 | adfs.st_adfs_windows_integrated_authentications_total, |
| 1413 | adfs.rd_adfs_windows_integrated_authentications_total, |
| 1414 | (collected_number)adfs.ADFSWindowsIntegratedAuthentications.current.Data); |
| 1415 | |
| 1416 | rrdset_done(adfs.st_adfs_windows_integrated_authentications_total); |
| 1417 | } |
| 1418 | |
| 1419 | void netdata_wsfed_token_requests(PERF_DATA_BLOCK *pDataBlock, PERF_OBJECT_TYPE *pObjectType, int update_every) |
| 1420 | { |
| 1421 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &adfs.ADFSWSFedTokenRequestsSuccess)) { |
| 1422 | return; |
| 1423 | } |
| 1424 | |
| 1425 | if (!adfs.st_adfs_wsfed_token_requests_success_total) { |
| 1426 | adfs.st_adfs_wsfed_token_requests_success_total = rrdset_create_localhost( |
| 1427 | "adfs", |
| 1428 | "wsfed_token_requests_success", |
| 1429 | NULL, |
| 1430 | "requests", |
| 1431 | "adfs.wsfed_token_requests_success", |
| 1432 | "Successful RP token requests over WS-Fed protocol", |
| 1433 | "requests/s", |
| 1434 | PLUGIN_WINDOWS_NAME, |
| 1435 | "PerflibADFS", |
| 1436 | PRIO_ADFS_WSFED_TOKEN_REQUESTS, |
| 1437 | update_every, |
| 1438 | RRDSET_TYPE_LINE); |
| 1439 | |
| 1440 | adfs.rd_adfs_wsfed_token_requests_success_total = rrddim_add( |
| 1441 | adfs.st_adfs_wsfed_token_requests_success_total, "success", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 1442 | } |
| 1443 | |
| 1444 | rrddim_set_by_pointer( |
| 1445 | adfs.st_adfs_wsfed_token_requests_success_total, |
| 1446 | adfs.rd_adfs_wsfed_token_requests_success_total, |
| 1447 | (collected_number)adfs.ADFSWSFedTokenRequestsSuccess.current.Data); |
| 1448 | |
| 1449 | rrdset_done(adfs.st_adfs_wsfed_token_requests_success_total); |
| 1450 | } |
| 1451 | |
| 1452 | static bool do_ADFS(PERF_DATA_BLOCK *pDataBlock, int update_every) |
| 1453 | { |
| 1454 | PERF_OBJECT_TYPE *pObjectType = perflibFindObjectTypeByName(pDataBlock, "AD FS"); |
| 1455 | if (!pObjectType) |
| 1456 | return false; |
| 1457 | |
| 1458 | static void (*doADFS[])(PERF_DATA_BLOCK *, PERF_OBJECT_TYPE *, int) = { |
| 1459 | // ADFS/AD |
| 1460 | netdata_adfs_login_connection_failures, |
| 1461 | netdata_adfs_certificate_authentications, |
| 1462 | |
| 1463 | // DB Artifacts |
| 1464 | netdata_adfs_db_artifacts_failure, |
| 1465 | netdata_adfs_db_artifacts_query_time_seconds, |
| 1466 | |
| 1467 | // DB Config |
| 1468 | netdata_adfs_db_config_failure, |
| 1469 | netdata_adfs_db_config_query_time_seconds, |
| 1470 | |
| 1471 | // Auth |
| 1472 | netdata_adfs_device_authentications, |
| 1473 | netdata_adfs_extranet_account_lockouts, |
| 1474 | netdata_adfs_external_authentications, |
| 1475 | netdata_adfs_federated_authentications, |
| 1476 | netdata_adfs_federation_metadata_authentications, |
| 1477 | |
| 1478 | // OAuth |
| 1479 | netdata_adfs_oauth_authorization_requests, |
| 1480 | netdata_adfs_oauth_client_authentication, |
| 1481 | netdata_adfs_oauth_client_credentials_requests, |
| 1482 | netdata_adfs_oauth_client_privkey_jwt_authentications, |
| 1483 | netdata_adfs_oauth_client_secret_basic_authentications, |
| 1484 | netdata_adfs_oauth_client_secret_post_authentications, |
| 1485 | netdata_adfs_oauth_client_windows_authentications, |
| 1486 | netdata_adfs_oauth_logon_certificate_request, |
| 1487 | netdata_adfs_oauth_password_grant_requests, |
| 1488 | netdata_adfs_oauth_token_requests_success, |
| 1489 | |
| 1490 | // Requests |
| 1491 | netdata_adfs_passive_requests_chart, |
| 1492 | netdata_adfs_passport_authentications_chart, |
| 1493 | netdata_adfs_password_change_request, |
| 1494 | netdata_adfs_samlp_token_requests, |
| 1495 | netdata_adfs_wstrust_token_requests, |
| 1496 | netdata_adfs_sso_authentications, |
| 1497 | netdata_adfs_token_request, |
| 1498 | netdata_adfs_user_pass_auth, |
| 1499 | netdata_windows_integrated_auth, |
| 1500 | netdata_wsfed_token_requests, |
| 1501 | |
| 1502 | // This must be the end |
| 1503 | NULL}; |
| 1504 | |
| 1505 | DWORD i; |
| 1506 | for (i = 0; doADFS[i]; i++) { |
| 1507 | doADFS[i](pDataBlock, pObjectType, update_every); |
| 1508 | } |
| 1509 | |
| 1510 | return true; |
| 1511 | } |
| 1512 | |
| 1513 | int do_PerflibADFS(int update_every, usec_t dt __maybe_unused) |
| 1514 | { |
| 1515 | DWORD id = RegistryFindIDByName("AD FS"); |
| 1516 | if (id == PERFLIB_REGISTRY_NAME_NOT_FOUND) |
| 1517 | return -1; |
| 1518 | |
| 1519 | PERF_DATA_BLOCK *pDataBlock = perflibGetPerformanceData(id); |
| 1520 | if (!pDataBlock) |
| 1521 | return -1; |
| 1522 | |
| 1523 | if (!do_ADFS(pDataBlock, update_every)) |
| 1524 | return -1; |
| 1525 | |
| 1526 | return 0; |
| 1527 | } |