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 monit for disk>85% into pmon docker #582

Merged
merged 3 commits into from
May 18, 2017
Merged

Add monit for disk>85% into pmon docker #582

merged 3 commits into from
May 18, 2017

Conversation

qiluo-msft
Copy link
Collaborator

No description provided.

RUN sed -i 's/^# allow @users readonly/ allow @users readonly/' /etc/monit/monitrc

RUN echo "check filesystem root-aufs with path /" >> /etc/monit/monitrc
RUN echo " if space usage > 85% for 5 times within 15 cycles then alert" >> /etc/monit/monitrc
Copy link
Contributor

@jleveque jleveque May 9, 2017

Choose a reason for hiding this comment

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

Instead of all of these sed and echo commands, wouldn't it be cleaner to keep our own custom monitrc file in this directory and just copy it into /etc/monit/ here instead? #Resolved

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Technically they are the same. The benefit of sed is reusing the default config, and easy to detect incompatibility issue in future monit config (which may be rare but possible).


In reply to: 115619051 [](ancestors = 115619051)

Copy link
Contributor

Choose a reason for hiding this comment

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

I do agree that it would be easier to detect future compatibility issues.

RUN sed -i 's/^# allow @users readonly/ allow @users readonly/' /etc/monit/monitrc

RUN echo "check filesystem root-aufs with path /" >> /etc/monit/monitrc
RUN echo " if space usage > 85% for 5 times within 15 cycles then alert" >> /etc/monit/monitrc
Copy link
Contributor

Choose a reason for hiding this comment

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

I do agree that it would be easier to detect future compatibility issues.

@lguohan
Copy link
Collaborator

lguohan commented May 9, 2017

can we also add cpu and mem utilization alert?

@lguohan
Copy link
Collaborator

lguohan commented May 10, 2017

we also need to add cpu and mem util too, maybe it also make sense to add it into the base image so that we can monitor some process in the base image too.

RUN sed -i 's/^# allow localhost/ allow localhost/' /etc/monit/monitrc
RUN sed -i 's/^# allow admin:monit/ allow admin:monit/' /etc/monit/monitrc
RUN sed -i 's/^# allow @monit/ allow @monit/' /etc/monit/monitrc
RUN sed -i 's/^# allow @users readonly/ allow @users readonly/' /etc/monit/monitrc
Copy link
Contributor

Choose a reason for hiding this comment

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

merge the sed RUNs to -ri with one docker command to make it clear. (like https://github.com/Azure/sonic-buildimage/blob/master/dockers/docker-database/Dockerfile.j2)

Copy link
Contributor

Choose a reason for hiding this comment

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

Personally, I think the separate RUN commands are pretty clear, plus there's no need to escape every line break.

@stcheng
Copy link
Contributor

stcheng commented May 10, 2017

i think it is better to put monit into pmon docker as the name of the docker implies.

@lguohan
Copy link
Collaborator

lguohan commented May 11, 2017

@stcheng, you cannot monitor the base image process such as ntp, sshd when monit is in pmon

@jleveque
Copy link
Contributor

@stcheng @lguohan: Acually, installing monit in the base image makes more sense than in docker-platform-monitor. Correct me if I'm wrong, but my understanding is that docker-platform-monitor's purpose is for monitoring platform-specific hardware, whereas monit is being used to monitor the state of the OS. Thought of this way, monit actually belongs in the base OS, not in docker-platform-monitor.

sudo sed -i '
s/^# set logfile syslog/set logfile syslog/;
s/^\s*set logfile \/var/# set logfile \/var/;
s/^# set httpd port/set httpd port/;
Copy link
Collaborator

Choose a reason for hiding this comment

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

what is this httpd port?

Copy link
Collaborator Author

@qiluo-msft qiluo-msft May 18, 2017

Choose a reason for hiding this comment

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

ref: https://mmonit.com/monit/documentation/#MONIT-HTTPD
It enables cli to check status. The access is granted to local connection, so it should be safe.

@qiluo-msft qiluo-msft merged commit 8ebf0b0 into sonic-net:master May 18, 2017
@qiluo-msft qiluo-msft deleted the qiluo/monit branch May 18, 2017 17:57
lguohan pushed a commit that referenced this pull request Jul 31, 2019
* src/sonic-utilities ee56d54...cb0e745 (11):
  > sonic_utilities: Support for DOM Threshold values for EEPROM dump
(#545)
  > [portstat] Fix portstat show RX_UTIL over 100% for 100G (#563)
  > sonic_installer: fix read-only filesystem support for firmware
update (#565)
  > Revert "show acl table command output should show binding column
correctly even with single port (#447)" (#589)
  > show acl table command output should show binding column correctly
even with single port (#447)
  > [config] Do no stop or restart dependent services (#582)
  > sfpshow: prevent 'show int trans eeprom --dom' from crashing (#567)
  > [warm-reboot] add docker upgrade --warm option and roll back support
(#559)
  > [ecnconfig] Validate input WRED parameters (#579)
  > [sonic-utilities] Add fstrim to reboot (#535)
  > Fixing the expected neighbor command due to change in output format
under sonic-buildimage/pull/3036 (#584)
Kalimuthu-Velappan pushed a commit to Kalimuthu-Velappan/sonic-buildimage that referenced this pull request Sep 12, 2019
yxieca added a commit to yxieca/sonic-buildimage that referenced this pull request Sep 17, 2019
Submodule src/sonic-utilities fe2c656..afaedb7:
  > Revert "[FastReboot]: Send SIGINT to all teamd before stop (sonic-net#633)" (sonic-net#650)
  > Fixed config Asym PFC CLI. (sonic-net#632)
  > [config] Do no stop or restart dependent services (sonic-net#582)

Signed-off-by: Ying Xie <ying.xie@microsoft.com>
yxieca added a commit that referenced this pull request Sep 18, 2019
Submodule src/sonic-utilities fe2c656..afaedb7:
  > Revert "[FastReboot]: Send SIGINT to all teamd before stop (#633)" (#650)
  > Fixed config Asym PFC CLI. (#632)
  > [config] Do no stop or restart dependent services (#582)

Signed-off-by: Ying Xie <ying.xie@microsoft.com>
prsunny pushed a commit that referenced this pull request Feb 24, 2022
*9eac0ae Add support for route flow counter (#576)
*2262c01 [VS] Increase test timout to 360min (#582)
*a2b8161 [ci] pipeline fixes for VS test (#581)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants