Is that possible for prometheus to combine with CMDB

464 views
Skip to first unread message

anton...@gmail.com

unread,
Jul 19, 2018, 9:52:21 PM7/19/18
to Prometheus Users
In prometheus ,it is a little difficult for us to make the label_join and so on , so we build our own cmdb , is that possible to combine them ? is there anyone did that before

Matthias Rampke

unread,
Jul 20, 2018, 3:28:30 AM7/20/18
to anton...@gmail.com, Prometheus Users
If you write out target configuration (or just target lists for file service discovery) you can attach any labels you want based on your CMDB. Is that what you want? Can you explain a bit more about what you are trying to achieve?

/MR

On Fri, Jul 20, 2018, 03:52 <anton...@gmail.com> wrote:
In prometheus ,it is a little difficult for us to make the label_join and so on , so we build our own cmdb , is that possible to combine them ? is there anyone did that before

--
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-use...@googlegroups.com.
To post to this group, send email to promethe...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/922b08c1-04a8-4546-955e-efb34d99162d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

anton...@gmail.com

unread,
Jul 20, 2018, 5:27:37 AM7/20/18
to Prometheus Users
Thanks   Matthias
In our environment the current configuration is like what you said, all the targets are in our files.
what i want is a function like join in sql.
For example , now we are using snmp monitor our network devices, we can only get individual information from each snmp oid ,  i have a metric  with the format a{targetip="1.1.1.1",instance='2.2.2.2'} 1
If a.value==0 means the connection between 2.2.2.2 and 1.1.1.1 is down,  but if i have the cmdb , i can make the alert like " the connection between M and N is down",instead of the ip .
,
    在 2018年7月20日星期五 UTC+8下午3:28:30,Matthias Rampke写道:
Message has been deleted

Christian Hoffmann

unread,
Jul 22, 2018, 2:19:52 PM7/22/18
to anton...@gmail.com, Prometheus Users
On 07/20/2018 11:27 AM, anton...@gmail.com wrote:
> *In our environment the current configuration is like what you said, all
> the targets are in our files.*
> *what i want is a function like join in sql.*
> *For example , now we are using snmp monitor our network devices, we can
> only get individual information from each snmp oid ,  i have a metric 
> with the format a{targetip="1.1.1.1",instance='2.2.2.2'} 1*
> *If a.value==0 means the connection between 2.2.2.2 and 1.1.1.1 is
> down,  but if i have the cmdb , i can make the alert like " the
> connection between M and N is down",instead of the ip .*

I think there is no generic way to provide a reverse lookup for
something like that.

The following ideas come to mind, however:

Start by storing this mapping data in Prometheus using recording rules
as mentioned in this blog post [1]. You would then have some metric such as
ip2name{ip="1.1.1.1",name="example"} 1
...

Then you can either directly "join" these in your alert expressions as
described in the blog post [1]. In this case, I think, this would be
rather verbose, especially since labels differ (ip, targetip, instance).

Another option -- probably preferrable -- would be to run a sub-query in
your alert template [2].

Does that help?

Kind regards,
Christian

[1] https://www.robustperception.io/using-time-series-as-alert-thresholds
[2]
https://prometheus.io/docs/prometheus/latest/configuration/template_reference/#queries

anton...@gmail.com

unread,
Jul 22, 2018, 10:25:53 PM7/22/18
to Prometheus Users
It's been a big help ,thanks so much

在 2018年7月20日星期五 UTC+8上午9:52:21,anton...@gmail.com写道:
Reply all
Reply to author
Forward
0 new messages