Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
fd78856c7b | |||
7408990a6e | |||
ba0c9a2323 |
@ -37,7 +37,7 @@ type Config struct {
|
|||||||
HTTPDPKIProxyConf string `fig:"httpd_pki_proxy_conf"`
|
HTTPDPKIProxyConf string `fig:"httpd_pki_proxy_conf"`
|
||||||
KInitBin string `fig:"kinit_bin"`
|
KInitBin string `fig:"kinit_bin"`
|
||||||
KListBin string `fig:"klist_bin"`
|
KListBin string `fig:"klist_bin"`
|
||||||
IPAGetCertBIN string `fig:"ipa_getcert_bin"`
|
GetCertBIN string `fig:"getcert_bin"`
|
||||||
}
|
}
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@ -167,7 +167,7 @@ func (a *App) ReadConfig() {
|
|||||||
HTTPDPKIProxyConf: "/etc/httpd/conf.d/ipa-pki-proxy.conf",
|
HTTPDPKIProxyConf: "/etc/httpd/conf.d/ipa-pki-proxy.conf",
|
||||||
KInitBin: "/usr/bin/kinit",
|
KInitBin: "/usr/bin/kinit",
|
||||||
KListBin: "/usr/bin/klist",
|
KListBin: "/usr/bin/klist",
|
||||||
IPAGetCertBIN: "/usr/bin/ipa-getcert",
|
GetCertBIN: "/usr/bin/getcert",
|
||||||
}
|
}
|
||||||
|
|
||||||
// Load configuration.
|
// Load configuration.
|
||||||
|
@ -200,8 +200,8 @@ func (e *FreeIPAExporter) certMongerCerts() ([]*CertMongerCerts, error) {
|
|||||||
requestRX := regexp.MustCompile(`Request ID '([A-Za-z0-9]+)':`)
|
requestRX := regexp.MustCompile(`Request ID '([A-Za-z0-9]+)':`)
|
||||||
keyValueRX := regexp.MustCompile(`\s([A-Za-z][A-Za-z- ]+): (.*)$`)
|
keyValueRX := regexp.MustCompile(`\s([A-Za-z][A-Za-z- ]+): (.*)$`)
|
||||||
|
|
||||||
// Setup the ipa-getcert list command.
|
// Setup the getcert list command.
|
||||||
cmd := exec.Command(app.config.IPAGetCertBIN, "list")
|
cmd := exec.Command(app.config.GetCertBIN, "list")
|
||||||
|
|
||||||
// Get the pipes.
|
// Get the pipes.
|
||||||
stdout, err := cmd.StdoutPipe()
|
stdout, err := cmd.StdoutPipe()
|
||||||
|
2
go.mod
2
go.mod
@ -6,7 +6,7 @@ require (
|
|||||||
github.com/antchfx/xmlquery v1.3.17
|
github.com/antchfx/xmlquery v1.3.17
|
||||||
github.com/go-ldap/ldap/v3 v3.4.5
|
github.com/go-ldap/ldap/v3 v3.4.5
|
||||||
github.com/gorilla/handlers v1.5.1
|
github.com/gorilla/handlers v1.5.1
|
||||||
github.com/grmrgecko/go-freeipa v0.0.0-20230814003934-9662b716120c
|
github.com/grmrgecko/go-freeipa v0.0.0-20240308202417-98de29c2fd81
|
||||||
github.com/grmrgecko/go-unixaccounts v0.0.0-20230814023229-86c46cf9fa3b
|
github.com/grmrgecko/go-unixaccounts v0.0.0-20230814023229-86c46cf9fa3b
|
||||||
github.com/influxdata/influxdb-client-go/v2 v2.12.3
|
github.com/influxdata/influxdb-client-go/v2 v2.12.3
|
||||||
github.com/influxdata/line-protocol/v2 v2.2.1
|
github.com/influxdata/line-protocol/v2 v2.2.1
|
||||||
|
4
go.sum
4
go.sum
@ -54,8 +54,8 @@ github.com/gorilla/securecookie v1.1.1 h1:miw7JPhV+b/lAHSXz4qd/nN9jRiAFV5FwjeKyC
|
|||||||
github.com/gorilla/securecookie v1.1.1/go.mod h1:ra0sb63/xPlUeL+yeDciTfxMRAA+MP+HVt/4epWDjd4=
|
github.com/gorilla/securecookie v1.1.1/go.mod h1:ra0sb63/xPlUeL+yeDciTfxMRAA+MP+HVt/4epWDjd4=
|
||||||
github.com/gorilla/sessions v1.2.1 h1:DHd3rPN5lE3Ts3D8rKkQ8x/0kqfeNmBAaiSi+o7FsgI=
|
github.com/gorilla/sessions v1.2.1 h1:DHd3rPN5lE3Ts3D8rKkQ8x/0kqfeNmBAaiSi+o7FsgI=
|
||||||
github.com/gorilla/sessions v1.2.1/go.mod h1:dk2InVEVJ0sfLlnXv9EAgkf6ecYs/i80K/zI+bUmuGM=
|
github.com/gorilla/sessions v1.2.1/go.mod h1:dk2InVEVJ0sfLlnXv9EAgkf6ecYs/i80K/zI+bUmuGM=
|
||||||
github.com/grmrgecko/go-freeipa v0.0.0-20230814003934-9662b716120c h1:i35K9mKZNYjj8A0kA/tMj0hh+Ms1V9O6x8MsYSb1Dvs=
|
github.com/grmrgecko/go-freeipa v0.0.0-20240308202417-98de29c2fd81 h1:22FQHx44AyR5vLybmjl5FuDu/Xj+jHZSZLaMPJvboNk=
|
||||||
github.com/grmrgecko/go-freeipa v0.0.0-20230814003934-9662b716120c/go.mod h1:bg9+b0lCJ2+XwgNfDOCG4gjMwsHH/nwTTKaYF/T3o/Q=
|
github.com/grmrgecko/go-freeipa v0.0.0-20240308202417-98de29c2fd81/go.mod h1:bg9+b0lCJ2+XwgNfDOCG4gjMwsHH/nwTTKaYF/T3o/Q=
|
||||||
github.com/grmrgecko/go-unixaccounts v0.0.0-20230814023229-86c46cf9fa3b h1:4twMmYqPkuqUobzM7GkHECiEu6SuH06xgKgHRiviZ2U=
|
github.com/grmrgecko/go-unixaccounts v0.0.0-20230814023229-86c46cf9fa3b h1:4twMmYqPkuqUobzM7GkHECiEu6SuH06xgKgHRiviZ2U=
|
||||||
github.com/grmrgecko/go-unixaccounts v0.0.0-20230814023229-86c46cf9fa3b/go.mod h1:ND6FYE0L6uFGxbi3A+pVpb9doB5mAUiFHjfYEDpHIHI=
|
github.com/grmrgecko/go-unixaccounts v0.0.0-20230814023229-86c46cf9fa3b/go.mod h1:ND6FYE0L6uFGxbi3A+pVpb9doB5mAUiFHjfYEDpHIHI=
|
||||||
github.com/hashicorp/go-hclog v1.4.0 h1:ctuWFGrhFha8BnnzxqeRGidlEcQkDyL5u8J8t5eA11I=
|
github.com/hashicorp/go-hclog v1.4.0 h1:ctuWFGrhFha8BnnzxqeRGidlEcQkDyL5u8J8t5eA11I=
|
||||||
|
@ -91,7 +91,7 @@ func (i *InfluxOutput) LineprotocolFormat(res []*io_prometheus_client.MetricFami
|
|||||||
|
|
||||||
// Get prefix for transforming prometheus name to influx.
|
// Get prefix for transforming prometheus name to influx.
|
||||||
namePrefix := namespace + "_"
|
namePrefix := namespace + "_"
|
||||||
enc.SetPrecision(lineprotocol.Microsecond)
|
enc.SetPrecision(lineprotocol.Nanosecond)
|
||||||
now := time.Now()
|
now := time.Now()
|
||||||
if !i.OverrideTimestamp.IsZero() {
|
if !i.OverrideTimestamp.IsZero() {
|
||||||
now = i.OverrideTimestamp
|
now = i.OverrideTimestamp
|
||||||
|
2
main.go
2
main.go
@ -15,7 +15,7 @@ import (
|
|||||||
const (
|
const (
|
||||||
serviceName = "freeipa-health-metrics"
|
serviceName = "freeipa-health-metrics"
|
||||||
serviceDescription = "Provides metrics of FreeIPA's health"
|
serviceDescription = "Provides metrics of FreeIPA's health"
|
||||||
serviceVersion = "0.1"
|
serviceVersion = "0.4"
|
||||||
namespace = "freeipa"
|
namespace = "freeipa"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -1,36 +1,36 @@
|
|||||||
freeipa,host=ipa1.example.com config_dna_range=1 1136214245000000
|
freeipa,host=ipa1.example.com config_dna_range=1 1136214245000000000
|
||||||
freeipa,host=ipa1.example.com config_ipa_ca_issued_cert=1 1136214245000000
|
freeipa,host=ipa1.example.com config_ipa_ca_issued_cert=1 1136214245000000000
|
||||||
freeipa,host=ipa1.example.com config_ipa_ca_issued_ldap_cert=0 1136214245000000
|
freeipa,host=ipa1.example.com config_ipa_ca_issued_ldap_cert=0 1136214245000000000
|
||||||
freeipa,host=ipa1.example.com config_ipa_cert_auto_renew=1 1136214245000000
|
freeipa,host=ipa1.example.com config_ipa_cert_auto_renew=1 1136214245000000000
|
||||||
freeipa,host=ipa1.example.com config_ipa_earliest_cert_expiry=2.639495644e+09 1136214245000000
|
freeipa,host=ipa1.example.com config_ipa_earliest_cert_expiry=2.639495644e+09 1136214245000000000
|
||||||
freeipa,host=ipa1.example.com config_krb5_auth=1 1136214245000000
|
freeipa,host=ipa1.example.com config_krb5_auth=1 1136214245000000000
|
||||||
freeipa,host=ipa1.example.com config_krb5_workers=0 1136214245000000
|
freeipa,host=ipa1.example.com config_krb5_workers=0 1136214245000000000
|
||||||
freeipa,host=ipa1.example.com config_ldap_cert_auto_renew=0 1136214245000000
|
freeipa,host=ipa1.example.com config_ldap_cert_auto_renew=0 1136214245000000000
|
||||||
freeipa,host=ipa1.example.com config_ldap_earliest_cert_expiry=0 1136214245000000
|
freeipa,host=ipa1.example.com config_ldap_earliest_cert_expiry=0 1136214245000000000
|
||||||
freeipa,host=ipa1.example.com config_proxy_secret=1 1136214245000000
|
freeipa,host=ipa1.example.com config_proxy_secret=1 1136214245000000000
|
||||||
freeipa,host=ipa1.example.com config_renewal_master=1 1136214245000000
|
freeipa,host=ipa1.example.com config_renewal_master=1 1136214245000000000
|
||||||
freeipa,host=ipa1.example.com failures_total=0 1136214245000000
|
freeipa,host=ipa1.example.com failures_total=0 1136214245000000000
|
||||||
freeipa,host=ipa1.example.com freeipa_failed_tests=1 1136214245000000
|
freeipa,host=ipa1.example.com freeipa_failed_tests=1 1136214245000000000
|
||||||
freeipa,host=ipa1.example.com ldap_certificate_total=0 1136214245000000
|
freeipa,host=ipa1.example.com ldap_certificate_total=0 1136214245000000000
|
||||||
freeipa,host=ipa1.example.com ldap_conflicts_total=0 1136214245000000
|
freeipa,host=ipa1.example.com ldap_conflicts_total=0 1136214245000000000
|
||||||
freeipa,host=ipa1.example.com ldap_dns_zone_total=0 1136214245000000
|
freeipa,host=ipa1.example.com ldap_dns_zone_total=0 1136214245000000000
|
||||||
freeipa,host=ipa1.example.com ldap_failures_total=0 1136214245000000
|
freeipa,host=ipa1.example.com ldap_failures_total=0 1136214245000000000
|
||||||
freeipa,host=ipa1.example.com ldap_ghost_replica_total=0 1136214245000000
|
freeipa,host=ipa1.example.com ldap_ghost_replica_total=0 1136214245000000000
|
||||||
freeipa,host=ipa1.example.com ldap_group_total=3 1136214245000000
|
freeipa,host=ipa1.example.com ldap_group_total=3 1136214245000000000
|
||||||
freeipa,host=ipa1.example.com ldap_hbac_rule_total=1 1136214245000000
|
freeipa,host=ipa1.example.com ldap_hbac_rule_total=1 1136214245000000000
|
||||||
freeipa,host=ipa1.example.com ldap_host_group_total=2 1136214245000000
|
freeipa,host=ipa1.example.com ldap_host_group_total=2 1136214245000000000
|
||||||
freeipa,host=ipa1.example.com ldap_host_total=4 1136214245000000
|
freeipa,host=ipa1.example.com ldap_host_total=4 1136214245000000000
|
||||||
freeipa,host=ipa1.example.com ldap_net_group_total=0 1136214245000000
|
freeipa,host=ipa1.example.com ldap_net_group_total=0 1136214245000000000
|
||||||
freeipa,host=ipa1.example.com,replica=ipa2.example.com ldap_replica_error_code=0 1136214245000000
|
freeipa,host=ipa1.example.com,replica=ipa2.example.com ldap_replica_error_code=0 1136214245000000000
|
||||||
freeipa,host=ipa1.example.com,replica=ipa3.example.com ldap_replica_error_code=0 1136214245000000
|
freeipa,host=ipa1.example.com,replica=ipa3.example.com ldap_replica_error_code=0 1136214245000000000
|
||||||
freeipa,host=ipa1.example.com,replica=ipa2.example.com ldap_replica_last_update=1.693362478e+09 1136214245000000
|
freeipa,host=ipa1.example.com,replica=ipa2.example.com ldap_replica_last_update=1.693362478e+09 1136214245000000000
|
||||||
freeipa,host=ipa1.example.com,replica=ipa3.example.com ldap_replica_last_update=1.693362636e+09 1136214245000000
|
freeipa,host=ipa1.example.com,replica=ipa3.example.com ldap_replica_last_update=1.693362636e+09 1136214245000000000
|
||||||
freeipa,host=ipa1.example.com ldap_scrapes_total=1 1136214245000000
|
freeipa,host=ipa1.example.com ldap_scrapes_total=1 1136214245000000000
|
||||||
freeipa,host=ipa1.example.com ldap_service_total=6 1136214245000000
|
freeipa,host=ipa1.example.com ldap_service_total=6 1136214245000000000
|
||||||
freeipa,host=ipa1.example.com ldap_sudo_rule_total=0 1136214245000000
|
freeipa,host=ipa1.example.com ldap_sudo_rule_total=0 1136214245000000000
|
||||||
freeipa,host=ipa1.example.com ldap_up=1 1136214245000000
|
freeipa,host=ipa1.example.com ldap_up=1 1136214245000000000
|
||||||
freeipa,host=ipa1.example.com ldap_user_active_total=7 1136214245000000
|
freeipa,host=ipa1.example.com ldap_user_active_total=7 1136214245000000000
|
||||||
freeipa,host=ipa1.example.com ldap_user_preserved_total=3 1136214245000000
|
freeipa,host=ipa1.example.com ldap_user_preserved_total=3 1136214245000000000
|
||||||
freeipa,host=ipa1.example.com ldap_user_stage_total=1 1136214245000000
|
freeipa,host=ipa1.example.com ldap_user_stage_total=1 1136214245000000000
|
||||||
freeipa,host=ipa1.example.com scrapes_total=1 1136214245000000
|
freeipa,host=ipa1.example.com scrapes_total=1 1136214245000000000
|
||||||
freeipa,host=ipa1.example.com up=1 1136214245000000
|
freeipa,host=ipa1.example.com up=1 1136214245000000000
|
||||||
|
@ -27,4 +27,4 @@ pki_tomcat_server_xml: test/server.xml
|
|||||||
httpd_pki_proxy_conf: test/ipa-pki-proxy.conf
|
httpd_pki_proxy_conf: test/ipa-pki-proxy.conf
|
||||||
kinit_bin: test/kinit
|
kinit_bin: test/kinit
|
||||||
klist_bin: test/klist
|
klist_bin: test/klist
|
||||||
ipa_getcert_bin: test/ipa-getcert
|
getcert_bin: test/getcert
|
||||||
|
Loading…
x
Reference in New Issue
Block a user