diff --git a/README.md b/README.md index fcf56d5..1c3ddd5 100644 --- a/README.md +++ b/README.md @@ -25,11 +25,11 @@ sudo ./install.sh The executable application files are installed under `/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 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 = /, /boot/firmware, /mnt/data` to monitor two additional disks; every configured path must be mounted and accessible. diff --git a/generate_graphs.py b/generate_graphs.py index 677aa62..7f7adb2 100755 --- a/generate_graphs.py +++ b/generate_graphs.py @@ -34,7 +34,7 @@ def graph(output: Path, rrd: Path, start: str, title: str, unit: str, def main() -> None: 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() config_parser = configparser.ConfigParser() if not config_parser.read(args.config): diff --git a/install.sh b/install.sh index 2e1e2b4..c42d4b0 100755 --- a/install.sh +++ b/install.sh @@ -11,13 +11,8 @@ command -v rrdtool >/dev/null 2>&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/ -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 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." diff --git a/system_monitor.py b/system_monitor.py index 8feaa43..a8406be 100755 --- a/system_monitor.py +++ b/system_monitor.py @@ -11,7 +11,7 @@ import subprocess import time -DEFAULT_CONFIG = "/etc/cheap-system-monitor.conf" +DEFAULT_CONFIG = "/opt/cheap_system_monitor/monitor.conf" DS_NAMES = ( "load1", "load5", "load15", "cpu_user", "cpu_system", "cpu_nice", "net_in", "net_out", "disk_root", "disk_1", "disk_2", "memory",