3月
13
Monthly Archives: 三月 2017
3月
10
centos7安装ntopng做流量分析
在centos7下分析交换机镜像过来的流量。使用ntopng统计。还需要安装nDPI协议分析和GeoIP地址库。
数据存储在redis中,要确保redis可以本地连接。
配置命令如下
yum install -y libpcap-devel glib2-devel GeoIP-devel yum install -y libxml2-devel libcurl-devel redis yum install -y autoconf automake sqlite-devel subversion autogen yum install -y GeoIP-devel hiredis-devel redis glib2-devel sqlite-devel yum install -y gcc-c++ libtool wget libcurl-devel yum install -y pango-devel cairo-devel libpng-devel git git clone https://github.com/ntop/ntopng.git cd ntopng git clone https://github.com/ntop/nDPI.git cd nDPI ./autogen.sh ./configure make cd .. ./autogen.sh ./configure /usr/bin/gmake geoip make make install
建立配置目录
mkdir /etc/ntopng
vim /etc/ntopng/ntopng.conf
-G=/var/tmp/ntopng.gid #进程部分 --local-networks=0.0.0.0/24 #监控的段 --interface=ens34 #监控的网卡 --http-port=3000 #提供web访问的端口
将要接收的网卡设为混杂模式
ifconfig ens34 promisc
启动redis
启动ntopng
ntopng /etc/ntopng/ntopng.conf &
直接在浏览器里使用3000端口就能看到了,初始化密码为admin。
还可以将数据存入mysql中(不推荐,流量大的情况下IO会比较高),配置格式为:
mysql;; ; ;
; 配置举例,建立好数据库,直接把配置写到写到ntopng.conf中:
--dump-flows=mysql;localhost;ntopng;flows;ntopng;xxx 3月 09读《特斯拉回忆录》
3月 03raspberry pi apt失败
重装raspberry pi系统,将apt-get的源换成阿里云的。执行报错如下:
W: Duplicate sources.list entry http://mirrors.aliyun.com/raspbian/raspbian/ jessie/main armhf Packages (/var/lib/apt/lists/mirrors.aliyun.com_raspbian_raspbian_dists_jessie_main_binary-armhf_Packages) W: Duplicate sources.list entry http://mirrors.aliyun.com/raspbian/raspbian/ jessie/non-free armhf Packages (/var/lib/apt/lists/mirrors.aliyun.com_raspbian_raspbian_dists_jessie_non-free_binary-armhf_Packages) W: Duplicate sources.list entry http://mirrors.aliyun.com/raspbian/raspbian/ jessie/contrib armhf Packages (/var/lib/apt/lists/mirrors.aliyun.com_raspbian_raspbian_dists_jessie_contrib_binary-armhf_Packages) W: You may want to run apt-get update to correct these problems解决
直接删除/etc/apt/sources.list.d/下面的文件,再次更新。 3月 01读《科技想要什么》