Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add bgpmon to be started as a new daemon under BGP docker #5329

Merged
merged 4 commits into from
Sep 20, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions dockers/docker-fpm-frr/base_image_files/monit_bgp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
## bgpd
## staticd
## bgpcfgd
## bgpmon
###############################################################################
check process zebra matching "/usr/lib/frr/zebra"
if does not exist for 5 times within 5 cycles then alert
Expand All @@ -21,3 +22,6 @@ check process staticd matching "/usr/lib/frr/staticd"

check process bgpcfgd matching "python /usr/local/bin/bgpcfgd"
if does not exist for 5 times within 5 cycles then alert

check process bgpmon matching "python2 /usr/bin/bgpmon.py"
Copy link
Collaborator

@qiluo-msft qiluo-msft Sep 14, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/usr/bin/bgpmon.py [](start = 39, length = 18)

Does the process name include "python2"? If yes, possible to remove? #Closed

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@qiluo-msft Per comment in sonic-net/sonic-swss#1429 to make the daemon specific to python2, once that change is in place we see it gets reflected under the output of show services somethis as following:

admin@SONic:~$ show services
...
bgp     docker
---------------------------
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         1  5.2  0.2  28344 22532 pts/0    Ss+  03:47   0:03 /usr/bin/python2 /usr/bin/supervisord
root        21  0.7  0.2  22660 16684 pts/0    S    03:47   0:00 python /usr/bin/supervisor-proc-exit-listener --container-name bgp
root        25  0.1  0.0 225856  3488 pts/0    Sl   03:47   0:00 /usr/sbin/rsyslogd -n -iNONE
frr         29  0.8  0.1 503176 16156 pts/0    Sl   03:47   0:00 /usr/lib/frr/zebra -A 127.0.0.1 -s 90000000 -M fpm -M snmp
frr         30  0.2  0.0  43176  6140 pts/0    S    03:47   0:00 /usr/lib/frr/staticd -A 127.0.0.1
frr         31  1.3  0.2 294536 20960 pts/0    Sl   03:47   0:00 /usr/lib/frr/bgpd -A 127.0.0.1 -M snmp
root        38  6.1  0.6  69172 55992 pts/0    S    03:47   0:03 /usr/bin/python /usr/local/bin/bgpcfgd
root        41  0.6  0.1  20996 15028 pts/0    S    03:47   0:00 python2 /usr/bin/bgpmon.py
...

For this reason the Monit config specification needs to match it.

if does not exist for 5 times within 5 cycles then alert
11 changes: 11 additions & 0 deletions dockers/docker-fpm-frr/frr/supervisord/supervisord.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,17 @@ stderr_logfile=syslog
dependent_startup=true
dependent_startup_wait_for=bgpd:running

[program:bgpmon]
command=/usr/bin/bgpmon.py
priority=6
autostart=false
autorestart=false
startsecs=0
stdout_logfile=syslog
stderr_logfile=syslog
dependent_startup=true
dependent_startup_wait_for=bgpd:running

{% if DEVICE_METADATA.localhost.docker_routing_config_mode is defined and DEVICE_METADATA.localhost.docker_routing_config_mode == "unified" %}
[program:vtysh_b]
command=/usr/bin/vtysh -b
Expand Down