osquery メモリの状態を抽出する
osqueryで、メモリの状態を抽出するクエリを記述してます。
環境
- OS Ubuntu20.04
- osquery 4.8.0
メモリの状態を抽出
osqueryiを実行して、対話モードでクエリを実行します。
osqueryi
メモリの状態を抽出するには、以下のクエリを実行します。
osquery> select * from memory_info;
<出力結果>
+--------------+-------------+-----------+------------+-------------+------------+-----------+------------+------------+
| memory_total | memory_free | buffers | cached | swap_cached | active | inactive | swap_total | swap_free |
+--------------+-------------+-----------+------------+-------------+------------+-----------+------------+------------+
| 4065886208 | 404660224 | 301285376 | 1095405568 | 16367616 | 2014703616 | 878940160 | 2147479552 | 1892155392 |
+--------------+-------------+-----------+------------+-------------+------------+-----------+------------+------------+
メモリ領域マップは、以下で抽出できます。
select * from memory_map;
<出力結果>
+--------------------------------------+------------+-------------+
| name | start | end |
+--------------------------------------+------------+-------------+
| Reserved | 0x00000000 | 0x00000000 |
| System RAM | 0x00000000 | 0x00000000 |
| Reserved | 0x00000000 | 0x00000000 |
| System ROM | 0x00000000 | 0x00000000 |
| System RAM | 0x00000000 | 0x00000000 |
| Kernel code | 0x00000000 | 0x00000000 |
| Kernel rodata | 0x00000000 | 0x00000000 |
| Kernel data | 0x00000000 | 0x00000000 |
| Kernel bss | 0x00000000 | 0x00000000 |
| System RAM | 0x00000000 | 0x00000000 |
| ACPI Tables | 0x00000000 | 0x00000000 |
| System RAM | 0x00000000 | 0x00000000 |
| ACPI Tables | 0x00000000 | 0x00000000 |
| System RAM | 0x00000000 | 0x00000000 |
| System RAM | 0x00000000 | 0x00000000 |
| ACPI Tables | 0x00000000 | 0x00000000 |
| ACPI Non-volatile Storage | 0x00000000 | 0x00000000 |
| System RAM | 0x00000000 | 0x00000000 |
| 5620e0c7-8062-4dce-aeb7-520c7ef76171 | 0x00000000 | 0x00000000 |
| PNP0003:00 | 0x00000000 | 0x00000000 |
| Local APIC | 0x00000000 | 0x00000000 |
| PNP0003:00 | 0x00000000 | 0x00000000 |
| System RAM | 0x00000000 | 0x00000000 |
+--------------------------------------+------------+-------------+
-
前の記事
AlmaLinux gif形式のディスクトップ録画ツール「Peek」をインストールする 2022.02.14
-
次の記事
javascript lodashを使って数値に変換する 2022.02.15
コメントを書く