Debian Ubuntu Installation (RHEL and CentOS Installation参考官网http://www.observium.org/wiki/Installation,只是有些命令不同而已)
1, (可选项)Install the packages we need to run Observium:(官网上说要安装这些,因为服务器一般都已经安装php apache mysql 所以可以先跳过这个步骤,缺什么包再装,因为如果执行下面命令的话,会更新你之前装的包,但有时候是不需要而且是不能更新的。其中的php-pear库必须要安装,参考note3)
apt-get install libapache2-mod-php5 php5-cli php5-mysql php5-gd php5-snmp php-pear snmp graphviz php5-mcrypt php5-json subversion mysql-server mysql-client rrdtool fping imagemagick whois mtr-tiny nmap ipmitool python-mysqldb
apt-get install libvirt-bin
mkdir -p /opt/observium && cd /opt
wget http://www.observium.org/observium-community-latest.tar.gz
tar zxvf observium-community-latest.tar.gz
svn co http://svn.observium.org/svn/observium/trunk observium
For the STABLE revision:
svn co http://svn.observium.org/svn/observium/branches/stable observium
cd observium
cp config.php.default config.php
mysql -u root -p
mysql> CREATE DATABASE observium;
mysql> GRANT ALL PRIVILEGES ON observium.* TO 'observium'@'localhost'
-> IDENTIFIED BY '';
php includes/update/update.php
It is OK to have some errors in the SQL revisions up to 006.(我是没遇到)
mkdir rrd
chown www-data:www-data rrd
DocumentRoot /opt/observium/html/
ServerName observium.domain.com
CustomLog /opt/observium/logs/access_log combined
ErrorLog /opt/observium/logs/error_log
AllowOverride All
Options FollowSymLinks MultiViews
a2enmod rewrite
apache2ctl restart
cd /opt/observium
./adduser.php
./add_device.php v2c
这里要说的话就比较多了,我也是花了n多时间在这上面,惭愧。。
./discovery.php -h all
./poller.php -h all
33 */6 * * * root /opt/observium/discovery.php -h all >> /dev/null 2>&1
*/5 * * * * root /opt/observium/discovery.php -h new >> /dev/null 2>&1
*/5 * * * * root /opt/observium/poller-wrapper.py 1 >> /dev/null 2>&1
//Important!
service snmpd stop
net-snmp-create-v3-user
输入用户名回车
service snmpd restart
测试一下:
snmpwalk -v3 -u用户名 -lauth -aMD5 -A"密码" -X"加密密码" localhost
会将你本机的信息输出,如果你/etc/snmp/snmpd.conf文件添加了 view systemview included .1 那你就要等一点时间了,因为内容很多。(因为服务器设备的信息都是以.1开头)这里又说道了snmp的配置,参考note2
apt-get install snmpd
2,修改/etc/snmp/snmpd.conf
com2sec paranoid default public
#com2sec readonly default public
为
#com2sec paranoid default public
com2sec readonly default public
3,再重启服务
service snmpd restart
4,查看snmpd端口
lsof -i:161
显示:
SNMPDOPTS='-Lsd -Lf /dev/null -u snmp -I -smux -p /var/run/snmpd.pid 127.0.0.1'
为
SNMPDOPTS='-Lsd -Lf /dev/null -u snmp -I -smux -p /var/run/snmpd.pid
须重启服务
yum install -y net-snmp net-snmp-utils
2,
service snmpd start
提示:Starting snmpd: [ OK ],则启动snmp服务成功。
chkconfig snmpd on
查看是否已经设置成功。
chkconfig --list | grep snmpd
4、验证snmp服务
snmpwalk -v 2c -c public localhost sysName.0
5,配置snmp服务
view systemview included .1.3.6.1.2.1.1
view systemview included .1.3.6.1.2.1.25.1.1
前面加上
view systemview included .1
(表示可以检测cpu,内存等其他设备)
php go-pear.phar
如果没有提示php版本已经太新了,到这里就ok了
php -d phar.require_hash=0 go-pear.phar
按提示安装如果system不成功 尝试选择local
wget http://pear.php.net/go-pear.phar
php go-pear.phar
如果出现12个选项的提示的话,输入all然后回车就可以了
evtsys –i –h 192.168.10.16 #(日志服务器的IP地址,如果不是局域网,则写外网ip)
参数说明:
net stop evtsys
evtsys -u
启动该服务:
net start evtsys