From 5e404799b84f9ac2de10879e892535225c772e85 Mon Sep 17 00:00:00 2001 From: Asad Sajjad Ahmed Date: Wed, 15 Nov 2023 17:07:49 +0100 Subject: [PATCH 1/2] improve /var/log/* capture Signed-off-by: Asad Sajjad Ahmed --- varnishgather | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/varnishgather b/varnishgather index df591a5..ed7aa99 100755 --- a/varnishgather +++ b/varnishgather @@ -138,6 +138,14 @@ runpipe() { LOG="$OLDLOG" } +capturelog() { + if [ -r $1 ]; then + run egrep -i "(broadcaster|varnish|vha-agent|hitch|vac|rc.local|varnish-controller|vcs)" "$1" + else + incr + fi +} + mycat() { if [ -r $1 ]; then run cat $1 @@ -670,14 +678,14 @@ run lsblk # run blockdev --getbsz /dev/$d #done - -for a in /var/log/messages /var/log/syslog; do - if [ -r "$a" ]; then - run egrep -i "(broadcaster|varnish|vha-agent|hitch|vac|rc.local|varnish-controller|vcs)" "$a" - else - incr - fi -done +capturelog /var/log/messages +capturelog /var/log/syslog +capturelog /var/log/debug +capturelog /var/log/kern.log +capturelog /var/log/dpkg.log +capturelog /var/log/yum.log +capturelog /var/log/dnf.log +capturelog /var/log/user.log # ip tables if (lsmod | grep ip_tables > /dev/null); then From a4ab744c067deb9ed37f18990230f5eb8b3c5892 Mon Sep 17 00:00:00 2001 From: Asad Sajjad Ahmed Date: Wed, 15 Nov 2023 17:19:56 +0100 Subject: [PATCH 2/2] export systemd journal for services Not sure why we have not thought about this... Signed-off-by: Asad Sajjad Ahmed --- varnishgather | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/varnishgather b/varnishgather index ed7aa99..1d60a75 100755 --- a/varnishgather +++ b/varnishgather @@ -38,7 +38,7 @@ TOPDIR=$(mktemp -d ${TMPDIR:-/tmp}/varnishgather.XXXXXXXX) ID="$(cat /etc/hostname)-$(date +'%Y%m%d-%H%M%S')" RELDIR="varnishgather-$ID" ORIGPWD=$PWD -VERSION=1.101 +VERSION=1.102 USERID=$(id -u) PID_ALL_VARNISHD=$(pidof varnishd 2> /dev/null) PID_ALL_VARNISHD_COMMA=$(pidof varnishd 2> /dev/null | sed 's/ /,/g') @@ -687,6 +687,28 @@ capturelog /var/log/yum.log capturelog /var/log/dnf.log capturelog /var/log/user.log +run journalctl --since=-1w -u vac.service +run journalctl --since=-1w -u varnish.service +run journalctl --since=-1w -u varnish-agent.service +run journalctl --since=-1w -u varnish-controller-agent.service +run journalctl --since=-1w -u varnish-controller-api-gw.service +run journalctl --since=-1w -u varnish-controller-brainz.service +run journalctl --since=-1w -u varnish-controller-nats.service +run journalctl --since=-1w -u varnish-controller-ui.service +run journalctl --since=-1w -u varnish-controller-router.service +run journalctl --since=-1w -u varnish-discovery.service +run journalctl --since=-1w -u varnish-traffic-router.service +run journalctl --since=-1w -u vcs.service +run journalctl --since=-1w -u vcs-agent.service +run journalctl --since=-1w -u vstatd.service +run journalctl --since=-1w -u vstatdprobe.service + +run journalctl --since=-1h -u broadcaster.service +run journalctl --since=-1h -u varnishlog-errors.service +run journalctl --since=-1h -u varnishncsa.service +run journalctl --since=-1h -u vha-agent.service +run journalctl --since=-1h -u irqbalance.service + # ip tables if (lsmod | grep ip_tables > /dev/null); then run iptables-save