gen2brain / keepalived_exporter Goto Github PK
View Code? Open in Web Editor NEWKeepalived Prometheus Exporter
License: Apache License 2.0
Keepalived Prometheus Exporter
License: Apache License 2.0
I'm running keepalived v1.3.5-6 on CentOS 7.6.1810 and the latest version of exporter with no extra options.
Exporter parses stats file perfectly, but fails to parse data file.
Here is an example of /tmp/keepalived.data
file head:
------< VRRP Topology >------
VRRP Instance = foo
VRRP Version = 2
State = MASTER
Last transition = 1582118865 (Wed Feb 19 13:27:45 2020)
Listening device = ens192
Using src_ip = 10.0.0.1
Gratuitous ARP delay = 5
Gratuitous ARP repeat = 5
...
Looks like the line containing VRRP version prevents exporter from parsing data since the line looks like the beginning of the new block of data.
An error has occurred while serving metrics:
440 error(s) occurred:
is there a dashboard for grafana?
We have multiple instance in our prod, and not built with any extra flags.
Any workaround?
keepalived_exporter: destinations: parseIP Error ip=[192 168 1 10 0 0 0 0 0 0 0 0 0 0 0 0]
/etc/redhat-release
CentOS Linux release 7.5 and CentOS Linux release 7.7
我的场景是keepalived非抢占式,两边都是backup,我应该用什么指标来判断vip漂移,然后报警出来
If I run it as a non root user, I get this error
prometheus-keepalived-exporter[14775]: time="2022-05-31T10:21:39Z" level=error msg="Could not get ipvs family information from the kernel. It is possible that ipvs is not enabled in your kernel. Native loadbalancing will not work until this is fixed."
prometheus-keepalived-exporter[14775]: time="2022-05-31T10:21:39Z" level=warning msg="Running modprobe ip_vs failed with message: `modprobe: ERROR: could not insert 'ip_vs': Operation not permitted\ninsmod /lib/modules/4.19.0-16-amd64/kernel/lib/libcrc32c.ko`, error: exit status 1"
And the only metric returned is
keepalived_up 0
If I run it as "root" instead, the exporter works just fine. But obviously I don't wanna run it as root...
I think that the exporter should not try to use "insmod", maybe just log the missing module and exit. Whoever is installing the exporter will ensure that the required module is present before running it.
I run KA on CentOS on the bare metal.
I want to run keepalived_exporter in docker like node_exporter.
Does it support?
This is my attempt.
cat /etc/redhat-release
CentOS Linux release 7.6.1810 (Core)
keepalived -v
Keepalived v1.3.5 (03/19,2017), git commit v1.3.5-6-g6fa32f2
Copyright(C) 2001-2017 Alexandre Cassen, <[email protected]>
Build options: PIPE2 LIBNL3 RTA_ENCAP RTA_EXPIRES RTA_PREF FRA_OIFNAME FRA_SUPPRESS_PREFIXLEN FRA_TUN_ID RTAX_CC_ALGO RTAX_QUICKACK LIBIPTC LIBIPSET_DYNAMIC LVS LIBIPVS_NETLINK VRRP VRRP_AUTH VRRP_VMAC SOCK_NONBLOCK SOCK_CLOEXEC FIB_ROUTING INET6_ADDR_GEN_MODE SNMP_V3_FOR_V2 SNMP SNMP_KEEPALIVED SNMP_CHECKER SNMP_RFC SNMP_RFCV2 SNMP_RFCV3 SO_MARK
docker version
Client: Docker Engine - Community
Version: 19.03.3
API version: 1.40
Go version: go1.12.10
Git commit: a872fc2f86
Built: Tue Oct 8 00:58:10 2019
OS/Arch: linux/amd64
Experimental: false
Server: Docker Engine - Community
Engine:
Version: 19.03.3
API version: 1.40 (minimum version 1.12)
Go version: go1.12.10
Git commit: a872fc2f86
Built: Tue Oct 8 00:56:46 2019
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.2.6
GitCommit: 894b81a4b802e4eb2a91d1ce216b8817763c29fb
runc:
Version: 1.0.0-rc8
GitCommit: 425e105d5a03fabd737a126ad93d62a9eeede87f
docker-init:
Version: 0.18.0
GitCommit: fec3683
docker run --rm -d -v /lib/modules:/lib/modules:ro,rslave -v /proc:/proc --pid=host --net=host keepalived_exporter:0.1.0
b180a7679730d67410a8c5e0aaa422f98a3f8b6647c27b27aaf845a33eb6ba37
docker logs b180a7679730d67410a8c5e0aaa422f98a3f8b6647c27b27aaf845a33eb6ba37
2019/12/05 07:38:38 Providing metrics at :9650/metrics
2019/12/05 07:38:51 keepalived_exporter: operation not permitted
2019/12/05 07:39:20 keepalived_exporter: operation not permitted
2019/12/05 07:39:50 keepalived_exporter: operation not permitted
curl localhost:9650/metrics
# HELP keepalived_up Status
# TYPE keepalived_up gauge
keepalived_up 0
go get -u github.com/gen2brain/keepalived_exporter
go: finding github.com/gen2brain/keepalived_exporter latest
go: downloading github.com/gen2brain/keepalived_exporter v0.0.0-20191101232130-385bba60e832
go: extracting github.com/gen2brain/keepalived_exporter v0.0.0-20191101232130-385bba60e832
go: downloading github.com/docker/libnetwork v0.8.0-dev.2.0.20191022201816-571783238bee
go: downloading github.com/shirou/gopsutil v2.18.12+incompatible
go: extracting github.com/shirou/gopsutil v2.18.12+incompatible
go: downloading github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d
go: downloading github.com/shirou/w32 v0.0.0-20160930032740-bb4de0191aa4
go: extracting github.com/docker/libnetwork v0.8.0-dev.2.0.20191022201816-571783238bee
go: extracting github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d
go: downloading github.com/go-ole/go-ole v1.2.4
go: extracting github.com/shirou/w32 v0.0.0-20160930032740-bb4de0191aa4
go: downloading github.com/vishvananda/netlink v1.0.0
go: downloading github.com/vishvananda/netns v0.0.0-20190625233234-7109fa855b0f
go: extracting github.com/go-ole/go-ole v1.2.4
go: extracting github.com/vishvananda/netlink v1.0.0
go: extracting github.com/vishvananda/netns v0.0.0-20190625233234-7109fa855b0f
go: finding golang.org/x/sys latest
go: finding github.com/StackExchange/wmi latest
go: finding github.com/shirou/w32 latest
go: finding github.com/cespare/xxhash/v2 v2.1.1
go: finding github.com/vishvananda/netlink v1.1.0
go: finding github.com/prometheus/client_golang v1.3.0
go: finding github.com/prometheus/client_model v0.1.0
go: finding github.com/prometheus/procfs v0.0.8
go: finding github.com/docker/libnetwork v0.5.6
go: finding github.com/vishvananda/netns latest
go: finding github.com/docker/libnetwork v0.8.0-dev.2.0.20191022201816-571783238bee
go: finding github.com/prometheus/common v0.8.0
go: finding github.com/shirou/gopsutil v2.19.12+incompatible
go: downloading github.com/prometheus/client_golang v1.3.0
go: downloading github.com/shirou/gopsutil v2.19.12+incompatible
go: downloading github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df
go: downloading github.com/vishvananda/netlink v1.1.0
go: extracting github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df
go: extracting github.com/prometheus/client_golang v1.3.0
go: downloading github.com/prometheus/client_model v0.1.0
go: downloading github.com/prometheus/common v0.8.0
go: downloading github.com/prometheus/procfs v0.0.8
go: downloading github.com/cespare/xxhash/v2 v2.1.1
go: extracting github.com/shirou/gopsutil v2.19.12+incompatible
go: extracting github.com/prometheus/client_model v0.1.0
go: extracting github.com/vishvananda/netlink v1.1.0
go: extracting github.com/prometheus/common v0.8.0
go: extracting github.com/cespare/xxhash/v2 v2.1.1
go: extracting github.com/prometheus/procfs v0.0.8
# github.com/docker/libnetwork/ipvs
../../../../pkg/mod/github.com/docker/[email protected]/ipvs/netlink.go:220:13: assignment mismatch: 2 variables but s.Receive returns 3 values
Should I get
a specific version?
Maybe you should add the State metric. In the presence of a large number of instances it would be useful)
On a brand new Debian GNU/Linux Buster node under certain circumstances.
I got the following error message:
After checking the relevant code is producing the error message:
for _, p := range ps {
name, err := p.Name()
if err != nil {
return err
}
I would like to submit a PR and fetch the PID directly from the keepalived pid file located under /var/run directory.
Is it a suitable fix for you?
Regards,
keepalived_exporter: open /tmp/keepalived.data: no such file or directory
open /tmp/keepalived.stats is okay.
CentOS Linux release 7.5
Service periodically stops responding,
in the logs
keepalived_exporter[2226]: 2019/11/01 06:16:40 genl hub loop exit
After restarting the process, everything works
OS Centos 7, run from root
keepalived -v
Keepalived v1.3.5 (03/19,2017), git commit v1.3.5-6-g6fa32f2
Build options: PIPE2 LIBNL3 RTA_ENCAP RTA_EXPIRES RTA_PREF FRA_OIFNAME FRA_SUPPRESS_PREFIXLEN FRA_TUN_ID RTAX_CC_ALGO RTAX_QUICKACK LIBIPTC LIBIPSET_DYNAMIC LVS LIBIPVS_NETLINK VRRP VRRP_AUTH VRRP_VMAC SOCK_NONBLOCK SOCK_CLOEXEC FIB_ROUTING INET6_ADDR_GEN_MODE SNMP_V3_FOR_V2 SNMP SNMP_KEEPALIVED SNMP_CHECKER SNMP_RFC SNMP_RFCV2 SNMP_RFCV3 SO_MARK
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.