refresh_alarms.sh 414 B

12345678
  1. #!/bin/bash
  2. L=/opt/zabbix/l2collector
  3. exec 7>/tmp/l2_full.lock
  4. flock -n 7 || exit 0 # skip if a full collection is running
  5. # Refresh the live JSON only. History is written exactly once by run_full.sh
  6. # after a successful full collection; this minute-level refresh must not add
  7. # duplicate snapshots.
  8. flock -n /tmp/l2_snap.lock /usr/bin/python3 $L/l2_snapshot.py >> /var/log/l2collector.log 2>&1 || true