From 504be80325456340a815df3f46b4795345286217 Mon Sep 17 00:00:00 2001 From: Cobra Date: Thu, 9 Apr 2026 13:05:34 -0400 Subject: [PATCH] Deploy OUI database as part of net_alerter daemon installation - scp oui.db to /opt/net_alerter/oui.db after daemon script - Verify DB on remote via Python/sqlite3 - Confirm row count on target host --- net_alerter/deploy-daemon.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/net_alerter/deploy-daemon.sh b/net_alerter/deploy-daemon.sh index 1c1d46a..f8eecba 100755 --- a/net_alerter/deploy-daemon.sh +++ b/net_alerter/deploy-daemon.sh @@ -29,6 +29,10 @@ ssh "$TARGET_HOST" "mkdir -p $REMOTE_DIR && ls -la $REMOTE_DIR" echo "[*] Copying daemon script..." scp "$SCRIPT" "$TARGET_HOST:$REMOTE_DIR/net_alerter.py" +# Copy OUI database +echo "[*] Copying OUI database..." +scp "$SCRIPT_DIR/../data/oui.db" "$TARGET_HOST:$REMOTE_DIR/oui.db" + # Copy systemd unit echo "[*] Copying systemd unit..." scp "$SERVICE" "$TARGET_HOST:/etc/systemd/system/net_alerter.service" @@ -63,6 +67,10 @@ sleep 3 systemctl status net_alerter --no-pager " +# Verify OUI database +echo "[*] Verifying OUI database on remote host..." +ssh "$TARGET_HOST" "python3 -c \"import sqlite3; c=sqlite3.connect('/opt/net_alerter/oui.db'); print('OUI rows:', c.execute('SELECT COUNT(*) FROM oui').fetchone()[0])\"" + echo "[*] Checking logs..." ssh "$TARGET_HOST" "journalctl -u net_alerter -n 20 --no-pager"