cleaner setup in /opt
This commit is contained in:
@@ -25,11 +25,11 @@ sudo ./install.sh
|
|||||||
|
|
||||||
The executable application files are installed under
|
The executable application files are installed under
|
||||||
`/opt/cheap_system_monitor`. Configuration remains in
|
`/opt/cheap_system_monitor`. Configuration remains in
|
||||||
`/etc/cheap-system-monitor.conf`, and the RRD database remains under
|
`/opt/cheap_system_monitor/monitor.conf`, and the RRD database remains under
|
||||||
`/var/lib/cheap-system-monitor` so code, configuration, and mutable data stay
|
`/var/lib/cheap-system-monitor` so code, configuration, and mutable data stay
|
||||||
separate.
|
separate.
|
||||||
|
|
||||||
Edit `/etc/cheap-system-monitor.conf` to choose network interfaces,
|
Edit `/opt/cheap_system_monitor/monitor.conf` to choose network interfaces,
|
||||||
mountpoints, and the graph directory. For example, use
|
mountpoints, and the graph directory. For example, use
|
||||||
`mountpoints = /, /boot/firmware, /mnt/data` to monitor two additional disks;
|
`mountpoints = /, /boot/firmware, /mnt/data` to monitor two additional disks;
|
||||||
every configured path must be mounted and accessible.
|
every configured path must be mounted and accessible.
|
||||||
|
|||||||
+1
-1
@@ -34,7 +34,7 @@ def graph(output: Path, rrd: Path, start: str, title: str, unit: str,
|
|||||||
|
|
||||||
def main() -> None:
|
def main() -> None:
|
||||||
parser = argparse.ArgumentParser(description=__doc__)
|
parser = argparse.ArgumentParser(description=__doc__)
|
||||||
parser.add_argument("--config", default="/etc/cheap-system-monitor.conf")
|
parser.add_argument("--config", default="/opt/cheap_system_monitor/monitor.conf")
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
config_parser = configparser.ConfigParser()
|
config_parser = configparser.ConfigParser()
|
||||||
if not config_parser.read(args.config):
|
if not config_parser.read(args.config):
|
||||||
|
|||||||
+1
-6
@@ -11,13 +11,8 @@ command -v rrdtool >/dev/null 2>&1 || {
|
|||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
install -d /opt/cheap_system_monitor /var/lib/cheap-system-monitor
|
|
||||||
install -m 0755 system_monitor.py generate_graphs.py /opt/cheap_system_monitor/
|
|
||||||
install -m 0644 systemd/*.service systemd/*.timer /etc/systemd/system/
|
install -m 0644 systemd/*.service systemd/*.timer /etc/systemd/system/
|
||||||
if [ ! -e /etc/cheap-system-monitor.conf ]; then
|
|
||||||
install -m 0644 cheap-system-monitor.conf.example /etc/cheap-system-monitor.conf
|
|
||||||
fi
|
|
||||||
|
|
||||||
systemctl daemon-reload
|
systemctl daemon-reload
|
||||||
systemctl enable --now cheap-system-monitor.timer cheap-system-monitor-graphs.timer
|
systemctl enable --now cheap-system-monitor.timer cheap-system-monitor-graphs.timer
|
||||||
echo "Installed. Edit /etc/cheap-system-monitor.conf if needed."
|
echo "Installed. Edit /opt/cheap_system_monitor/monitor.conf if needed."
|
||||||
|
|||||||
+1
-1
@@ -11,7 +11,7 @@ import subprocess
|
|||||||
import time
|
import time
|
||||||
|
|
||||||
|
|
||||||
DEFAULT_CONFIG = "/etc/cheap-system-monitor.conf"
|
DEFAULT_CONFIG = "/opt/cheap_system_monitor/monitor.conf"
|
||||||
DS_NAMES = (
|
DS_NAMES = (
|
||||||
"load1", "load5", "load15", "cpu_user", "cpu_system", "cpu_nice",
|
"load1", "load5", "load15", "cpu_user", "cpu_system", "cpu_nice",
|
||||||
"net_in", "net_out", "disk_root", "disk_1", "disk_2", "memory",
|
"net_in", "net_out", "disk_root", "disk_1", "disk_2", "memory",
|
||||||
|
|||||||
Reference in New Issue
Block a user