博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
第 107 章 Observium
阅读量:6168 次
发布时间:2019-06-21

本文共 3337 字,大约阅读时间需要 11 分钟。

107.1. Installation

aptitude install libapache2-mod-php5 php5-cli php5-mysql php5-gd php5-snmp \php-pear snmp graphviz subversion mysql-server mysql-client rrdtool \fping imagemagick whois mtr-tiny nmap ipmitool

安装 Net_IPv6

Install the IPv4 and IPv6 pear libraries:$ sudo pear install Net_IPv6$ sudo pear install Net_IPv4

安装observium软件

http://www.observium.org/observium-latest.tar.gz

$ wget http://www.observium.org/observium-latest.tar.gz$ tar zxvf observium-latest.tar.gz$ sudo mv observium /opt$ cd /opt/observium/$ cp config.php.default config.php$ sudo mkdir graphs rrd$ chown www-data.www-data graphs rrd$ mkdir /opt/observium/logs

创建数据库SQL脚本

CREATE DATABASE observium;GRANT ALL PRIVILEGES ON observium.* TO 'observium'@'localhost'IDENTIFIED BY '
';

创建数据库

$ mysql -uroot -pEnter password: 
Welcome to the MySQL monitor. Commands end with ; or \g.Your MySQL connection id is 238145Server version: 5.1.41-3ubuntu12.10 (Ubuntu)Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.mysql> CREATE DATABASE observium;Query OK, 1 row affected (0.10 sec)mysql> GRANT ALL PRIVILEGES ON observium.* TO 'observium'@'localhost' IDENTIFIED BY 'observium';Query OK, 0 rows affected (0.06 sec)

修改配置文件

$ vim config.php### Database config$config['db_host'] = "localhost";$config['db_user'] = "observium";$config['db_pass'] = "observium";$config['db_name'] = "observium";### List of networks to allow scanning-based discovery$config['nets'][] = "172.16.1.0/24";$config['nets'][] = "172.16.3.0/24";or$config['nets'][] = "172.16.0.0/16";

创建数据库表

$ mysql -uobservium -pobservium observium < database-schema.sql

配置WEB服务器

$ sudo vim /etc/apache2/sites-available/observium
ServerAdmin webmaster@localhost ServerName observium.domain.com DocumentRoot /opt/observium/html
Options FollowSymLinks AllowOverride None
Options Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny allow from all ErrorLog /var/log/apache2/error.log LogLevel warn CustomLog /var/log/apache2/access.log combined ServerSignature On

启用Rewrite

$ sudo a2enmod rewriteEnabling module rewrite.Run '/etc/init.d/apache2 restart' to activate new configuration!$ sudo a2ensite observiumEnabling site observium.Run '/etc/init.d/apache2 reload' to activate new configuration!$ sudo apache2ctl restart

添加用户

$ ./adduser.phpAdd User ToolUsage: ./adduser.php 
[email]$ ./adduser.php neo chen 1 neo.chen@example.com$ ./adduser.php netkiller 3655927 10 neo.chen@example.comUser netkiller added successfully$ ./addhost.phpObservium v0.11.9.2439 Add Host ToolUsage: ./addhost.php
[community] [v1|v2c] [port] [udp|udp6|tcp|tcp6]$ ./addhost.php localhost public v2cTrying community publicAdded device localhost (1)
./discovery.php -h all./poller.php -h all

设置定时任务

$ crontab -e33 */6  * * *  cd /opt/observium/ && ./discovery.php -h all >> /dev/null 2>&1*/5 *   * * *  cd /opt/observium/ && ./discovery.php -h new >> /dev/null 2>&1*/5 *   * * *  cd /opt/observium/ && ./poller.php -h all >> /dev/null 2>&1$ sudo /etc/init.d/cron reload

原文出处:Netkiller 系列 手札

本文作者:陈景峯
转载请与作者联系,同时请务必标明文章原始出处和作者信息及本声明。

你可能感兴趣的文章
nginx+php-FastCGI+mysql性能测试
查看>>
Openstack架构及基本概念理解
查看>>
默认路由
查看>>
CYQ.Data 轻量数据层之路 框架开源系列 索引
查看>>
zabbix(2)使用自带模板完成基本监控
查看>>
安装rrdtool出现的错误
查看>>
木马隐藏地点全搜查
查看>>
来自CES 2018的5G信号:5G手机今年可能还用不上
查看>>
Subversion版本控制
查看>>
奇怪的打印纸盘故障
查看>>
hyperledger v1.0.5 区块链运维入门(一)
查看>>
Mybatis-mapper-xml-基础
查看>>
5. GC 调优(基础篇) - GC参考手册
查看>>
Windows 7 XP 模式颜色质量只有16位的解决
查看>>
SonicWall如何安全模式升级防火墙
查看>>
Linux IPC实践(3) --具名FIFO
查看>>
从Atlas到Microsoft ASP.NET AJAX(6) - Networking, Application Services
查看>>
成长之路---写好一个类
查看>>
读取 java.nio.ByteBuffer 中的字符串(String) 写入方式flash.utils.ByteArray.writeUTF
查看>>
范围管理和范围蔓延
查看>>