地方エンジニアの学習日記

興味ある技術の雑なメモだったりを書いてくブログ。たまに日記とガジェット紹介。

dstatでサーバリソースのリアルタイム監視

dstatとは

vmstatやnetstat、iostatの基本機能がまとまっている便利コマンド

$ dstat 
You did not select any stats, using -cdngy by default.
--total-cpu-usage-- -dsk/total- -net/total- ---paging-- ---system--
usr sys idl wai stl| read  writ| recv  send|  in   out | int   csw 
  4   2  91   3   0| 517k   83k|   0     0 |  40B  359B| 551  1477 
  1   2  97   1   0|   0     0 | 304B 1002B|   0     0 | 299   649 
  9   5  87   0   0|   0    12k| 858B 2212B|   0     0 |1613  4920 
  2   1  97   0   0|   0     0 | 304B  538B|   0     0 | 266   542

トラフィック量やメモリ/CPU使用率なんかが表示されている。 ちなみに実装はpythonでされています。

github.com

vmstat、iostat、mpstat、netstat、およびifstatの代用品として使えます。