http://www.observium.org
[root@monitor ~]# yum install -y epel-release
[root@monitor ~]# rpm -ivh https://mirror.webtatic.com/yum/el6/latest.rpm
[root@monitor ~]# yum install -y httpd.x86_64 php56w.x86_64 php56w-opcache.x86_64 php56w-mysqlnd.x86_64 php56w-gd.x86_64 \
php56w-posix php56w-mcrypt.x86_64 php56w-pear.noarch cronie.x86_64 net-snmp.x86_64 net-snmp-utils.x86_64 fping.x86_64 \
MySQL-python.x86_64 rrdtool.x86_64 jwhois.x86_64 ipmitool.x86_64 graphviz.x86_64 ImageMagick.x86_64
[root@monitor ~]# php -v
PHP 5.6.40 (cli) (built: Jan 12 2019 09:19:57)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies
[root@monitor ~]# rpm -ivh http://repo.mysql.com/mysql-community-release-el6-5.noarch.rpm
[root@monitor ~]# yum install -y mysql-community-server
[root@monitor ~]# vi /etc/my.cnf
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
character-set-server = utf8
innodb_buffer_pool_size = 2G
innodb_buffer_pool_instances = 2
innodb_log_file_size = 256M
innodb_log_files_in_group = 3
innodb_log_buffer_size = 16M
innodb_undo_logs= 128
innodb_undo_tablespaces = 3
innodb_data_file_path = ibdata1:1024M:autoextend
[root@monitor ~]# service mysqld start
[root@monitor ~]# service mysqld status
mysqld (pid 13531) is running...
[root@monitor ~]# mysql_secure_installation
[root@monitor ~]# mysql -uroot -pabcd.1234
mysql> mysql> create database observium default character set utf8;
Query OK, 1 row affected (0.00 sec)
mysql> grant all on observium.* to 'observium'@'localhost' identified by 'observium';
Query OK, 0 rows affected (0.02 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.01 sec)
[root@monitor ~]# wget http://www.observium.org/observium-community-latest.tar.gz
[root@monitor ~]# tar zxvf observium-community-latest.tar.gz -C /usr/local
[root@monitor ~]# cd /usr/local/observium
[root@monitor observium]# cp config.php.default config.php
[root@monitor observium]# vi config.php
$config['db_extension'] = 'mysqli';
$config['db_host'] = 'localhost';
$config['db_user'] = 'observium';
$config['db_pass'] = 'observium';
$config['db_name'] = 'observium';
$config['fping'] = "/usr/sbin/fping";
[root@monitor observium]# ./discovery.php -u
___ _ _
/ _ \ | |__ ___ ___ _ __ __ __(_) _ _ _ __ ___
| | | || '_ \ / __| / _ \| '__|\ \ / /| || | | || '_ ` _ \
| |_| || |_) |\__ \| __/| | \ V / | || |_| || | | | | |
\___/ |_.__/ |___/ \___||_| \_/ |_| \__,_||_| |_| |_|
Observium Community Edition 18.9.9420
http://www.observium.org
Install initial database schema ... done.
-- Updating database/file schema
382 -> 383 # (db) .... Done (1s).
-- Done.
[root@monitor observium]# ./adduser.php admin abcd.1234 10
Observium CE 18.9.9420
Add User
User admin added successfully.
[root@monitor observium]# mkdir rrd
[root@monitor observium]# mkdir logs
[root@monitor observium]# chown apache.apache rrd logs
[root@monitor ~]# vi /etc/httpd/conf.d/observium.conf
<VirtualHost *>
DocumentRoot /usr/local/observium/html/
CustomLog /usr/local/observium/logs/access_log combined
ErrorLog /usr/local/observium/logs/error_log
<Directory "/usr/local/observium/html/">
AllowOverride All
Options FollowSymLinks MultiViews
</Directory>
</VirtualHost>
[root@monitor ~]# service httpd start
Starting httpd: [ OK ]
[root@monitor ~]# service httpd status
httpd (pid 21919) is running...
[root@monitor ~]# yum install -y python-argparse
[root@monitor ~]# /usr/local/observium/observium-wrapper poller -w 8
INFO: starting the poller at 2019/05/17 16:22:09 with 8 threads
INFO: starting alerter.php for 2
INFO: starting alerter.php for 1
INFO: finished alerter.php for 1
INFO: worker Thread-1 finished device 1 in 9 seconds
INFO: finished alerter.php for 2
INFO: worker Thread-2 finished device 2 in 9 seconds
INFO: observium-wrapper poller processed 2 devices in 10.06 seconds with 8 threads, load average (5min) 0.26
[root@monitor ~]# crontab -e
30 */6 * * * /usr/local/observium/discovery.php -h all >> /dev/null 2>&1
*/5 * * * * /usr/local/observium/discovery.php -h new >> /dev/null 2>&1
*/5 * * * * /usr/local/observium/observium-wrapper poller -w 8 >> /dev/null 2>&1
[root@tomcat-4010 ~]# yum -y install -y net-snmp net-snmp-utils
[root@tomcat-4010 ~]# vi /etc/snmp/snmpd.conf
# First, map the community name "public" into a "security name"
# sec.name source community
com2sec notConfigUser 192.168.40.39 public
# Second, map the security name into a group name:
# groupName securityModel securityName
group notConfigGroup v1 notConfigUser
group notConfigGroup v2c notConfigUser
# Make at least snmpwalk -v 1 localhost -c public system fast again.
# name incl/excl subtree mask(optional)
view all included .1 80
view systemview included .1.3.6.1.2.1.1
view systemview included .1.3.6.1.2.1.25.1.1
# Finally, grant the group read-only access to the systemview view.
# group context sec.model sec.level prefix read write notif
access notConfigGroup "" any noauth exact all none none
syslocation C-IDC
syscontact it@gscaifu.com
sysName TOMCAT-4010
[root@tomcat-4010 ~]# service snmpd start
Starting snmpd: [ OK ]
[root@tomcat-4010 ~]# service snmpd status
snmpd (pid 44259) is running...
[root@tomcat-4010 ~]# netstat -tunlp | grep snmpd
tcp 0 0 127.0.0.1:199 0.0.0.0:* LISTEN 44259/snmpd
udp 0 0 0.0.0.0:161 0.0.0.0:* 44259/snmpd
[root@monitor ~]# snmpwalk -v 2c -c public 192.168.40.10
转载于:https://blog.51cto.com/13598811/2103031