Skip to content

Commit b09c5bc

Browse files
committed
fix: add patch
1 parent fe2b665 commit b09c5bc

File tree

3 files changed

+47
-1
lines changed

3 files changed

+47
-1
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# arguments for prometheus keepalived exporter
2-
command_args='-web.listen-address=":9165" -web.telemetry-path="/metrics"'
2+
command_args='-web.listen-address=":9650" -web.telemetry-path="/metrics" -ka.json'
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
diff --git a/internal/types/host/keepalived_host_collector_host.go b/internal/types/host/keepalived_host_collector_host.go
2+
index ea66e45..8f48f36 100644
3+
--- a/internal/types/host/keepalived_host_collector_host.go
4+
+++ b/internal/types/host/keepalived_host_collector_host.go
5+
@@ -45,11 +45,11 @@ func NewKeepalivedHostCollectorHost(useJSON bool, pidPath string) *KeepalivedHos
6+
7+
func (k *KeepalivedHostCollectorHost) Refresh() error {
8+
if k.useJSON {
9+
- if err := k.signal(k.SIGJSON); err != nil {
10+
- logrus.WithError(err).Error("Failed to send JSON signal to keepalived")
11+
+ //if err := k.signal(k.SIGJSON); err != nil {
12+
+ // logrus.WithError(err).Error("Failed to send JSON signal to keepalived")
13+
14+
- return err
15+
- }
16+
+ // return err
17+
+ //}
18+
19+
return nil
20+
}
21+
@@ -57,13 +57,13 @@ func (k *KeepalivedHostCollectorHost) Refresh() error {
22+
if err := k.signal(k.SIGSTATS); err != nil {
23+
logrus.WithError(err).Error("Failed to send STATS signal to keepalived")
24+
25+
- return err
26+
+ // return err
27+
}
28+
29+
if err := k.signal(k.SIGDATA); err != nil {
30+
logrus.WithError(err).Error("Failed to send DATA signal to keepalived")
31+
32+
- return err
33+
+ //return err
34+
}
35+
36+
return nil
37+
@@ -157,7 +157,7 @@ func (k *KeepalivedHostCollectorHost) JSONVrrps() ([]collector.VRRP, error) {
38+
39+
f, err := os.Open(fileName)
40+
if err != nil {
41+
- logrus.WithError(err).WithField("fileName", fileName).Error("failed to open JSON VRRP file")
42+
+ //logrus.WithError(err).WithField("fileName", fileName).Error("failed to open JSON VRRP file")
43+
44+
return nil, err
45+
}

app-metrics/keepalived-exporter/keepalived-exporter-1.4.0.ebuild

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ src_unpack() {
2727
}
2828

2929
src_prepare() {
30+
eapply "${FILESDIR}"/non-root.patch
3031
default
3132
}
3233

0 commit comments

Comments
 (0)