Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved capture of system logs #110

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 39 additions & 9 deletions varnishgather
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -670,14 +678,36 @@ 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

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
Expand Down