Perintah dmsg adalah perintah untuk menampilkan pesan dari ring kernel buffer. Kernel (inti dari sistem operasi) bertugas mengontrol akses ke sumber daya sistem. Kernel akan mencatat berbagai pesan ke ring buffer selama proses boot dan selama sistem berjalan.
saat kita mengetikkan dmesg, maka akan keluar tampilan seperti berikut :


[tixoez@tixoez.my.id ~]# dmesg 
[    0.000000] microcode: microcode updated early to revision 0x1d, date = 2018-05-11
[    0.000000] Initializing cgroup subsys cpuset
[    0.000000] Initializing cgroup subsys cpu
[    0.000000] Initializing cgroup subsys cpuacct
[    0.000000] Linux version 3.10.0-1160.105.1.el7.x86_64 (mockbuild@kbuilder.bsys.centos.org) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC) ) #1 SMP Thu Dec 7 15:39:45 UTC 2023
[    0.000000] Command line: BOOT_IMAGE=/vmlinuz-3.10.0-1160.105.1.el7.x86_64 root=/dev/mapper/centos-root ro crashkernel=auto rd.lvm.lv=centos/root rd.lvm.lv=centos/swap rhgb quiet LANG=en_US.UTF-8
[    0.000000] e820: BIOS-provided physical RAM map:
[    0.000000] BIOS-e820: [mem 0x0000000000010000-0x000000000009ffff] usable
[    0.000000] BIOS-e820: [mem 0x0000000000100000-0x00000000be777fff] usable
[    0.000000] BIOS-e820: [mem 0x00000000be778000-0x00000000be977fff] reserved
[    0.000000] BIOS-e820: [mem 0x00000000be978000-0x00000000bea76fff] usable
[    0.000000] BIOS-e820: [mem 0x00000000bea77000-0x00000000bea7bfff] ACPI NVS
[    0.000000] BIOS-e820: [mem 0x00000000bea7c000-0x00000000beafbfff] ACPI data
[    0.000000] BIOS-e820: [mem 0x00000000beafc000-0x00000000bef21fff] usable
[    0.000000] BIOS-e820: [mem 0x00000000bef52000-0x00000000bef78fff] usable
[    0.000000] BIOS-e820: [mem 0x00000000bf379000-0x00000000bf38efff] reserved
[    0.000000] BIOS-e820: [mem 0x00000000bf38f000-0x00000000bf3cdfff] ACPI data
[    0.000000] BIOS-e820: [mem 0x00000000bf3ce000-0x00000000bfffffff] reserved
[    0.000000] BIOS-e820: [mem 0x00000000e0000000-0x00000000efffffff] reserved
[    0.000000] BIOS-e820: [mem 0x00000000fe000000-0x00000000ffffffff] reserved
[    0.000000] BIOS-e820: [mem 0x0000000100000000-0x000000083fffffff] usable
[    0.000000] NX (Execute Disable) protection: active

Permasalahan yang terjadi adalah time yang muncul merupakan uptime dari server yang kita remote.
Untuk merubah format time, kita bisa menggunakan perintah :

dmesg | awk -F ] ‘{“cat /proc/uptime | cut -d \” \” -f 1″ | getline st;a=substr( $1,2, length($1) – 1);print strftime(“%F %H:%M:%S %Z”,systime()-st+a)” -> “$0}’


[tixoez@tixoez.my.id ~]# dmesg | awk -F ] ‘{“cat /proc/uptime | cut -d \” \” -f 1″ | getline st;a=substr( $1,2, length($1) – 1);print strftime(“%F %H:%M:%S %Z”,systime()-st+a)” -> “$0}’
2024-01-24 23:58:31 WIB -> [    0.000000] microcode: microcode updated early to revision 0x1d, date = 2018-05-11
2024-01-24 23:58:31 WIB -> [    0.000000] Initializing cgroup subsys cpuset
2024-01-24 23:58:31 WIB -> [    0.000000] Initializing cgroup subsys cpu
2024-01-24 23:58:31 WIB -> [    0.000000] Initializing cgroup subsys cpuacct
2024-01-24 23:58:31 WIB -> [    0.000000] Linux version 3.10.0-1160.105.1.el7.x86_64 (mockbuild@kbuilder.bsys.centos.org) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC) ) #1 SMP Thu Dec 7 15:39:45 UTC 2023
2024-01-24 23:58:31 WIB -> [    0.000000] Command line: BOOT_IMAGE=/vmlinuz-3.10.0-1160.105.1.el7.x86_64 root=/dev/mapper/centos-root ro crashkernel=auto rd.lvm.lv=centos/root rd.lvm.lv=centos/swap rhgb quiet LANG=en_US.UTF-8
2024-01-24 23:58:31 WIB -> [    0.000000] e820: BIOS-provided physical RAM map:
2024-01-24 23:58:31 WIB -> [    0.000000] BIOS-e820: [mem 0x0000000000010000-0x000000000009ffff] usable
2024-01-24 23:58:31 WIB -> [    0.000000] BIOS-e820: [mem 0x0000000000100000-0x00000000be777fff] usable
2024-01-24 23:58:31 WIB -> [    0.000000] BIOS-e820: [mem 0x00000000be778000-0x00000000be977fff] reserved
2024-01-24 23:58:31 WIB -> [    0.000000] BIOS-e820: [mem 0x00000000be978000-0x00000000bea76fff] usable
2024-01-24 23:58:31 WIB -> [    0.000000] BIOS-e820: [mem 0x00000000bea77000-0x00000000bea7bfff] ACPI NVS
2024-01-24 23:58:31 WIB -> [    0.000000] BIOS-e820: [mem 0x00000000bea7c000-0x00000000beafbfff] ACPI data
2024-01-24 23:58:31 WIB -> [    0.000000] BIOS-e820: [mem 0x00000000beafc000-0x00000000bef21fff] usable
2024-01-24 23:58:31 WIB -> [    0.000000] BIOS-e820: [mem 0x00000000bef52000-0x00000000bef78fff] usable
2024-01-24 23:58:31 WIB -> [    0.000000] BIOS-e820: [mem 0x00000000bf379000-0x00000000bf38efff] reserved
2024-01-24 23:58:31 WIB -> [    0.000000] BIOS-e820: [mem 0x00000000bf38f000-0x00000000bf3cdfff] ACPI data
2024-01-24 23:58:31 WIB -> [    0.000000] BIOS-e820: [mem 0x00000000bf3ce000-0x00000000bfffffff] reserved
2024-01-24 23:58:31 WIB -> [    0.000000] BIOS-e820: [mem 0x00000000e0000000-0x00000000efffffff] reserved
2024-01-24 23:58:31 WIB -> [    0.000000] BIOS-e820: [mem 0x00000000fe000000-0x00000000ffffffff] reserved
2024-01-24 23:58:31 WIB -> [    0.000000] BIOS-e820: [mem 0x0000000100000000-0x000000083fffffff] usable
2024-01-24 23:58:31 WIB -> [    0.000000] NX (Execute Disable) protection: active