トップ 差分 一覧 ソース 検索 ヘルプ RSS ログイン

tips-rrdtools

RRDtools

Home

DownLoad

rrdpython

rrdpython

pipy

cli info

http://www.sakito.com/2012/10/rrdtool.html

tip

http://www.itmedia.co.jp/enterprise/articles/0705/25/news013_2.html

check

http://blog.majide.com/2009/02/socket-programming-server/


ネットワークの転送量は
//sys/class/net/eth2/statistics/tx_bytes
/proc/net/dev
のいずれかから

 FreeBSD の場合には
   sysctl -a | grep em1 | grep recvd

python-rrdtool sample

#!/usr/bin/env python
# -*- coding: utf-8 -*-
import rrdtool


def create():
    data_sources = [
       'DS:load1:GAUGE:600:0:U',
       'DS:load5:GAUGE:600:0:U',
       'DS:load15:GAUGE:600:0:U',
   ]
   rras = [
       'RRA:AVERAGE:0.5:1:600',
       'RRA:AVERAGE:0.5:6:700',
       'RRA:AVERAGE:0.5:24:775',
       'RRA:AVERAGE:0.5:288:797',
       'RRA:MAX:0.5:1:600',
       'RRA:MAX:0.5:6:700',
       'RRA:MAX:0.5:24:775',
       'RRA:MAX:0.5:288:797',
       'RRA:MIN:0.5:1:600',
       'RRA:MIN:0.5:6:700',
       'RRA:MIN:0.5:24:775',
       'RRA:MIN:0.5:288:797',
   ]

   rrdtool.create('pyload.rrd',
                  '--step', '300',
                  data_sources,
                  rras)


def main():
   create()

if __name__ == '__main__':
   main()