Fixer of broken things
Maker of things that break
You can find my dumb ideas on https://tomczarniecki.com/blog/ and me lurking on Mastodon.
This is a simple service that scrapes metrics from OpenLDAP and exports them via HTTP for Prometheus consumption.
License: MIT License
Fixer of broken things
Maker of things that break
You can find my dumb ideas on https://tomczarniecki.com/blog/ and me lurking on Mastodon.
Would you be willing to publish your release to dockerhub or similar?
Instructions are here https://docs.github.com/en/actions/publishing-packages/publishing-docker-images
I am happy to help, but it relies on secrets and items out of the scope of submitting PRs
Alternatively, I'm happy for fork and publish an image.
Hello,
thank you very much for your exporter! I finally installed it on my primary OpenLDAP-server and have integrated it into Prometheus. Does somebody have a working Grafana dashboard and would like to add it here to a contrib folder? That would be really nice.
Thanks in advance.
Hi
Our company can only allow us to install golang package available in pkg.go.dev. I want to use this openldap exporter but i found the only available version in pkg.go.dev is [v0.0.0-20230326010953-24ad55465feb].
REF: https://pkg.go.dev/github.com/tomcz/openldap_exporter
Could you upload the latest stable version (v.2.2.2) to pkg.go.dev?
Thanks in advance.
May it be possible to implement TLS connection to OpenLdap server?
https://prometheus.io/docs/instrumenting/writing_exporters/#scheduling exposing metrics using internal scheduling is anti-pattern in prometheus, if we collect metrics when each scrape came in , these are the advantages:
up
metrics can be used to indicate whether the scrape is a success or a failure.there might be disadvantage: if collection of metrics is expensive, like it takes a minute or more to complete, this could be a problem, in which case, a pushgateway may be more suitable.
Hello,
$ ldapsearch -LLL -x -H ldaps://xxxx -b dc=datac,dc=xxx,dc=com -D uid=xxxxx -w xxxx -s base contextCSN
dn: dc=datac,dc=xxx,dc=com
contextCSN: 20230104171052.895118Z#000000#001#000000
contextCSN: 20230106202836.142061Z#000000#00b#000000
I'm running with -replicationObject "dc=datac,dc=xxx,dc=com"
parameter
And I'm getting this output from exporter:
$ curl -s http://localhost:9330/metrics | grep -v \# | grep replication
openldap_monitor_replication{id="001",type="count"} 0
openldap_monitor_replication{id="001",type="gt"} 1.672855957e+09
openldap_monitor_replication{id="001",type="mod"} 0
The questions are:
1-) I'm interested to get information about #00b#
and not #001#
is this possible?
2-) Is this graph the expected result?
expr sum(openldap_monitor_replication) by (instance, dn)>0
3-) The "count"
or "mod"
supposed to increase somehow?
4-) What the "gt"
metric means?
Thanks
WARN[0120] query failed component=scraper error="LDAP Result Code 1 "Operations Error": 000020D6: SvcErr: DSID-03100836, problem 5012 (DIR_ERROR), data 0\n\x00" filter="(objectClass=monitorOperation)"
Hello,
How --replicationObject is supposed to work ?
I made some try to monitor "dc=domain,dc=local" and I have the following error message
WARN[0030] query failed component=scraper error="LDAP Result Code 4 "Size Limit Exceeded": " filter="(objectClass=*)"
I understand the errror, but not the expected syntax
Best regards
Good morning,
Would you please consider to add support for web-config.yml?
https://github.com/prometheus/prometheus/blob/main/documentation/examples/web-config.yml
That would also enable basic auth and tls
Here is how it was done in another exporter: hikhvar/mqtt2prometheus@a25cf3f
Thank you !
Hi @tomcz,
I was taking a look at your exporter, and I am really interested in using it.
There is some issues I wanted to clarify before with you.
-interval duration
Scrape interval (default 30s)
Prometheus set this at the server-side, otherwise you have one LDAP scrape time locally, and one different by every prometheus scrape. I mean, you should be querying LDAP simultaneously when prometheus scrapes the exporter target.
~/code/src/app
instead of '~/'?If you agree with those changes, I can start making some PR.
Thanks!
❯ go install github.com/tomcz/openldap_exporter/cmd/openldap_exporter@latest
go: github.com/tomcz/openldap_exporter/cmd/openldap_exporter@latest (in github.com/tomcz/[email protected]):
The go.mod file for the module providing named packages contains one or
more replace directives. It must not contain directives that would cause
it to be interpreted differently than if it were the main module.
`
go install honnef.co/go/tools/cmd/staticcheck@latest
# honnef.co/go/tools/unused
/go/pkg/mod/honnef.co/go/[email protected]/unused/unused.go:419:14: obj.Origin undefined (type *types.Var has no field or method Origin)
/go/pkg/mod/honnef.co/go/[email protected]/unused/unused.go:421:14: obj.Origin undefined (type *types.Func has no field or method Origin)
note: module requires Go 1.19
# honnef.co/go/tools/staticcheck
/go/pkg/mod/honnef.co/go/[email protected]/staticcheck/lint.go:4025:29: righti.Method(i).Origin undefined (type *types.Func has no field or method Origin)
/go/pkg/mod/honnef.co/go/[email protected]/staticcheck/lint.go:4030:36: sel.Obj().(*types.Func).Origin undefined (type *types.Func has no field or method Origin)
note: module requires Go 1.19
make: *** [Makefile:33: lint] Error 2
go install honnef.co/go/tools/cmd/[email protected]
works
Hi!, i'm trying to get metrics about ldap replication, i use:
/usr/bin/openldap_exporter --config exporter.yaml --replicationObject "dc=my,dc=organization"
But my ldap DB it's quite big and i get:
WARN[0270] query failed component=scraper error="LDAP Result Code 4 \"Size Limit Exceeded\": " filter="(objectClass=*)"
Looking into the code i found this:
func (s *Scraper) addReplicationQueries() {
for _, q := range s.Sync {
queries = append(queries,
&query{
baseDN: q,
searchFilter: objectClass("*"),
searchAttr: monitorReplicationFilter,
metric: monitorReplicationGauge,
setData: setReplicationValue,
},
)
}
}
If i change:
searchFilter: objectClass("*"),
with
searchFilter: "(contextCSN=*)",
it works, so i'm trying to make a fork adding some parameters to override that but i don't know much about go.
So the question is: i'm using this exporter right?, or there is any other way to achieve this?
Release v2.1 adds support for unix socket connections, but this is not reflected in the documentation.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.