Skip to content

Commit 22fbd2c

Browse files
authored
AD fixes (windows.plugin) (netdata#21454)
1 parent 341b88d commit 22fbd2c

File tree

3 files changed

+54
-51
lines changed

3 files changed

+54
-51
lines changed

src/collectors/windows.plugin/perflib-ad.c

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -187,9 +187,12 @@ static void netdata_ad_searches(PERF_DATA_BLOCK *pDataBlock, PERF_OBJECT_TYPE *p
187187
static RRDSET *st_ldap_searches_total = NULL;
188188
static RRDDIM *rd_ldap_searches_total = NULL;
189189

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(
193196
"ad",
194197
"ldap_searches",
195198
NULL,
@@ -203,14 +206,13 @@ static void netdata_ad_searches(PERF_DATA_BLOCK *pDataBlock, PERF_OBJECT_TYPE *p
203206
update_every,
204207
RRDSET_TYPE_LINE);
205208

206-
rd_ldap_searches_total =
209+
rd_ldap_searches_total =
207210
rrddim_add(st_ldap_searches_total, "searches", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
208-
}
211+
}
209212

210-
rrddim_set_by_pointer(
213+
rrddim_set_by_pointer(
211214
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);
214216
}
215217

216218
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
490492
static RRDSET *st_directory_services_threads = NULL;
491493
static RRDDIM *rd_directory_services_threads = NULL;
492494

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(
496501
"ad",
497502
"ds_threads",
498503
NULL,
@@ -506,16 +511,15 @@ netdata_ad_service_threads_in_use(PERF_DATA_BLOCK *pDataBlock, PERF_OBJECT_TYPE
506511
update_every,
507512
RRDSET_TYPE_LINE);
508513

509-
rd_directory_services_threads =
514+
rd_directory_services_threads =
510515
rrddim_add(st_directory_services_threads, "thread", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE);
511-
}
516+
}
512517

513-
rrddim_set_by_pointer(
518+
rrddim_set_by_pointer(
514519
st_directory_services_threads,
515520
rd_directory_services_threads,
516521
(collected_number)directoryServiceThreads.current.Data);
517-
rrdset_done(st_directory_services_threads);
518-
}
522+
rrdset_done(st_directory_services_threads);
519523
}
520524

521525
static void netdata_ad_bind(PERF_DATA_BLOCK *pDataBlock, PERF_OBJECT_TYPE *pObjectType, int update_every)

src/collectors/windows.plugin/perflib-adcs.c

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -381,9 +381,9 @@ static void netdata_adcs_retrieval_processing(
381381
return;
382382
}
383383

384-
if (!ac->st_adcs_challenge_response_processing_time_seconds) {
384+
if (!ac->st_adcs_retrievals_processing_time_seconds) {
385385
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(
387387
"adcs",
388388
id,
389389
NULL,
@@ -397,26 +397,26 @@ static void netdata_adcs_retrieval_processing(
397397
update_every,
398398
RRDSET_TYPE_LINE);
399399

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,
402402
"processing_time",
403403
NULL,
404404
1,
405405
1000,
406406
RRD_ALGORITHM_ABSOLUTE);
407407

408408
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);
410410
}
411411

412412
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,
415415
(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);
417417
}
418418

419-
static void netdata_adcs_crypto_singing_time(
419+
static void netdata_adcs_crypto_signing_time(
420420
struct adcs_certificate *ac,
421421
PERF_DATA_BLOCK *pDataBlock,
422422
PERF_OBJECT_TYPE *pObjectType,
@@ -458,7 +458,7 @@ static void netdata_adcs_crypto_singing_time(
458458
rrddim_set_by_pointer(
459459
ac->st_adcs_request_cryptographic_signing_time_seconds,
460460
ac->rd_adcs_request_cryptographic_signing_time_seconds,
461-
(collected_number)ac->ADCSRetrievalsProcessingTime.current.Data);
461+
(collected_number)ac->ADCSRequestCryptoSigningTime.current.Data);
462462
rrdset_done(ac->st_adcs_request_cryptographic_signing_time_seconds);
463463
}
464464

@@ -656,20 +656,19 @@ static bool do_ADCS(PERF_DATA_BLOCK *pDataBlock, int update_every)
656656
return false;
657657

658658
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,
673672

674673
// This must be the end
675674
NULL};

src/collectors/windows.plugin/perflib-adfs.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -239,8 +239,8 @@ struct adfs_certificate {
239239
.ADFSOauthClientCredentialsFailure.key = "OAuth Client Credentials Request Failures",
240240
.ADFSOauthClientPrivkeyJwtAuthenticationSuccess.key = "OAuth Client Private Key Jwt Authentications",
241241
.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",
244244
.ADFSOauthClientSecretPostAuthenticationsSuccess.key = "OAuth Client Secret Post Authentication",
245245
.ADFSOauthClientSecretPostAuthenticationsFailure.key = "OAuth Client Secret Post Authentication Failures",
246246
.ADFSOauthClientWindowsAuthenticationsSuccess.key = "OAuth Client Windows Integrated Authentication",
@@ -261,8 +261,8 @@ struct adfs_certificate {
261261
.ADFSSSOAuthenticationsSuccess.key = "SSO Authentications",
262262
.ADFSSSOAuthenticationsFailure.key = "SSO Authentication Failures",
263263
.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",
266266
.ADFSWindowsIntegratedAuthentications.key = "Windows Integrated Authentications",
267267
.ADFSWSFedTokenRequestsSuccess.key = "WS-Fed Token Requests",
268268
};
@@ -577,7 +577,7 @@ void netdata_adfs_federated_authentications(PERF_DATA_BLOCK *pDataBlock, PERF_OB
577577
adfs.rd_adfs_federation_authentications,
578578
(collected_number)adfs.ADFSFederationAuthentications.current.Data);
579579

580-
rrdset_done(adfs.st_adfs_external_authentications);
580+
rrdset_done(adfs.st_adfs_federation_authentications);
581581
}
582582

583583
void netdata_adfs_federation_metadata_authentications(
@@ -935,11 +935,11 @@ void netdata_adfs_oauth_logon_certificate_request(
935935
if (!adfs.st_adfs_oauth_logon_certificate_requests) {
936936
adfs.st_adfs_oauth_logon_certificate_requests = rrdset_create_localhost(
937937
"adfs",
938-
"oauth_client_windows_authentications",
938+
"oauth_logon_certificate_requests",
939939
NULL,
940940
"oauth",
941-
"adfs.oauth_client_windows_authentications",
942-
"OAuth client windows integrated authentications",
941+
"adfs.oauth_logon_certificate_requests",
942+
"OAuth logon certificate requests",
943943
"requests/s",
944944
PLUGIN_WINDOWS_NAME,
945945
"PerflibADFS",
@@ -980,11 +980,11 @@ void netdata_adfs_oauth_password_grant_requests(
980980
if (!adfs.st_adfs_oauth_password_grant_requests) {
981981
adfs.st_adfs_oauth_password_grant_requests = rrdset_create_localhost(
982982
"adfs",
983-
"oauth_client_windows_authentications",
983+
"oauth_password_grant_requests",
984984
NULL,
985985
"oauth",
986-
"adfs.oauth_client_windows_authentications",
987-
"OAuth client windows integrated authentications",
986+
"adfs.oauth_password_grant_requests",
987+
"OAuth password grant requests",
988988
"authentications/s",
989989
PLUGIN_WINDOWS_NAME,
990990
"PerflibADFS",

0 commit comments

Comments
 (0)