[prometheus-users] Hashmod
Hello Team, Can we use Hashmod on http_sd_configs ? I added my target from cmdb. But i want to set autoscalling on targets. Like 1st 1500 hosts added on prometheus 1 then next 1500 added on 2nd prometheus. Can someone guide me how to do that? Thanks and regards Ritesh Patel -- You received this message because you are subscribed to the Google Groups "Prometheus Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/CAPxUNF_riA_673bQ5Pn-DLrwFM_UNjzUs4uqOs-VC66R6tjjKg%40mail.gmail.com.
[prometheus-users] Re: prometheus up query
up{instance=~"$instance"} offset 7d == 0 # servers which were down at a single instant of time exactly 7 days ago max_over_time(up{instance=~"$instance"}[7d]) == 0# servers which have been down *for the whole* of the last 7 days min_over_time(up{instance=~"$instance"}[7d]) == 0# servers which have been down *at any time* over the last 7 days avg_over_time(up{instance=~"$instance"}[7d]) < 0.9 # servers which have been down *for at least 10%* of the last 7 days On Friday, 29 July 2022 at 04:11:22 UTC+1 seshaku...@gmail.com wrote: > Hello all, > > I installed node exporter on 10 servers. among those servers few servers > are down. I want to know which servers are down from last 7 days. > > up{instance=~"$instance"} == 0 (this is the query to find which server was > down) but how can i pass the time like last 7 days which server was down > and so on > > Any leads? > > Thanks, > kumari. > -- You received this message because you are subscribed to the Google Groups "Prometheus Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/8e15c5cc-7f0a-471b-b3a9-f470ec85efacn%40googlegroups.com.
Re: [prometheus-users] LDAP monitoring
If node exporter is running in k8s, and I started a container in the k8s cluster to configure textfile collector. With this way, is there any different with textfile collector configured on a server? In order to get the .prom file, what should I do in k8s cluster? On Friday, July 29, 2022 at 10:45:24 AM UTC+8 nina guo wrote: > Thank you very much for your detailed guidance Michael. I will continue to > investigate. > > Many thanks for your continuous help Brian. > > On Thursday, July 28, 2022 at 4:51:32 PM UTC+8 Michael Ströder wrote: > >> On 7/28/22 05:56, nina guo wrote: >> > I want to compare the value of contextCSN from each ldap server. >> >> You seem to be using OpenLDAP. >> >> Note that contextCSN values have to be compared pair-wise distinguished >> by serverID. >> >> The OpenMetrics output of my slapdcheck [1] is still not really nice >> because it's mainly a compat wrapper around the legacy monitoring data. >> But you can query the metrics and it already does the pair-wise >> contextCSN comparison. >> >> I usually invoke slapdcheck as systemd one-shot service [2] triggered by >> a systemd timer unit [3] and let it write the output to a file to be >> collected by node-exporter's text-file collector. (The caveat is that >> the metrics time is not the same like the collect time.) >> >> BTW: I find it also useful to let mtail extract some other metrics from >> OpenLDAP stats log level messages [4]. Beware the example adds client IP >> addresses to labels which can lead to time-series explosion if you have >> many LDAP clients from different IP addresses. Adapt it to your needs. >> >> [1] https://code.stroeder.com/ldap/slapdcheck >> >> [2] >> >> https://code.stroeder.com/AE-DIR/ansible-ae-dir-server/src/branch/main/templates/systemd/slapdcheck.service.j2 >> >> >> [3] >> >> https://code.stroeder.com/AE-DIR/ansible-ae-dir-server/src/branch/main/templates/systemd/slapdcheck.timer.j2 >> >> >> [4] >> >> https://code.stroeder.com/AE-DIR/ansible-ae-dir-server/src/branch/main/templates/mtail/ae-slapd.mtail.j2 >> >> >> Ciao, Michael. >> > -- You received this message because you are subscribed to the Google Groups "Prometheus Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/7093d518-38d7-481e-bdea-42ed85c4b388n%40googlegroups.com.
[prometheus-users] prometheus up query
Hello all, I installed node exporter on 10 servers. among those servers few servers are down. I want to know which servers are down from last 7 days. up{instance=~"$instance"} == 0 (this is the query to find which server was down) but how can i pass the time like last 7 days which server was down and so on Any leads? Thanks, kumari. -- You received this message because you are subscribed to the Google Groups "Prometheus Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/566e689c-3e25-4b71-ba00-9b5df603a87dn%40googlegroups.com.
[prometheus-users] prometheus up query
Hello all, I had installed node exporter in 10 servers. But, among these servers few servers are not reachable from some days. I want to know which servers are down from last 7 days UP{instance=~"instance"} ==0 will give the servers which are down. But how to give days in the command? Any leads? Thanks. -- You received this message because you are subscribed to the Google Groups "Prometheus Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/7de6b46d-14f1-4deb-8b90-639ca2d9bc12n%40googlegroups.com.
Re: [prometheus-users] LDAP monitoring
Thank you very much for your detailed guidance Michael. I will continue to investigate. Many thanks for your continuous help Brian. On Thursday, July 28, 2022 at 4:51:32 PM UTC+8 Michael Ströder wrote: > On 7/28/22 05:56, nina guo wrote: > > I want to compare the value of contextCSN from each ldap server. > > You seem to be using OpenLDAP. > > Note that contextCSN values have to be compared pair-wise distinguished > by serverID. > > The OpenMetrics output of my slapdcheck [1] is still not really nice > because it's mainly a compat wrapper around the legacy monitoring data. > But you can query the metrics and it already does the pair-wise > contextCSN comparison. > > I usually invoke slapdcheck as systemd one-shot service [2] triggered by > a systemd timer unit [3] and let it write the output to a file to be > collected by node-exporter's text-file collector. (The caveat is that > the metrics time is not the same like the collect time.) > > BTW: I find it also useful to let mtail extract some other metrics from > OpenLDAP stats log level messages [4]. Beware the example adds client IP > addresses to labels which can lead to time-series explosion if you have > many LDAP clients from different IP addresses. Adapt it to your needs. > > [1] https://code.stroeder.com/ldap/slapdcheck > > [2] > > https://code.stroeder.com/AE-DIR/ansible-ae-dir-server/src/branch/main/templates/systemd/slapdcheck.service.j2 > > [3] > > https://code.stroeder.com/AE-DIR/ansible-ae-dir-server/src/branch/main/templates/systemd/slapdcheck.timer.j2 > > [4] > > https://code.stroeder.com/AE-DIR/ansible-ae-dir-server/src/branch/main/templates/mtail/ae-slapd.mtail.j2 > > Ciao, Michael. > -- You received this message because you are subscribed to the Google Groups "Prometheus Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/3d268f19-420a-4e6d-b63a-084acb545a57n%40googlegroups.com.
[prometheus-users] Re: group alert repeat send
If you want the alerts to be sent separately, then don't group them. On Thursday, 28 July 2022 at 12:45:58 UTC+1 byk...@gmail.com wrote: > Hi all, there is some question for me. > The alerts under the group have been sent, and the previous alerts will > be sent together after a new alert is generated. How to control that only > the new alert will be sent? > -- You received this message because you are subscribed to the Google Groups "Prometheus Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/beb3ea42-95eb-4a0d-bd9d-cdb223e802fcn%40googlegroups.com.
Re: [prometheus-users] deactive alert after hook
Events are not metrics. For the behaviour you want, you should be looking at an event-based system like Loki. On Thursday, 28 July 2022 at 12:14:39 UTC+1 ariap...@gmail.com wrote: > Hello Stuart > I'm sorry I couldn't ask my question properly > Actually, I use prometheus/alertmanager as an event pipeline to alert > every event that occurs. > > For example, I show two of the rules that are exported from the log > exporter service: > - name: plate > rules: > - alert: "plate" > expr: 'plate_log {plate_number="123456877Lay"}' > for: 1s > annotations: > title: "plate detection {{ $labels.model_camera_id }}" > description: "plate detection with confidence : {{ > $labels.confidence }} " > labels: > severity: "critical" > type: "plate" > > - name: human > rules: > - alert: "human" > expr: 'number_of_Human > 15' > for: 1s > annotations: > title: "human detection {{ $labels.model_camera_id }}" > description: "human detection with confidence : {{ > $labels.confidence }} " > labels: > severity: "critical" > type: "human" > > > Also, the alertmanager configuration is as follows: > > global: > > route: > receiver: webhook > group_by: ["alertname"] > group_wait: 1s > group_interval: 1s > # repeat_interval: 6d > routes: > - receiver: webhook > continue: true > Receivers: > - name: webhook > webhook_configs: > - send_resolved: false > http_config: {} > url: "http://192.168.10.20:7000/visual"; > max_alerts: 0 > - url: "http://192.168.10.20:9200/alerts/_doc"; > send_resolved: false > > My problem is exactly that if 5 alerts are hooked at different times, for > the sixth log, all the previous 5 logs are also hooked. > I felt that because the logs are still in firing mode after the hook, they > are sent again to Front and Elastic with new logs. > > Stuart Clark در تاریخ یکشنبه ۲۴ ژوئیهٔ ۲۰۲۲ ساعت ۱۹:۵۹:۳۵ (UTC+4:30) نوشت: > >> On 24/07/2022 11:10, Milad Devops wrote: >> > hi all >> > I use Prometheus to create alert rules and hook alerts using >> alertmanager. >> > My scenario is as follows: >> > - The log publishing service sends logs to Prometheus Exporter >> > - Prometheus takes the logs every second and matches them with our >> rules >> > - If the log applies to our rules, the alertmanager sends an alert to >> > the frontend application. It also saves the alert in the elastic >> > >> > My problem is that when sending each alert, all the previous alerts >> > are also stored in Elastic in the form of a single log and sent to my >> > front service as a notification (web hook). >> > >> > Is there a way I can change the alert status to resolved after the >> > hook so that it won't be sent again on subsequent hooks? >> > Or delete the previous logs completely after the hook from Prometheus >> > Or any other suggested way you have >> > Thank you in advance >> >> I'm not sure I really understand what you are asking due to your >> mentioning of logs. >> >> Are you saying that you are using an exporter (for example mtail) which >> is consuming logs and then generating metrics? >> >> When you create an alerting rule in Prometheus it performs the PromQL >> query given, and if there are any results an alert is fired. Once the >> PromQL query stops returning results (or has a different set of time >> series being returned) the alert is resolved. >> >> So for example if you had a simple query that said "alert if the number >> of error logs [stored in a counter metric] increases by 5 or more in the >> last 5 minutes" as soon as the metric returned an increase of at least 5 >> over the last 5 minutes it would fire. It would then continue to fire >> until that is no longer true - so if the counter kept recording error >> log lines such that the increase was still over 5 per 5 minutes it would >> keep firing. It would only resolve once there were no more than 5 new >> long lines recorded over the past 5 minutes. >> >> Alertmanager just routes alerts that are generated within Prometheus to >> other notification/processing systems, such as email or webhooks. It >> would normally fire the webhook once the alert starts firing, and then >> periodically (if it keeps firing, at a configurable interval) and then >> finally (optionally) once it resolves. This is a one-way process - >> nothing about the notification has any impact on the alert firing or >> not. Only the PromQL query controls the alert. >> >> I'm not sure if that helps. >> >> -- >> Stuart Clark >> >> -- You received this message because you are subscribed to the Google Groups "Prometheus Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/59
[prometheus-users] Is auth needed for remote write receiver
Hello all Want to configure a local prometheus(prom1) remote write to another prometheus instance(prom2). But looks there is no clear configuration example I can find. I can see the 401 Unauthorized error from prom1 but I actually did not enable the auth in prom2, which is behind the apache server with https. I just added remote write *url* config in prom1 and enabled *remote-write-receiver* in prom2, Wonder maybe something is missing here? Really appreciate your help! -- You received this message because you are subscribed to the Google Groups "Prometheus Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/ccea1935-4ed8-45dc-9697-dbc4311ef9e2n%40googlegroups.com.
[prometheus-users] group alert repeat send
Hi all, there is some question for me. The alerts under the group have been sent, and the previous alerts will be sent together after a new alert is generated. How to control that only the new alert will be sent? -- You received this message because you are subscribed to the Google Groups "Prometheus Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/2dea5cfd-b033-4ce5-b0e6-8af439be05b6n%40googlegroups.com.
[prometheus-users] Postgres Exporter not appearing in Prometheus Targets
Hi guys, I've been messing for a couple of days now with this issue and I can't seem to figure it out. Maybe a bug maybe something is off, I'm not sure. *What did you do?* I installed prometheus-operator via helm. Afterwards I installed postgres_exporter via helm with these values: serviceMonitor: enabled: true namespace: monitoring-dev labels: release: prometheus telemetryPath: /metrics config: datasource: # Specify one of both datasource or datasourceSecret host: user: # Only one of password, passwordSecret and pgpassfile can be specified password: port: "" database: '' sslmode: disable extraParams: '' service: type: ClusterIP port: 80 targetPort: 9187 name: http labels: release: prometheus annotations: {} I also tried to check the labels and annotations from other servicemonitors to see if everything checks, but still this exporter isn't showing in my targets list? Is this a bug or perhaps I'm doing something wrong. Thanks in advance! -- You received this message because you are subscribed to the Google Groups "Prometheus Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/db59a3f8-99cf-4eaa-b8b8-9466f8600f46n%40googlegroups.com.
Re: [prometheus-users] deactive alert after hook
Hello Stuart I'm sorry I couldn't ask my question properly Actually, I use prometheus/alertmanager as an event pipeline to alert every event that occurs. For example, I show two of the rules that are exported from the log exporter service: - name: plate rules: - alert: "plate" expr: 'plate_log {plate_number="123456877Lay"}' for: 1s annotations: title: "plate detection {{ $labels.model_camera_id }}" description: "plate detection with confidence : {{ $labels.confidence }} " labels: severity: "critical" type: "plate" - name: human rules: - alert: "human" expr: 'number_of_Human > 15' for: 1s annotations: title: "human detection {{ $labels.model_camera_id }}" description: "human detection with confidence : {{ $labels.confidence }} " labels: severity: "critical" type: "human" Also, the alertmanager configuration is as follows: global: route: receiver: webhook group_by: ["alertname"] group_wait: 1s group_interval: 1s # repeat_interval: 6d routes: - receiver: webhook continue: true Receivers: - name: webhook webhook_configs: - send_resolved: false http_config: {} url: "http://192.168.10.20:7000/visual"; max_alerts: 0 - url: "http://192.168.10.20:9200/alerts/_doc"; send_resolved: false My problem is exactly that if 5 alerts are hooked at different times, for the sixth log, all the previous 5 logs are also hooked. I felt that because the logs are still in firing mode after the hook, they are sent again to Front and Elastic with new logs. Stuart Clark در تاریخ یکشنبه ۲۴ ژوئیهٔ ۲۰۲۲ ساعت ۱۹:۵۹:۳۵ (UTC+4:30) نوشت: > On 24/07/2022 11:10, Milad Devops wrote: > > hi all > > I use Prometheus to create alert rules and hook alerts using > alertmanager. > > My scenario is as follows: > > - The log publishing service sends logs to Prometheus Exporter > > - Prometheus takes the logs every second and matches them with our rules > > - If the log applies to our rules, the alertmanager sends an alert to > > the frontend application. It also saves the alert in the elastic > > > > My problem is that when sending each alert, all the previous alerts > > are also stored in Elastic in the form of a single log and sent to my > > front service as a notification (web hook). > > > > Is there a way I can change the alert status to resolved after the > > hook so that it won't be sent again on subsequent hooks? > > Or delete the previous logs completely after the hook from Prometheus > > Or any other suggested way you have > > Thank you in advance > > I'm not sure I really understand what you are asking due to your > mentioning of logs. > > Are you saying that you are using an exporter (for example mtail) which > is consuming logs and then generating metrics? > > When you create an alerting rule in Prometheus it performs the PromQL > query given, and if there are any results an alert is fired. Once the > PromQL query stops returning results (or has a different set of time > series being returned) the alert is resolved. > > So for example if you had a simple query that said "alert if the number > of error logs [stored in a counter metric] increases by 5 or more in the > last 5 minutes" as soon as the metric returned an increase of at least 5 > over the last 5 minutes it would fire. It would then continue to fire > until that is no longer true - so if the counter kept recording error > log lines such that the increase was still over 5 per 5 minutes it would > keep firing. It would only resolve once there were no more than 5 new > long lines recorded over the past 5 minutes. > > Alertmanager just routes alerts that are generated within Prometheus to > other notification/processing systems, such as email or webhooks. It > would normally fire the webhook once the alert starts firing, and then > periodically (if it keeps firing, at a configurable interval) and then > finally (optionally) once it resolves. This is a one-way process - > nothing about the notification has any impact on the alert firing or > not. Only the PromQL query controls the alert. > > I'm not sure if that helps. > > -- > Stuart Clark > > -- You received this message because you are subscribed to the Google Groups "Prometheus Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/d68448de-7a30-469c-bb7c-38b2720c213fn%40googlegroups.com.
[prometheus-users] Re: Grafana templating with prometheus
This is a discussion group for Prometheus, so questions about Grafana would be best directed to the Grafana community: https://community.grafana.com/ In any case, you haven't shown exactly what you've tried to do. I do know there are special template queries for Grafana variables. Here are a couple of examples I've pulled from a local dashboard: Name: instance Type: Query Data source: prometheus Query: *label_values(ifOperStatus, instance)* Name: ifName Type: Query Data source: prometheus Query: *query_result(ifOperStatus{instance="$instance"})* Regex: /.*ifName="([^"]+)".*/ I would have thought you could use *query_result(up==0)*, since that's a valid PromQL query, and you could pull out the label you want (e.g. instance) using a Regex as shown. But if that doesn't work, then please ask on a Grafana forum. On Thursday, 28 July 2022 at 08:08:47 UTC+1 chembakay...@gmail.com wrote: > Hi all, > > In grafana dashboard I want to create a template variable. > > up==0 so that this will give the info which instances are down. > > but while declaring up==0, I am getting an error like you should not use > operators while declaring grafana templates. > > Is there anyway to declare? > > Thanks & regards, > Bharath Kumar. > -- You received this message because you are subscribed to the Google Groups "Prometheus Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/4d3bc98e-c931-47a0-beba-e576d153dde4n%40googlegroups.com.
Re: [prometheus-users] LDAP monitoring
On 7/28/22 05:56, nina guo wrote: I want to compare the value of contextCSN from each ldap server. You seem to be using OpenLDAP. Note that contextCSN values have to be compared pair-wise distinguished by serverID. The OpenMetrics output of my slapdcheck [1] is still not really nice because it's mainly a compat wrapper around the legacy monitoring data. But you can query the metrics and it already does the pair-wise contextCSN comparison. I usually invoke slapdcheck as systemd one-shot service [2] triggered by a systemd timer unit [3] and let it write the output to a file to be collected by node-exporter's text-file collector. (The caveat is that the metrics time is not the same like the collect time.) BTW: I find it also useful to let mtail extract some other metrics from OpenLDAP stats log level messages [4]. Beware the example adds client IP addresses to labels which can lead to time-series explosion if you have many LDAP clients from different IP addresses. Adapt it to your needs. [1] https://code.stroeder.com/ldap/slapdcheck [2] https://code.stroeder.com/AE-DIR/ansible-ae-dir-server/src/branch/main/templates/systemd/slapdcheck.service.j2 [3] https://code.stroeder.com/AE-DIR/ansible-ae-dir-server/src/branch/main/templates/systemd/slapdcheck.timer.j2 [4] https://code.stroeder.com/AE-DIR/ansible-ae-dir-server/src/branch/main/templates/mtail/ae-slapd.mtail.j2 Ciao, Michael. -- You received this message because you are subscribed to the Google Groups "Prometheus Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/6ae200cf-441c-eecb-ec60-c7ae9181d94f%40stroeder.com.
[prometheus-users] Re: LDAP monitoring
On 7/28/22 09:02, Brian Candler wrote: > I want to compare the value of contextCSN from each ldap server. If you know a specific value of contextCSN that you're looking for, then you can put it in a label, and your alerting expression can check for the absence of a timeseries: expr: absent(foo{instance="bar",contextCSN="abcd1234"}) OpenLDAP's contextCSN values change a lot for each write operation to one of the provider replicas. From my understanding putting these values in labels would create a new time-series all the time you write to your OpenLDAP servers. Or maybe I did not really get your idea. Ciao, Michael. -- You received this message because you are subscribed to the Google Groups "Prometheus Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/7127d1b4-c157-0d41-96fc-d2c9a9e94211%40stroeder.com.
[prometheus-users] Grafana templating with prometheus
Hi all, In grafana dashboard I want to create a template variable. up==0 so that this will give the info which instances are down. but while declaring up==0, I am getting an error like you should not use operators while declaring grafana templates. Is there anyway to declare? Thanks & regards, Bharath Kumar. -- You received this message because you are subscribed to the Google Groups "Prometheus Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/65c13a4f-089d-4a1e-9726-ccbaca63010bn%40googlegroups.com.
[prometheus-users] Re: LDAP monitoring
On Thursday, 28 July 2022 at 06:43:09 UTC+1 ninag...@gmail.com wrote: > And one more question is , I already have node exporter to scrape target > group A, but I only want to monitor ldap on ldap servers which are in group > A, can I implement this with textfile collector? Is textfile colloector > share the same target files with node exporter? > textfile collector is one of the (many) collectors which are parts of node_exporter. Any single scrape of node_exporter will return *all* metrics from *all* enabled collectors on that node. Therefore, if you have a scrape job which scrapes node_exporter, then you'll get textfile collector results from all of those nodes - at least, those which have the --collector.textfile.directory flag set. -- You received this message because you are subscribed to the Google Groups "Prometheus Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/50b61fa4-a505-4f20-b7e1-38f25f0b08e5n%40googlegroups.com.
[prometheus-users] Re: LDAP monitoring
> I want to compare the value of contextCSN from each ldap server. If you know a specific value of contextCSN that you're looking for, then you can put it in a label, and your alerting expression can check for the absence of a timeseries: expr: absent(foo{instance="bar",contextCSN="abcd1234"}) Otherwise, the way blackbox_exporter deals with this is to put a *hash* of the IP address as a numeric metric. # curl -g 'localhost:9115/probe?module=smtp_starttls&target=aspmx.l.google.com:25' ... # HELP probe_ip_addr_hash Specifies the hash of IP address. It's useful to detect if the IP address changes. # TYPE probe_ip_addr_hash gauge probe_ip_addr_hash 2.75148e+09 The hash by itself is not meaningful, but it can be compared with previous values of the hash to see if the IP address changes. You could do the same thing for contextCSN. On Thursday, 28 July 2022 at 04:56:56 UTC+1 ninag...@gmail.com wrote: > Hi dears > > I want to compare the value of contextCSN from each ldap server. > > contextCSN can be obtained with ldapsearch command. > contextCSN=$(echo $ldap_search_result | grep contextCSN | awk '{ print $2 > }') > > May I ask if it is possible to compare the value? > -- You received this message because you are subscribed to the Google Groups "Prometheus Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/40b428c2-8ccd-427a-a859-01022b99b456n%40googlegroups.com.