RDKEMW-18837: [8.4] Integrate monit utility#874
Open
yuvaramachandran-gurusamy wants to merge 13 commits into
Open
RDKEMW-18837: [8.4] Integrate monit utility#874yuvaramachandran-gurusamy wants to merge 13 commits into
yuvaramachandran-gurusamy wants to merge 13 commits into
Conversation
Signed-off-by: Yuvaramachandran Gurusamy <yuvaramachandran_gurusamy@comcast.com>
Contributor
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds a new Yocto/OpenEmbedded recipe to build and integrate the Monit monitoring utility into the RDK 8.4 layer, including default configuration and init integration (systemd + SysV).
Changes:
- Adds a
monit_5.35.2.bbrecipe that fetches/builds Monit and installs config + service/init integration. - Introduces a default
/etc/monitrcconfiguration file. - Adds a SysV init script for starting/stopping Monit.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| recipes-support/monit/monit/monitrc | Adds default Monit configuration, including daemon interval and HTTP interface settings. |
| recipes-support/monit/monit/monit | Adds SysV init script for Monit service management. |
| recipes-support/monit/monit_5.35.2.bb | Adds the Monit recipe and installs config, systemd unit, and init script. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+35
to
+40
| set httpd port 2812 | ||
| allow 0.0.0.0/0 # allow localhost to connect to the server and | ||
| allow admin:monit # require user 'admin' with password 'monit' | ||
| #with ssl { # enable SSL/TLS and set path to server certificate | ||
| # pemfile: /etc/ssl/certs/monit.pem | ||
| #} |
Comment on lines
+7
to
+9
| monit=/usr/bin/monit | ||
| pidfile=/var/run/monit.pid | ||
| monit_args="-c /etc/monitrc" |
|
|
||
| # SystemD | ||
| install -Dm 0644 ${S}/system/startup/monit.service.in ${D}${systemd_system_unitdir}/monit.service | ||
| sed -i -e 's,@prefix@,${exec_prefix},g' ${D}${systemd_unitdir}/system/monit.service |
Contributor
Contributor
| ## | ||
| ## Start Monit in the background (run as a daemon): | ||
| # | ||
| set daemon 1 # check services at 30 seconds intervals |
Comment on lines
+13
to
+16
|
|
||
| # Ensure monitrc from meta-rdk is installed. | ||
| install -Dm 0600 ${UNPACKDIR}/monitrc ${D}${sysconfdir}/monitrc | ||
|
|
Comment on lines
+1
to
+5
| #! /bin/sh | ||
| # | ||
| # This is an init script for openembedded | ||
| # Copy it to /etc/init.d/monit and type | ||
| # > update-rc.d monit defaults 89 |
| ############################################################################### | ||
| ## | ||
| ## Comments begin with a '#' and extend through the end of the line. Keywords | ||
| ## are case insensitive. All path's MUST BE FULLY QUALIFIED, starting with '/'. |
| # This file is systemd template for monit service. To | ||
| # register monit with systemd, place the monit.service file | ||
| # to the /lib/systemd/system/ directory and then start it | ||
| # using systemctl (see bellow). |
Comment on lines
+11
to
+15
| install -Dm 0644 ${UNPACKDIR}/monit.service ${D}${systemd_system_unitdir}/monit.service | ||
| install -Dm 0644 ${UNPACKDIR}/monit.path ${D}${systemd_system_unitdir}/monit.path | ||
|
|
||
| # Ensure monitrc from meta-rdk is installed. | ||
| install -Dm 0600 ${UNPACKDIR}/monitrc ${D}${sysconfdir}/monitrc |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
| SRC_URI:append = " file://monit.service file://monit.path" | ||
|
|
||
| # Enable only the path unit so monit starts when the trigger file appears. | ||
| SYSTEMD_SERVICE:${PN} = "monit.path" |
Comment on lines
+13
to
+16
|
|
||
| # Ensure monitrc from meta-rdk is installed. | ||
| install -Dm 0600 ${UNPACKDIR}/monitrc ${D}${sysconfdir}/monitrc | ||
|
|
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
| # systemctl status monit.service | ||
|
|
||
| [Unit] | ||
| Description=Pro-active monitoring utility for Unix systems |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Comment on lines
+3
to
+17
| SRC_URI:append = " file://monit.service file://monit.path" | ||
|
|
||
| # Enable only the path unit so monit starts when the trigger file appears. | ||
| SYSTEMD_SERVICE:${PN} = "monit.path" | ||
|
|
||
| do_install:append() { | ||
| # Replace the service and rc installed by the base recipe with the layer-local one. | ||
| rm -f ${D}${systemd_system_unitdir}/monit.service | ||
| rm -f ${D}${sysconfdir}/monitrc | ||
|
|
||
| install -Dm 0644 ${UNPACKDIR}/monit.service ${D}${systemd_system_unitdir}/monit.service | ||
| install -Dm 0644 ${UNPACKDIR}/monit.path ${D}${systemd_system_unitdir}/monit.path | ||
|
|
||
| # Ensure monitrc from meta-rdk is installed. | ||
| install -Dm 0600 ${UNPACKDIR}/monitrc ${D}${sysconfdir}/monitrc |
| } | ||
|
|
||
| FILES:${PN} += " \ | ||
| ${systemd_system_unitdir}/monit.path \ |
Signed-off-by: yuvaramachandran_gurusamy <yuvaramachandran_gurusamy@comcast.com>
Signed-off-by: yuvaramachandran_gurusamy <yuvaramachandran_gurusamy@comcast.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
RDKEMW-18837: [8.4] Integrate monit utility
Signed-off-by: Yuvaramachandran Gurusamy yuvaramachandran_gurusamy@comcast.com