Avamar: How to run "getlogs" to gather Avamar server logs
摘要: This article provides information about the getlogs utility, used to gather Avamar server logs.
说明
What is getlogs?
getlogs is utility that is run on the Avamar Utility Node.
The utility gathers extensive logs from all nodes and stores them in a tar file.
(The tar file is created and stored in the directory that the getlogs script is run from.)
The "--server" flag can be used to specify how many days of logs to collect. If this flag is not used, then everything since the last restart is captured (which can result in a large tar file)
--server" flag, ensure that it covers the timeframe of the incident that logs are being collected for. Adding an extra day or two ensures that enough data is captured, and does not add a significant amount of size to the log file.
For example, if a node went offline yesterday, use "
--server=2" or "--server=3" to ensure that sufficient information is collected.
getlogs do when run?
- The "
getnodelogs" script is copied to every node and run - The
getnodelogsscript bundles all the logs collected into a file called "nodelogs.tgz" on each node - It then gathers all the "
nodelogs.tgz" files and adds them into onelogs.xxxx.tarfile - The "logs.xxxx.tar" file is the file to collect
- It is important to understand the distinction between
getlogsvsgetnodelogs, and nodelogs.tgz vs logs.xxxx.tar. Grabbing nodelogs.tgz from a single node is not sufficient, and the logs.xxxx.tar file should ALWAYS be collected - Depending on the file size, it should either be attached to the Service Request (SR) or uploaded to the
MFTsite (this information will be provided by your Avamar support engineer if required)
- It is important to understand the distinction between
getlogs must be run BEFORE the rollback. Once the rollback is performed, the current logs are erased.
Procedure:
1. Log in to the grid as admin and load the ssh keys. See Avamar: How to Log in to an Avamar Server and Load Various Keys for information about loading keys.
2. From Avamar version 18.1, getlogs must be run as root (but not run from the root home directory).
a. Switch to root:
su -
Enter the root password when prompted.
b. Load the root keys:
ssh-agent bash
ssh-add .ssh/rootid
Sample output:
Identity added: .ssh/rootid (.ssh/rootid)
c. It is important to change to the /home/admin directory:
cd /home/admin
3. Run the getlogs command:
getlogs --server=x
Where "x" is the number of days of logs to gather. (The "getlogs" command can be run without "--server=" and gathers all server logs)
Sample output:
Copying getnodelogs script to nodes
Running getnodelogs script on nodes
Getting nodelogs.tgz from nodes
Creating tar file: logs.130218.120930.tar
Done with getlogs
4. The file is created in the format "logs.ddmmss.hhmmss.tar". Verify that the tar file mentioned above exists in the directory the command was run in:
ls -lh logs.130218.120930.tar
Sample output:
-rw-rw-r-- 1 admin admin 324M Feb 13 12:10 logs.130213.120930.tar
(This also indicates how big the file is.)
Notes:
- During the rollback process,
getlogsis run automatically as a precaution - If
getlogswas not run manually before rolling back the grid, the copy captured during the rollback can be found in/usr/local/avamar/var/log/rollback- Check the timestamp on the tar files to verify that the correct
log.xxxx.tarfile is being collected:
- Check the timestamp on the tar files to verify that the correct
ls -ltrh /usr/local/avamar/var/log/rollback/
total 54G
-rw-rw-r-- 1 admin admin 18G Feb 17 11:01 logs.140217.102740.tar
-rw-rw-r-- 1 admin admin 19G Feb 19 12:57 logs.140219.122325.tar
-rw-rw-r-- 1 admin admin 18G Feb 21 12:34 logs.140217.184444.tar
(On a production grid, these logs can be large (2GB+)
- Once the .tar file has been created, it must be provided to Avamar support personnel for troubleshooting purpose
- If the size of the file is less than 2 GB, it can be directly attached to the Service Request
- If the size of the file is bigger than 2 GB (likely), contact the Avamar support personnel to assist uploading the file to an
MFTsite.
其他信息
- Generally, it is necessary to have a conversation between the Avamar Support Engineer and the Customer about the environment, especially if the FTP process starts to get difficult or time consuming
- The Customer might be able to give instructions on the best way to push files out of their environment and could save a lot of time and effort in the process
- For example, the environment might have FTP access blocked on the affected grid but have access from another grid that could be used to get the files uploaded to the
MFTserver
- For example, the environment might have FTP access blocked on the affected grid but have access from another grid that could be used to get the files uploaded to the
- Depending on the situation, it might also be best to use an alternative and temporary
MFTlink provided by Avamar support personnel
See this video: