Typically when a support case is opened the first item requested by the support engineer is more data. If all necessary data can be provided when a support case is opened it allows the support engineer to immediately begin looking at a customer issue, however it is often difficult to know exactly which information will be required. logGrab aims to simplify this complexity by automating the process reducing the typical time to resolution of service requests.
logGrab is a simple bash script, when executed it collects all data typically required by TAC engineers and places it into a single timestamped ZIP file, which can simply be attached when opening a new support case.
[admin@7050S-64 flash]$ ls -l total 922100 drwxrwx--- 6 root eosadmin 4096 Feb 17 16:17 . drwxr-xr-x 3 root root 100 Feb 17 14:59 .. -rwxrwx--- 1 root eosadmin 246298072 Feb 4 09:35 EOS.swi -rwxrwx--- 1 root eosadmin 19 Feb 17 06:38 boot-config drwxrwx--- 2 root eosadmin 4096 Feb 17 15:01 debug -rwxrwx--- 1 root eosadmin 427 Feb 17 16:16 logGrab -rwxrwx--- 1 root eosadmin 82583 Feb 17 16:17 logGrab-7050S-64-2012-02-17.161638.zip drwxrwx--- 2 root eosadmin 4096 Feb 17 16:01 persist drwxrwx--- 3 root eosadmin 4096 Nov 17 06:43 schedule -rwxrwx--- 1 root eosadmin 6942 Feb 17 06:58 startup-config -rwxrwx--- 1 root eosadmin 0 Nov 25 07:15 zerotouch-config
While logGrab already collects the majority of meaningful data from the system it can be extended to grab any additional data, or can be integrated with an EOS system feature such as event-manager or scheduler.
#!/bin/bash # logGrab - Automatic Log Collector v0.5 LOGNAME=logGrab-$HOSTNAME-$(date +%Y-%m-%d.%H%M%S) mkdir /mnt/flash/$LOGNAME cd /mnt/flash/$LOGNAME ls -alR /persist/sys > persist-sys-contents ls -alR /mnt/flash > flash-contents ls -alR /var/log/agents > agent-contents ls -alR /var/core > core-contents df > disk-utilization cp /mnt/flash/*config . cp -r /var/log/agents . cp -r /var/log/qt . cp -r /var/core . cp -r /mnt/flash/schedule/tech-support . sudo cp /var/log/messages* . FastCli -p15 -c "show tech" > ./show-tech FastCli -p15 -c "show tech ribd" > ./show-tech-ribd cd /mnt/flash zip -r $LOGNAME.zip $LOGNAME rm -R $LOGNAME