Question
How do I obtain syslogs with the CLI?
Answer
This section explains how to obtain syslogs, etc. by logging in to Ubuntu.
Obtain the following files as syslogs.
- /var/log/messages
- amlog
- /etc/amnio/config.yaml
Contents
How to obtain syslogs using TeraTerm
- Log in to Ubuntu.
-
Create a folder to save logs.
admin@amnimo:~$ cd /tmp/
admin@amnimo:/tmp$ mkdir syslog ← Create a folder to save logs. -
Copy logs to the folder created in the previous step.
admin@amnimo:/tmp$ sudo cp /var/log/messages* ./syslog/ ← Copy logs to the folder.
admin@amnimo:/tmp$ sudo amlog show -a > ./syslog/amlog.txt ← Output amlog to amlog.txt.
admin@amnimo:/tmp$ sudo cp /etc/amnimo/config.yaml ./syslog/ ← Copy config.yaml to the folder. -
Change the permission for the folder and file, and compress the folder.
admin@amnimo:/tmp$ sudo chown admin:admin ./syslog/* ← Change the permission for the folder and file.
admin@amnimo:/tmp$ tar Jcvf log.tar.xz syslog← Compress the folder as log.tar.xz. - Start TeraTerm, and select [ File ] > [ SSH SCP ]. If you specify the file you want to transfer to another destination as follows, click [ Receive ].
- From: /tmp/log.tar.xz
- To: Where to save
-
f the file is successfully transferred to the destination, the process has been completed.
How to obtain syslogs using an external USB device, etc.
-
Proceed with Steps 1 to 4 in the same way as the previous section.
-
Mount an external USB to your PC, and copy logs to it.
admin@amnimo:/tmp$ sudo mkdir -p /media/usb ← Create a usb folder.
admin@amnimo:/tmp$ sudo mount -t vfat /dev/sdb1 /media/usb ← Mount the external USB to the usb folder.
admin@amnimo:/tmp$ sudo cp /tmp/log.tar.xz /media/usb/ ← Copy log.tar.xz to the usb memory.
admin@amnimo:/tmp$ sudo umount /media/usb ← Unmount the usb memory from the folder. -
If you remove the external device from your PC and logs are copied to it, the process has been completed.
Comments
0 comments
Please sign in to leave a comment.