only go back 5 mins

This commit is contained in:
dadav 2020-04-19 16:36:26 +02:00
parent a2e29d64d2
commit c726779f6e
2 changed files with 2 additions and 2 deletions

View File

@ -14,7 +14,7 @@ blink_led() {
# check if brcm is stuck
check_brcm() {
if [[ "$(journalctl -n10 -k | grep -c 'brcmf_cfg80211_nexmon_set_channel.*Set Channel failed')" -ge 5 ]]; then
if [[ "$(journalctl -n10 -k --since '5 minutes ago' | grep -c 'brcmf_cfg80211_nexmon_set_channel.*Set Channel failed')" -ge 5 ]]; then
return 1
fi
return 0

View File

@ -24,7 +24,7 @@ class Watchdog(plugins.Plugin):
def on_epoch(self, agent, epoch, epoch_data):
# get last 10 lines
last_lines = ''.join(list(TextIOWrapper(subprocess.Popen(['journalctl','-n10','-k'],
last_lines = ''.join(list(TextIOWrapper(subprocess.Popen(['journalctl','-n10','-k', '--since', '"5 minutes ago"'],
stdout=subprocess.PIPE).stdout))[-10:])
if len(self.pattern.findall(last_lines)) >= 5:
display = agent.view()