ubuntu下Smokeping安装教程



一、安装系统Ubuntu server 12.04 32位操作系统,默认安装即可


二、系统安装好后配置好IP及DNS,保障能正常访问INTELNET。


三、修改更新源


1.cp /etc/apt/sources.list /etc/apt/sources.list.old

 vi /etc/apt/sources.list

编辑你的源列表,将原来的内容全部删除,把下面源文件复制到你的列表中,然后保存列表。


Ubuntu 12.04源列表:

搜狐源(更新快)

代码:


deb http://mirrors.sohu.com/ubuntu/ precise main restricted

deb-src http://mirrors.sohu.com/ubuntu/ precise main restricted

deb http://mirrors.sohu.com/ubuntu/ precise-updates main restricted

deb-src http://mirrors.sohu.com/ubuntu/ precise-updates main restricted

deb http://mirrors.sohu.com/ubuntu/ precise universe

deb-src http://mirrors.sohu.com/ubuntu/ precise universe

deb http://mirrors.sohu.com/ubuntu/ precise-updates universe

deb-src http://mirrors.sohu.com/ubuntu/ precise-updates universe

deb http://mirrors.sohu.com/ubuntu/ precise multiverse

deb-src http://mirrors.sohu.com/ubuntu/ precise multiverse

deb http://mirrors.sohu.com/ubuntu/ precise-updates multiverse

deb-src http://mirrors.sohu.com/ubuntu/ precise-updates multiverse

deb http://mirrors.sohu.com/ubuntu/ precise-backports main restricted universe multiverse

deb-src http://mirrors.sohu.com/ubuntu/ precise-backports main restricted universe multiverse

deb http://mirrors.sohu.com/ubuntu/ precise-security main restricted

deb-src http://mirrors.sohu.com/ubuntu/ precise-security main restricted

deb http://mirrors.sohu.com/ubuntu/ precise-security universe

deb-src http://mirrors.sohu.com/ubuntu/ precise-security universe

deb http://mirrors.sohu.com/ubuntu/ precise-security multiverse

deb-src http://mirrors.sohu.com/ubuntu/ precise-security multiverse

deb http://extras.ubuntu.com/ubuntu precise main

deb-src http://extras.ubuntu.com/ubuntu precise main


网易(下载速度很快)


代码:

deb http://mirrors.163.com/ubuntu/ precise main restricted

deb-src http://mirrors.163.com/ubuntu/ precise main restricted

deb http://mirrors.163.com/ubuntu/ precise-updates main restricted

deb-src http://mirrors.163.com/ubuntu/ precise-updates main restricted

deb http://mirrors.163.com/ubuntu/ precise universe

deb-src http://mirrors.163.com/ubuntu/ precise universe

deb http://mirrors.163.com/ubuntu/ precise-updates universe

deb-src http://mirrors.163.com/ubuntu/ precise-updates universe

deb http://mirrors.163.com/ubuntu/ precise multiverse

deb-src http://mirrors.163.com/ubuntu/ precise multiverse

deb http://mirrors.163.com/ubuntu/ precise-updates multiverse

deb-src http://mirrors.163.com/ubuntu/ precise-updates multiverse

deb http://mirrors.163.com/ubuntu/ precise-backports main restricted universe multiverse

deb-src http://mirrors.163.com/ubuntu/ precise-backports main restricted universe multiverse

deb http://mirrors.163.com/ubuntu/ precise-security main restricted

deb-src http://mirrors.163.com/ubuntu/ precise-security main restricted

deb http://mirrors.163.com/ubuntu/ precise-security universe

deb-src http://mirrors.163.com/ubuntu/ precise-security universe

deb http://mirrors.163.com/ubuntu/ precise-security multiverse

deb-src http://mirrors.163.com/ubuntu/ precise-security multiverse

deb http://extras.ubuntu.com/ubuntu precise main

deb-src http://extras.ubuntu.com/ubuntu precise main



2.sudo apt-get update 更新源列表信息进行校验

可以在运行sudo apt-get update时查看一下错误信息,把不能连接的源删除再重新运行sudo apt-get update


3.sudo apt-get upgrade升级到最新版本


四、SSH到系统,将下面命令复制执行更新相应插件。所有询问选“Y”进行下载安装

aptitude install rrdtool apache2 fping echoping libapache2-mod-speedycgi libwww-perl libsocket6-perl libnet-telnet-perl libnet-dns-perl libnet-ldap-perl libio-socket-ssl-perl libauthen-radius-perl libcgi-perl librrds-perl librrdp-perl


五、接下来安装smokeping,将下面命令复制执行。所有询问选“Y”进行下载安装

apt-get install smokeping


六、再下来安装sendmail,将下面命令复制执行。所有询问选“Y”进行下载安装即可

apt-get install sendmail


七、可以看你的IE输入http://[IP]/cgi-bin/smokeping.cgi 就能浏览了安装成功的界面


八、还需要配置smokeping,添加监控主机。实现方法是修改配置文件,如下:


vi /etc/smokeping/config.d/Targets


九、Targets文件的格式是

menu = Top

title = Network Latency Grapher

remark = Welcome to the SmokePing website of 'A poorly \

       mantained site running Debian.'


+ Local


menu = Local

title = Local Network


++ LocalMachine


menu = Local Machine

title = This host

host = localhost



+ CNC


menu = CNC

title = cnc


++ TJ-CNC


menu = tj-cnc

title = tj-cnc-111.161.16.1

host = 111.161.16.1


十、+或++对应的是列表项目,menu对应的是列表标签,title对应的是主机标题,host对应的是主机ip


十一、需要注意的是,配置文件一个+为主目录,二个++为次目录,修改了配置文件需要重启smokeping才能生效。