LXC Logfile

Prev Next

FMADIO Applications may require troubleshooting from time to time. The process to generate such logs is standardized across all LXC Application devices.

The following demonstrates how to generate a logfile from the CLI.


Step 1) change to LXC directory on the host

Change directory to the LXC on the host. In this example we are using the LXC named

telecom-20250425-1317

Change the above name to the correct LXC

All LXCs are require root privileges, change to superuser

sudo su

Then change to the directory

cd /opt/fmadio/lxc/telecom-20250425-1317

Example output below

fmadio@fmadio100v2-228U:~$ sudo su
root@fmadio100v2-228U:/home/fmadio# cd /opt/fmadio/lxc/telecom-20250425-1317
root@fmadio100v2-228U:/opt/fmadio/lxc/telecom-20250425-1317#

Step 2) Confirm the LXC is running

The logfile generation requires the LXC to be running, to confirm use the following command (replacing with the correct LXC name)

lxc-ls -f | grep telecom-20250425-1317

Example output shows its in RUNNING state, which is correct.

root@fmadio100v2-228U:/opt/fmadio/lxc/telecom-20250425-1317# lxc-ls -f | grep telecom-20250425-1317
telecom-20250425-1317                RUNNING 0         -      192.168.255.210 -
root@fmadio100v2-228U:/opt/fmadio/lxc/telecom-20250425-1317#

Step 3) generate the logfile

Each LXC has a filename

fmadiocli-log.lua

This is a per LXC specific file that extracts and generates log information about the host and the LXC. Once run it will generate a tarball used for uploading to FMADIO support

Command to run shown below. It can take 1 - 5 minutes to fully run depending on the amount logs generated

./fmadiocli-log.lua

Example output shown below

root@fmadio100v2-228U:/opt/fmadio/lxc/telecom-20250425-1317# ./fmadiocli-log.lua
fmad fmadlua Aug  6 2025 (/opt/fmadio/bin/fmadiolua --nocal ./fmadiocli-log.lua )
Disable cycle calibration
nil
LXCName [telecom-20250425-1317]
log_20250813_0432
mkdir ./log_20250813_0432
echo "----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------" >> log_20250813_0432/log
echo "telecom-20250425-1317"  > log_20250813_0432/log
date  >> log_20250813_0432/log
mkdir ./log_20250813_0432/host/
echo "-----------------------------------------------------------------------------------------------------host report-----------------------------------------------------------------------------------------------------" >> log_20250813_0432/log
/opt/fmadio/bin/system_dump.lua >> log_20250813_0432/host/system_dump
fmad fmadlua Aug  6 2025 (/usr/local/bin/fmadiolua /opt/fmadio/bin/system_dump.lua )
.
.
.
.
.
.

echo "-----------------------------------------------------------------------------------------------------filelist-----------------------------------------------------------------------------------------------------" >> log_20250813_0449/log
ls -alR . >> log_20250813_0449/log
echo "-----------------------------------------------------------------------------------------------------process list-----------------------------------------------------------------------------------------------------" >> log_20250813_0449/log
lxc-attach -n telecom-20250425-1317 -- /usr/bin/ps aux >> log_20250813_0449/log
cp -R /mnt/store0/log/lxc/telecom-20250425-1317 ./log_20250813_0449/
cp: can't stat '/mnt/store0/log/lxc/telecom-20250425-1317': No such file or directory
tar cfzv log_20250813_0449.tar.gz ./log_20250813_0449/
./log_20250813_0449/
./log_20250813_0449/host/
./log_20250813_0449/host/messages_20250714.gz
./log_20250813_0449/host/messages_20250806.gz
./log_20250813_0449/host/messages
./log_20250813_0449/host/messages_20250808.gz
./log_20250813_0449/host/messages_20250717.gz
./log_20250813_0449/host/messages_20250716.gz
./log_20250813_0449/host/messages_20250801.gz
./log_20250813_0449/host/messages_20250729.gz
./log_20250813_0449/host/messages_20250718.gz
./log_20250813_0449/host/messages_20250804.gz
./log_20250813_0449/host/messages_20250727.gz
./log_20250813_0449/host/messages_20250725.gz
./log_20250813_0449/host/messages_20250728.gz
./log_20250813_0449/host/messages_20250721.gz
./log_20250813_0449/host/messages_20250810.gz
./log_20250813_0449/host/messages_20250719.gz
./log_20250813_0449/host/system_dump
./log_20250813_0449/host/messages_20250726.gz
./log_20250813_0449/host/messages_20250803.gz
./log_20250813_0449/host/messages_20250715.gz
./log_20250813_0449/host/messages_20250720.gz
./log_20250813_0449/host/messages_20250812.gz
./log_20250813_0449/host/messages_20250723.gz
./log_20250813_0449/host/messages_20250807.gz
./log_20250813_0449/host/messages_20250802.gz
./log_20250813_0449/host/messages_20250811.gz
./log_20250813_0449/host/messages_20250731.gz
./log_20250813_0449/host/messages_20250809.gz
./log_20250813_0449/host/messages_20250722.gz
./log_20250813_0449/host/messages_20250724.gz
./log_20250813_0449/host/messages_20250730.gz
./log_20250813_0449/host/messages_20250805.gz
./log_20250813_0449/log
----------------------------------------------------------------
please upload:  /mnt/store0/lxc/lib/lxc/telecom-20250425-1317/log_20250813_0454.tar.gz
to           : 
----------------------------------------------------------------
echo "-----------------------------------------------------------------------------------------------------DONE-----------------------------------------------------------------------------------------------------" >> log_20250813_0449/log
done 96.906717Sec 1.615112Min
root@fmadio100v2-228U:/opt/fmadio/lxc/telecom-20250425-1317#

Step 4) Upload the tarball

The tarball generated is located per below

In the above example it located at

/mnt/store0/lxc/lib/lxc/telecom-20250425-1317/log_20250813_0454.tar.gz

Please upload this file to the FMADIO support site, our support team automatically gets notified of the upload once its done


Step 5) Finished

Done