wget https://github.com/lebinh/ngxtop/archive/master.zip -O ngxtop-master.zip
unzip ngxtop-master.zip
cd ngxtop-master
python setup.py install
find / -name 'ngxtop'
如果运行中出现 ImportError: No module named _sqlite3 问题解决如下:
#1 安装sqlite
wget http://www.sqlite.org/sqlite-amalgamation-3.6.20.tar.gz
tar zxf sqlite-amalgamation-3.6.20.tar.gz
./configure --prefix=/application/path/
make && make install
#2 重新安装python
cd /application/tools/Python-2.7.8
vi setup.py 修改:
sqlite_inc_paths = [ '/usr/include',
'/usr/include/sqlite',
'/usr/include/sqlite3',
'/usr/local/include',
'/usr/local/include/sqlite',
'/usr/local/include/sqlite3',
'/application/sqlite/include',
'/application/sqlite/include/sqlite3',
]
./configure --prefix=/usr/local/python2
make && make install
#3 测试
>>import sqlite3
/usr/local/python2/bin/ngxtop -h
本文转自cloves 51CTO博客,原文链接:http://blog.51cto.com/yeqing/1655163