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

读《特斯拉回忆录》

一位被世界遗忘的天才,世界上最接近神的人。
如果没有特斯拉,今天的电气化会来得很迟。不是特斯拉的专利免费让全人类使用,也没有我们今天的高速发展。
特斯拉的惊世之举,1897年,举世知名的「尼加拉瓜」水电站,其电力输出量实是惊人。而这项足足超过100年以上的电力建设至今仍然运作如常,从未间断地生产出无穷无尽的天然能源,这实是人类近百年科学上的一大标记。

3月 03

raspberry 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/下面的文件,再次更新。

2017年三月
« 2月   5月 »
 12345
6789101112
13141516171819
20212223242526
2728293031