docker安装snmp rrdtool环境

家住魔仙堡 提交于 2019-12-27 19:22:57

【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>>

以Ubuntu16:04作为基础版本
docker pull ubuntu:16.04
启动一个容器
docker run -d -i -t --name flow_mete ubuntu:16.04 bash
进入容器
docker exec -it flow_mete bash
cd ~

安装基本软件
apt-get update && apt-get upgrade -y && apt-get install -y curl wget vim build-essential ca-certificates gcc git libpq-dev make python-pip python2.7 python2.7-dev ssh libmysqlclient-dev && apt-get autoremove && apt-get clean

安装最新pip
python -m pip uninstall pip setuptools
wget https://bootstrap.pypa.io/get-pip.py
python get-pip.py
ln -s /usr/local/bin/pip /usr/bin/pip && pip list


安装net-snmp
wget https://sourceforge.net/projects/net-snmp/files/net-snmp/5.7.3/net-snmp-5.7.3.tar.gz
tar zxvf net-snmp-5.7.3.tar.gz
apt-get install libperl-dev
cd net-snmp-5.7.3
./configure --with-python-modules  --enable-developer --libdir=/usr/lib64 --enable-shared --with-default-snmp-version="2" --with-sys-contact="@@no.where" --with-sys-location="Unknown" --with-logfile="/var/log/snmpd.log" --with-persistent-directory="/var/net-snmp"
make
make install
cd ..
echo export LD_LIBRARY_PATH=/usr/local/lib >> .bashrc
export LD_LIBRARY_PATH=/usr/local/lib
snmpget --version

安装python扩展;
cd net-snmp-5.7.3/python
python setup.py build
python setup.py test
python setup.py install

安装rrdtool:
apt-get install -y rrdtool python-rrdtool

设置时区:
apt-get install tzdata
dpkg-reconfigure tzdata
选择6. Asia -》 69. Shanghai
查看date -R


docker commit -m "flow-mete env init" flow_mete direpos.capitalonline.net/flow-mete:20180617
docker push direpos.capitalonline.net/flow-mete:20180617
 

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!