Telegraf - Track Oldest PCAP

This commit is contained in:
Mike Reeves
2018-11-21 20:05:50 -05:00
parent 60962dfe02
commit 50a7bca0ed
2 changed files with 10 additions and 1 deletions

View File

@@ -626,7 +626,8 @@
[[inputs.exec]]
commands = [
"/scripts/redis.sh",
"/scripts/stenoloss.sh"
"/scripts/stenoloss.sh",
"/scripts/oldpcap.sh"
]
data_format = "influx"
{% endif %}

View File

@@ -0,0 +1,8 @@
#!/bin/bash
# Get the data
OLDPCAP=$(find /nsm/pcap -type f -printf '%Cs %p\n' | sort | head -n 1 | awk {'print $1'})
DATE=$(date +%s)
AGE=$(expr $DATE - $OLDPCAP)
echo "pcapage seconds=$AGE"