mirror of
https://github.com/prometheus/node_exporter.git
synced 2024-12-28 06:59:44 -08:00
Signed-off-by: Li Ling <liiling@google.com>
This commit is contained in:
parent
f0332993ef
commit
a26ffaf4f8
|
@ -51,14 +51,14 @@ func (c *conntrackCollector) Update(ch chan<- prometheus.Metric) error {
|
||||||
value, err := readUintFromFile(procFilePath("sys/net/netfilter/nf_conntrack_count"))
|
value, err := readUintFromFile(procFilePath("sys/net/netfilter/nf_conntrack_count"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
// Conntrack probably not loaded into the kernel.
|
// Conntrack probably not loaded into the kernel.
|
||||||
return nil
|
return err
|
||||||
}
|
}
|
||||||
ch <- prometheus.MustNewConstMetric(
|
ch <- prometheus.MustNewConstMetric(
|
||||||
c.current, prometheus.GaugeValue, float64(value))
|
c.current, prometheus.GaugeValue, float64(value))
|
||||||
|
|
||||||
value, err = readUintFromFile(procFilePath("sys/net/netfilter/nf_conntrack_max"))
|
value, err = readUintFromFile(procFilePath("sys/net/netfilter/nf_conntrack_max"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil
|
return err
|
||||||
}
|
}
|
||||||
ch <- prometheus.MustNewConstMetric(
|
ch <- prometheus.MustNewConstMetric(
|
||||||
c.limit, prometheus.GaugeValue, float64(value))
|
c.limit, prometheus.GaugeValue, float64(value))
|
||||||
|
|
Loading…
Reference in a new issue