github.com/netdata/go.d.plugin@v0.58.1/modules/windows/collect_adfs.go (about) 1 // SPDX-License-Identifier: GPL-3.0-or-later 2 3 package windows 4 5 import ( 6 "strings" 7 8 "github.com/netdata/go.d.plugin/pkg/prometheus" 9 ) 10 11 const ( 12 metricADFSADLoginConnectionFailuresTotal = "windows_adfs_ad_login_connection_failures_total" 13 metricADFSCertificateAuthenticationsTotal = "windows_adfs_certificate_authentications_total" 14 metricADFSDBArtifactFailureTotal = "windows_adfs_db_artifact_failure_total" 15 metricADFSDBArtifactQueryTimeSeconds = "windows_adfs_db_artifact_query_time_seconds_total" 16 metricADFSDBConfigFailureTotal = "windows_adfs_db_config_failure_total" 17 metricADFSDBQueryTimeSecondsTotal = "windows_adfs_db_config_query_time_seconds_total" 18 metricADFSDeviceAuthenticationsTotal = "windows_adfs_device_authentications_total" 19 metricADFSExternalAuthenticationsFailureTotal = "windows_adfs_external_authentications_failure_total" 20 metricADFSExternalAuthenticationsSuccessTotal = "windows_adfs_external_authentications_success_total" 21 metricADFSExtranetAccountLockoutsTotal = "windows_adfs_extranet_account_lockouts_total" 22 metricADFSFederatedAuthenticationsTotal = "windows_adfs_federated_authentications_total" 23 metricADFSFederationMetadataRequestsTotal = "windows_adfs_federation_metadata_requests_total" 24 25 metricADFSOauthAuthorizationRequestsTotal = "windows_adfs_oauth_authorization_requests_total" 26 metricADFSOauthClientAuthenticationFailureTotal = "windows_adfs_oauth_client_authentication_failure_total" 27 metricADFSOauthClientAuthenticationSuccessTotal = "windows_adfs_oauth_client_authentication_success_total" 28 metricADFSOauthClientCredentialsFailureTotal = "windows_adfs_oauth_client_credentials_failure_total" 29 metricADFSOauthClientCredentialsSuccessTotal = "windows_adfs_oauth_client_credentials_success_total" 30 metricADFSOauthClientPrivKeyJTWAuthenticationFailureTotal = "windows_adfs_oauth_client_privkey_jtw_authentication_failure_total" 31 metricADFSOauthClientPrivKeyJWTAuthenticationSuccessTotal = "windows_adfs_oauth_client_privkey_jwt_authentications_success_total" 32 metricADFSOauthClientSecretBasicAuthenticationsFailureTotal = "windows_adfs_oauth_client_secret_basic_authentications_failure_total" 33 metricADFSADFSOauthClientSecretBasicAuthenticationsSuccessTotal = "windows_adfs_oauth_client_secret_basic_authentications_success_total" 34 metricADFSOauthClientSecretPostAuthenticationsFailureTotal = "windows_adfs_oauth_client_secret_post_authentications_failure_total" 35 metricADFSOauthClientSecretPostAuthenticationsSuccessTotal = "windows_adfs_oauth_client_secret_post_authentications_success_total" 36 metricADFSOauthClientWindowsAuthenticationsFailureTotal = "windows_adfs_oauth_client_windows_authentications_failure_total" 37 metricADFSOauthClientWindowsAuthenticationsSuccessTotal = "windows_adfs_oauth_client_windows_authentications_success_total" 38 metricADFSOauthLogonCertificateRequestsFailureTotal = "windows_adfs_oauth_logon_certificate_requests_failure_total" 39 metricADFSOauthLogonCertificateTokenRequestsSuccessTotal = "windows_adfs_oauth_logon_certificate_token_requests_success_total" 40 metricADFSOauthPasswordGrantRequestsFailureTotal = "windows_adfs_oauth_password_grant_requests_failure_total" 41 metricADFSOauthPasswordGrantRequestsSuccessTotal = "windows_adfs_oauth_password_grant_requests_success_total" 42 metricADFSOauthTokenRequestsSuccessTotal = "windows_adfs_oauth_token_requests_success_total" 43 44 metricADFSPassiveRequestsTotal = "windows_adfs_passive_requests_total" 45 metricADFSPasswortAuthenticationsTotal = "windows_adfs_passport_authentications_total" 46 metricADFSPasswordChangeFailedTotal = "windows_adfs_password_change_failed_total" 47 metricADFSWPasswordChangeSucceededTotal = "windows_adfs_password_change_succeeded_total" 48 metricADFSSamlpTokenRequestsSuccessTotal = "windows_adfs_samlp_token_requests_success_total" 49 metricADFSSSOAuthenticationsFailureTotal = "windows_adfs_sso_authentications_failure_total" 50 metricADFSSSOAuthenticationsSuccessTotal = "windows_adfs_sso_authentications_success_total" 51 metricADFSTokenRequestsTotal = "windows_adfs_token_requests_total" 52 metricADFSUserPasswordAuthenticationsFailureTotal = "windows_adfs_userpassword_authentications_failure_total" 53 metricADFSUserPasswordAuthenticationsSuccessTotal = "windows_adfs_userpassword_authentications_success_total" 54 metricADFSWindowsIntegratedAuthenticationsTotal = "windows_adfs_windows_integrated_authentications_total" 55 metricADFSWSFedTokenRequestsSuccessTotal = "windows_adfs_wsfed_token_requests_success_total" 56 metricADFSWSTrustTokenRequestsSuccessTotal = "windows_adfs_wstrust_token_requests_success_total" 57 ) 58 59 var adfsMetrics = []string{ 60 metricADFSADLoginConnectionFailuresTotal, 61 metricADFSCertificateAuthenticationsTotal, 62 metricADFSDBArtifactFailureTotal, 63 metricADFSDBArtifactQueryTimeSeconds, 64 metricADFSDBConfigFailureTotal, 65 metricADFSDBQueryTimeSecondsTotal, 66 metricADFSDeviceAuthenticationsTotal, 67 metricADFSExternalAuthenticationsFailureTotal, 68 metricADFSExternalAuthenticationsSuccessTotal, 69 metricADFSExtranetAccountLockoutsTotal, 70 metricADFSFederatedAuthenticationsTotal, 71 metricADFSFederationMetadataRequestsTotal, 72 metricADFSOauthAuthorizationRequestsTotal, 73 metricADFSOauthClientAuthenticationFailureTotal, 74 metricADFSOauthClientAuthenticationSuccessTotal, 75 metricADFSOauthClientCredentialsFailureTotal, 76 metricADFSOauthClientCredentialsSuccessTotal, 77 metricADFSOauthClientPrivKeyJTWAuthenticationFailureTotal, 78 metricADFSOauthClientPrivKeyJWTAuthenticationSuccessTotal, 79 metricADFSOauthClientSecretBasicAuthenticationsFailureTotal, 80 metricADFSADFSOauthClientSecretBasicAuthenticationsSuccessTotal, 81 metricADFSOauthClientSecretPostAuthenticationsFailureTotal, 82 metricADFSOauthClientSecretPostAuthenticationsSuccessTotal, 83 metricADFSOauthClientWindowsAuthenticationsFailureTotal, 84 metricADFSOauthClientWindowsAuthenticationsSuccessTotal, 85 metricADFSOauthLogonCertificateRequestsFailureTotal, 86 metricADFSOauthLogonCertificateTokenRequestsSuccessTotal, 87 metricADFSOauthPasswordGrantRequestsFailureTotal, 88 metricADFSOauthPasswordGrantRequestsSuccessTotal, 89 metricADFSOauthTokenRequestsSuccessTotal, 90 metricADFSPassiveRequestsTotal, 91 metricADFSPasswortAuthenticationsTotal, 92 metricADFSPasswordChangeFailedTotal, 93 metricADFSWPasswordChangeSucceededTotal, 94 metricADFSSamlpTokenRequestsSuccessTotal, 95 metricADFSSSOAuthenticationsFailureTotal, 96 metricADFSSSOAuthenticationsSuccessTotal, 97 metricADFSTokenRequestsTotal, 98 metricADFSUserPasswordAuthenticationsFailureTotal, 99 metricADFSUserPasswordAuthenticationsSuccessTotal, 100 metricADFSWindowsIntegratedAuthenticationsTotal, 101 metricADFSWSFedTokenRequestsSuccessTotal, 102 metricADFSWSTrustTokenRequestsSuccessTotal, 103 } 104 105 func (w *Windows) collectADFS(mx map[string]int64, pms prometheus.Series) { 106 if !w.cache.collection[collectorADFS] { 107 w.cache.collection[collectorADFS] = true 108 w.addADFSCharts() 109 } 110 111 for _, pm := range pms.FindByNames(adfsMetrics...) { 112 name := strings.TrimPrefix(pm.Name(), "windows_") 113 v := pm.Value 114 if strings.HasSuffix(name, "_seconds_total") { 115 v *= precision 116 } 117 mx[name] = int64(v) 118 } 119 }