All rights reserved 33 問い合わせ内容 SQL フィジカル・システム情報 SELECT hostname, cpu_brand, cpu_physical_cores, cpu_logical_cores, physical_memory FROM system_info; ハードウェア変更イベント情報 SELECT * FROM hardware_events; プロセス一覧 SELECT * FROM processes; 特定パーティションの空きスペース SELECT path, ROUND( (10e-10 * blocks_available * blocks_size), 1) AS gb_free, 100 - ROUND ((blocks_available * 1.0 / blocks * 1.0) * 100, 1) AS percent_used, device, type FROM mounts WHERE path = '/'; 疑わしいプロセスを検出 (バイナリがディスクから削除済み) SELECT name, path, pid FROM processes WHERE on_disk = 0; 直近1時間のrootログインを確認 SELECT * FROM last WHERE username = “root" AND time > (( SELECT unix_time FROM time ) - 3600 ); 主要なディスクの暗号化を確認 SELECT * FROM mounts m, disk_encryption d WHERE m.device_alias = d.name AND m.path = "/"AND d.encrypted = 0; CPUを最も使用しているプロセスのTop5 SELECT pid, uid, name, ROUND(((user_time + system_time) / (cpu_time.tsb - cpu_time.itsb)) * 100, 2) AS percentage FROM processes, (SELECT (SUM(user) + SUM(nice) + SUM(system) + SUM(idle) * 1.0) AS tsb,SUM(COALESCE(idle, 0)) + SUM(COALESCE(iowait, 0)) AS itsb FROM cpu_time) AS cpu_time ORDER BY user_time+system_time DESC LIMIT 5; メモリを最も使用しているプロセスのTop10 SELECT pid, name, resident_size from processes order by resident_size desc limit 10;