From db19651c246b27fa6a8d074b6e15898ab63efb1c Mon Sep 17 00:00:00 2001 From: Marc Mattmueller Date: Mon, 11 May 2020 11:15:07 +0200 Subject: [PATCH] added system monitoring application including systemd service to tools recipes the system monitoring logs information about the disk usage, available RAM, temperature and cpu load. BugzID: 62219 --- recipes-tools/sys-mon/sys-mon/sys-mon.conf | 6 +++ recipes-tools/sys-mon/sys-mon/sys-mon.service | 11 +++++ recipes-tools/sys-mon/sys-mon_git.bb | 40 +++++++++++++++++++ 3 files changed, 57 insertions(+) create mode 100644 recipes-tools/sys-mon/sys-mon/sys-mon.conf create mode 100644 recipes-tools/sys-mon/sys-mon/sys-mon.service create mode 100644 recipes-tools/sys-mon/sys-mon_git.bb diff --git a/recipes-tools/sys-mon/sys-mon/sys-mon.conf b/recipes-tools/sys-mon/sys-mon/sys-mon.conf new file mode 100644 index 0000000..c6ab676 --- /dev/null +++ b/recipes-tools/sys-mon/sys-mon/sys-mon.conf @@ -0,0 +1,6 @@ +# Default settings for system monitor application +# for details run sys-mon --help + +MON_INTERVAL_MS="-m 60000" +LOG_INTERVAL_MS="-l 300000" +LOGGER_CONFIG="--loglevel=6,evtloop.5,fileOp.5,tempSensor.5" diff --git a/recipes-tools/sys-mon/sys-mon/sys-mon.service b/recipes-tools/sys-mon/sys-mon/sys-mon.service new file mode 100644 index 0000000..3b02194 --- /dev/null +++ b/recipes-tools/sys-mon/sys-mon/sys-mon.service @@ -0,0 +1,11 @@ +[Unit] +Description=System monitoring daemon +Requires=syslog.service + +[Service] +Type=forking +EnvironmentFile=-/etc/default/sys-mon.conf +ExecStart=/usr/bin/sys-mon -d -p /run/sys-mon.pid $MON_INTERVAL_MS $LOG_INTERVAL_MS $LOGGER_CONFIG + +[Install] +WantedBy=multi-user.target \ No newline at end of file diff --git a/recipes-tools/sys-mon/sys-mon_git.bb b/recipes-tools/sys-mon/sys-mon_git.bb new file mode 100644 index 0000000..3b9b8f8 --- /dev/null +++ b/recipes-tools/sys-mon/sys-mon_git.bb @@ -0,0 +1,40 @@ +SUMMARY = "NetModule system monitoring app" +SECTION = "base" +LICENSE = "GPLv2+" +LIC_FILES_CHKSUM = "file://LICENSE;md5=699dc6077ab50a5eae0d352adaa137c0" + +SRC_URI = "git://git.netmodule.intranet/nm-tools/features.git;protocol=ssh;user=gitea;branch=master" +SRCREV = "82be95b103f636dce3f8c5c733bf4a1bea6bedfd" +SRC_URI_append = " \ + file://sys-mon.conf \ + file://sys-mon.service \ + " + +PV = "0.0.1+git${SRCPV}" + +inherit systemd +inherit unittests + +DEPENDS_append = " libnmapp" + +S = "${WORKDIR}/git/apps/sys-mon" +B = "${S}/build" + + +SYSTEMD_SERVICE_${PN} = "sys-mon.service" + +FILES_${PN} += " \ + ${bindir}/sys-mon \ + ${systemd_system_unitdir}/sys-mon.service \ + ${sysconfdir}/default/sys-mon.conf \ + " +do_install () { + bbplain "Installing ${BPN} to ${bindir}..." + install -d ${D}${bindir} + install -m 555 ${B}/rls/${BPN} ${D}${bindir} + bbplain "Installing ${BPN} as systemd service..." + install -d ${D}${sysconfdir}/default + install -m 644 ${WORKDIR}/${BPN}.conf ${D}${sysconfdir}/default/ + install -d ${D}${systemd_system_unitdir} + install -m 644 ${WORKDIR}/${BPN}.service ${D}${systemd_system_unitdir} +}