sonic-buildimage/files/image_config/monit/generate_monit_config.service
yozhao101 528543bc6a
[201911][Monit] Monitor critical processes in radv and dhcp_relay containers. (#7340)
Signed-off-by: Yong Zhao yozhao@microsoft.com

Why I did it
This PR aims to monitor critical processes in router advertiser and dhcp_relay containers by Monit.

How I did it
Router advertiser container only ran on T0 device and the T0 device should have at least one VLAN interface
which was configured an IPv6 address. At the same time, router advertiser container will not run on devices of which
the deployment type is 8.

As such, I created a service which will dynamically generate Monit configuration file of router advertiser from a
template.

Similarly Monit configuration file of dhcp_relay was also generated from a template since the number of dhcrelay process in dhcp_relay container is depended on number of VLANs.

How to verify it
I verified this implementation on a DuT.
2021-04-16 08:40:06 -07:00

14 lines
266 B
Desktop File

[Unit]
Description=Generate Monit configuration file from template
Requires=updategraph.service
After=updategraph.service
Before=monit.service
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/bin/generate_monit_config
[Install]
WantedBy=multi-user.target