summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2020-01-21 18:54:25 +0100
committerChristian Poessinger <christian@poessinger.com>2020-01-25 09:52:23 +0100
commita4dc6a695e5f303c475783ed79246a484f374f2c (patch)
tree2ddab20a7e5578e7ac6b813eca5326ea2a8c1998 /src
parent35340f9856fd113f0239c03f1e514c2c3baab1ce (diff)
downloadvyos-1x-a4dc6a695e5f303c475783ed79246a484f374f2c.tar.gz
vyos-1x-a4dc6a695e5f303c475783ed79246a484f374f2c.zip
keepalived: vrrp: T1900: always enable SNMP monitoring
(cherry picked from commit 8e50ece56b2644b1562efae1b3f8e07ab8146be9)
Diffstat (limited to 'src')
-rwxr-xr-xsrc/conf_mode/vrrp.py15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/conf_mode/vrrp.py b/src/conf_mode/vrrp.py
index a08493309..04bce9d39 100755
--- a/src/conf_mode/vrrp.py
+++ b/src/conf_mode/vrrp.py
@@ -27,7 +27,7 @@ import vyos.keepalived
from vyos import ConfigError
-
+daemon_file = "/etc/default/keepalived"
config_file = "/etc/keepalived/keepalived.conf"
config_tmpl = """
@@ -136,6 +136,14 @@ vrrp_sync_group {{ sync_group.name }} {
"""
+daemon_tmpl = """
+# Autogenerated by VyOS
+# Options to pass to keepalived
+
+# DAEMON_ARGS are appended to the keepalived command-line
+DAEMON_ARGS="--snmp"
+"""
+
def get_config():
vrrp_groups = []
sync_groups = []
@@ -304,9 +312,12 @@ def generate(data):
tmpl = jinja2.Template(config_tmpl)
config_text = tmpl.render({"groups": vrrp_groups, "sync_groups": sync_groups})
-
with open(config_file, 'w') as f:
f.write(config_text)
+
+ with open(daemon_file, 'w') as f:
+ f.write(daemon_tmpl)
+
return None
def apply(data):