@cryptotaxi247 / netdata-1 / commits / 22fbd2c42

AD fixes (windows.plugin) (#21454)

thiagoftsm committed Dec 12, 2025 at 12:27 UTC 22fbd2c429b4a7041b1fc744b8e49d28622f160a
3 files changed +54 -51
src/collectors/windows.plugin/perflib-ad.c
+20 -16
@@ -187,9 +187,12 @@ static void netdata_ad_searches(PERF_DATA_BLOCK *pDataBlock, PERF_OBJECT_TYPE *p
187 static RRDSET *st_ldap_searches_total = NULL;
188 static RRDDIM *rd_ldap_searches_total = NULL;
189
190 - if (perflibGetObjectCounter(pDataBlock, pObjectType, &ldapSearchesTotal)) {
191 - if (unlikely(!st_ldap_searches_total)) {
192 - st_ldap_searches_total = rrdset_create_localhost(
190 + if (!perflibGetObjectCounter(pDataBlock, pObjectType, &ldapSearchesTotal)) {
191 + return;
192 + }
193 +
194 + if (unlikely(!st_ldap_searches_total)) {
195 + st_ldap_searches_total = rrdset_create_localhost(
196 "ad",
197 "ldap_searches",
198 NULL,
@@ -203,14 +206,13 @@ static void netdata_ad_searches(PERF_DATA_BLOCK *pDataBlock, PERF_OBJECT_TYPE *p
206 update_every,
207 RRDSET_TYPE_LINE);
208
206 - rd_ldap_searches_total =
209 + rd_ldap_searches_total =
210 rrddim_add(st_ldap_searches_total, "searches", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
208 - }
211 + }
212
210 - rrddim_set_by_pointer(
213 + rrddim_set_by_pointer(
214 st_ldap_searches_total, rd_ldap_searches_total, (collected_number)ldapSearchesTotal.current.Data);
212 - rrdset_done(st_ldap_searches_total);
213 - }
215 + rrdset_done(st_ldap_searches_total);
216 }
217
218 static void netdata_ad_properties(PERF_DATA_BLOCK *pDataBlock, PERF_OBJECT_TYPE *pObjectType, int update_every)
@@ -490,9 +492,12 @@ netdata_ad_service_threads_in_use(PERF_DATA_BLOCK *pDataBlock, PERF_OBJECT_TYPE
492 static RRDSET *st_directory_services_threads = NULL;
493 static RRDDIM *rd_directory_services_threads = NULL;
494
493 - if (perflibGetObjectCounter(pDataBlock, pObjectType, &directoryServiceThreads)) {
494 - if (unlikely(!st_directory_services_threads)) {
495 - st_directory_services_threads = rrdset_create_localhost(
495 + if (!perflibGetObjectCounter(pDataBlock, pObjectType, &directoryServiceThreads)) {
496 + return;
497 + }
498 +
499 + if (unlikely(!st_directory_services_threads)) {
500 + st_directory_services_threads = rrdset_create_localhost(
501 "ad",
502 "ds_threads",
503 NULL,
@@ -506,16 +511,15 @@ netdata_ad_service_threads_in_use(PERF_DATA_BLOCK *pDataBlock, PERF_OBJECT_TYPE
511 update_every,
512 RRDSET_TYPE_LINE);
513
509 - rd_directory_services_threads =
514 + rd_directory_services_threads =
515 rrddim_add(st_directory_services_threads, "thread", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE);
511 - }
516 + }
517
513 - rrddim_set_by_pointer(
518 + rrddim_set_by_pointer(
519 st_directory_services_threads,
520 rd_directory_services_threads,
521 (collected_number)directoryServiceThreads.current.Data);
517 - rrdset_done(st_directory_services_threads);
518 - }
522 + rrdset_done(st_directory_services_threads);
523 }
524
525 static void netdata_ad_bind(PERF_DATA_BLOCK *pDataBlock, PERF_OBJECT_TYPE *pObjectType, int update_every)
src/collectors/windows.plugin/perflib-adcs.c
+23 -24
@@ -381,9 +381,9 @@ static void netdata_adcs_retrieval_processing(
381 return;
382 }
383
384 - if (!ac->st_adcs_challenge_response_processing_time_seconds) {
384 + if (!ac->st_adcs_retrievals_processing_time_seconds) {
385 snprintfz(id, RRD_ID_LENGTH_MAX, "cert_%s_retrievals_processing_time", ac->name);
386 - ac->st_adcs_challenge_response_processing_time_seconds = rrdset_create_localhost(
386 + ac->st_adcs_retrievals_processing_time_seconds = rrdset_create_localhost(
387 "adcs",
388 id,
389 NULL,
@@ -397,8 +397,8 @@ static void netdata_adcs_retrieval_processing(
397 update_every,
398 RRDSET_TYPE_LINE);
399
400 - ac->rd_adcs_challenge_response_processing_time_seconds = rrddim_add(
401 - ac->st_adcs_challenge_response_processing_time_seconds,
400 + ac->rd_adcs_retrievals_processing_time_seconds = rrddim_add(
401 + ac->st_adcs_retrievals_processing_time_seconds,
402 "processing_time",
403 NULL,
404 1,
@@ -406,17 +406,17 @@ static void netdata_adcs_retrieval_processing(
406 RRD_ALGORITHM_ABSOLUTE);
407
408 rrdlabels_add(
409 - ac->st_adcs_challenge_response_processing_time_seconds->rrdlabels, "cert", ac->name, RRDLABEL_SRC_AUTO);
409 + ac->st_adcs_retrievals_processing_time_seconds->rrdlabels, "cert", ac->name, RRDLABEL_SRC_AUTO);
410 }
411
412 rrddim_set_by_pointer(
413 - ac->st_adcs_challenge_response_processing_time_seconds,
414 - ac->rd_adcs_challenge_response_processing_time_seconds,
413 + ac->st_adcs_retrievals_processing_time_seconds,
414 + ac->rd_adcs_retrievals_processing_time_seconds,
415 (collected_number)ac->ADCSRetrievalsProcessingTime.current.Data);
416 - rrdset_done(ac->st_adcs_challenge_response_processing_time_seconds);
416 + rrdset_done(ac->st_adcs_retrievals_processing_time_seconds);
417 }
418
419 -static void netdata_adcs_crypto_singing_time(
419 +static void netdata_adcs_crypto_signing_time(
420 struct adcs_certificate *ac,
421 PERF_DATA_BLOCK *pDataBlock,
422 PERF_OBJECT_TYPE *pObjectType,
@@ -458,7 +458,7 @@ static void netdata_adcs_crypto_singing_time(
458 rrddim_set_by_pointer(
459 ac->st_adcs_request_cryptographic_signing_time_seconds,
460 ac->rd_adcs_request_cryptographic_signing_time_seconds,
461 - (collected_number)ac->ADCSRetrievalsProcessingTime.current.Data);
461 + (collected_number)ac->ADCSRequestCryptoSigningTime.current.Data);
462 rrdset_done(ac->st_adcs_request_cryptographic_signing_time_seconds);
463 }
464
@@ -656,20 +656,19 @@ static bool do_ADCS(PERF_DATA_BLOCK *pDataBlock, int update_every)
656 return false;
657
658 static void (*doADCS[])(struct adcs_certificate *, PERF_DATA_BLOCK *, PERF_OBJECT_TYPE *, int) = {
659 - netdata_adcs_requests,
660 - netdata_adcs_requests_processing_time,
661 - netdata_adcs_retrievals,
662 - netdata_adcs_failed_requets,
663 - netdata_adcs_issued_requets,
664 - netdata_adcs_pending_requets,
665 - netdata_adcs_challenge_response,
666 - netdata_adcs_retrieval_processing,
667 - netdata_adcs_crypto_singing_time,
668 - netdata_adcs_policy_mod_processing_time,
669 - netdata_adcs_challenge_response_processing_time,
670 - netdata_adcs_signed_certificate_timetamp_list,
671 - netdata_adcs_signed_certificate_timetamp_list_processing,
672 - netdata_adcs_retrieval_processing,
659 + netdata_adcs_requests,
660 + netdata_adcs_requests_processing_time,
661 + netdata_adcs_retrievals,
662 + netdata_adcs_failed_requets,
663 + netdata_adcs_issued_requets,
664 + netdata_adcs_pending_requets,
665 + netdata_adcs_challenge_response,
666 + netdata_adcs_retrieval_processing,
667 + netdata_adcs_crypto_signing_time,
668 + netdata_adcs_policy_mod_processing_time,
669 + netdata_adcs_challenge_response_processing_time,
670 + netdata_adcs_signed_certificate_timetamp_list,
671 + netdata_adcs_signed_certificate_timetamp_list_processing,
672
673 // This must be the end
674 NULL};
src/collectors/windows.plugin/perflib-adfs.c
+11 -11
@@ -239,8 +239,8 @@ struct adfs_certificate {
239 .ADFSOauthClientCredentialsFailure.key = "OAuth Client Credentials Request Failures",
240 .ADFSOauthClientPrivkeyJwtAuthenticationSuccess.key = "OAuth Client Private Key Jwt Authentications",
241 .ADFSOauthClientPrivkeyJwtAuthenticationFailure.key = "OAuth Client Private Key Jwt Authentication Failures",
242 - .ADFSOauthClientSecretBasicAuthenticationsSuccess.key = "OAuth Client Secret Post Authentication",
243 - .ADFSOauthClientSecretBasicAuthenticationsFailure.key = "OAuth Client Secret Post Authentication Failures",
242 + .ADFSOauthClientSecretBasicAuthenticationsSuccess.key = "OAuth Client Secret Basic Authentications",
243 + .ADFSOauthClientSecretBasicAuthenticationsFailure.key = "OAuth Client Secret Basic Authentication Failures",
244 .ADFSOauthClientSecretPostAuthenticationsSuccess.key = "OAuth Client Secret Post Authentication",
245 .ADFSOauthClientSecretPostAuthenticationsFailure.key = "OAuth Client Secret Post Authentication Failures",
246 .ADFSOauthClientWindowsAuthenticationsSuccess.key = "OAuth Client Windows Integrated Authentication",
@@ -261,8 +261,8 @@ struct adfs_certificate {
261 .ADFSSSOAuthenticationsSuccess.key = "SSO Authentications",
262 .ADFSSSOAuthenticationsFailure.key = "SSO Authentication Failures",
263 .ADFSTokenRequests.key = "Token Requests",
264 - .ADFSUserPasswordAuthenticationsSuccess.key = "SSO Authentications",
265 - .ADFSUserPasswordAuthenticationsFailure.key = "SSO Authentication Failures",
264 + .ADFSUserPasswordAuthenticationsSuccess.key = "U/P Authentications",
265 + .ADFSUserPasswordAuthenticationsFailure.key = "U/P Authentication Failures",
266 .ADFSWindowsIntegratedAuthentications.key = "Windows Integrated Authentications",
267 .ADFSWSFedTokenRequestsSuccess.key = "WS-Fed Token Requests",
268 };
@@ -577,7 +577,7 @@ void netdata_adfs_federated_authentications(PERF_DATA_BLOCK *pDataBlock, PERF_OB
577 adfs.rd_adfs_federation_authentications,
578 (collected_number)adfs.ADFSFederationAuthentications.current.Data);
579
580 - rrdset_done(adfs.st_adfs_external_authentications);
580 + rrdset_done(adfs.st_adfs_federation_authentications);
581 }
582
583 void netdata_adfs_federation_metadata_authentications(
@@ -935,11 +935,11 @@ void netdata_adfs_oauth_logon_certificate_request(
935 if (!adfs.st_adfs_oauth_logon_certificate_requests) {
936 adfs.st_adfs_oauth_logon_certificate_requests = rrdset_create_localhost(
937 "adfs",
938 - "oauth_client_windows_authentications",
938 + "oauth_logon_certificate_requests",
939 NULL,
940 "oauth",
941 - "adfs.oauth_client_windows_authentications",
942 - "OAuth client windows integrated authentications",
941 + "adfs.oauth_logon_certificate_requests",
942 + "OAuth logon certificate requests",
943 "requests/s",
944 PLUGIN_WINDOWS_NAME,
945 "PerflibADFS",
@@ -980,11 +980,11 @@ void netdata_adfs_oauth_password_grant_requests(
980 if (!adfs.st_adfs_oauth_password_grant_requests) {
981 adfs.st_adfs_oauth_password_grant_requests = rrdset_create_localhost(
982 "adfs",
983 - "oauth_client_windows_authentications",
983 + "oauth_password_grant_requests",
984 NULL,
985 "oauth",
986 - "adfs.oauth_client_windows_authentications",
987 - "OAuth client windows integrated authentications",
986 + "adfs.oauth_password_grant_requests",
987 + "OAuth password grant requests",
988 "authentications/s",
989 PLUGIN_WINDOWS_NAME,
990 "PerflibADFS",