Observium network and server monitoring

1,更新yum 源

[root@observium ~]# yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
[root@observium ~]# yum install http://yum.opennms.org/repofiles/opennms-repo-stable-rhel7.noarch.rpm
[root@observium ~]# yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm

2,安装依赖包
[root@observium ~]# yum install yum-utils
3,默认情况下,从REMI存储库启用PHP 7.2
[root@observium ~]# yum-config-manager --enable remi-php72
4,更新所有已安装包
[root@observium ~]# yum update
5,现在让我们为Observium安装所需的软件包
[root@observium ~]# yum install wget.x86_64 httpd.x86_64 php.x86_64 php-opcache.x86_64 php-mysql.x86_64 php-gd.x86_64 
php-posix php-pear.noarch cronie.x86_64 net-snmp.x86_64 net-snmp-utils.x86_64 
fping.x86_64 mariadb-server.x86_64 mariadb.x86_64 MySQL-python.x86_64 rrdtool.x86_64            subversion.x86_64  jwhois.x86_64 ipmitool.x86_64 graphviz.x86_64 ImageMagick.x86_64 
 php-sodium.x86_64
4,如果您希望能够监视libvirt虚拟机,请安装libvirt:
[root@observium ~]# yum install libvirt.x86_64

mysql 数据库

Start MySQL / MariaDB and configure it to run at startup.
[root @ observium opt] # systemctl enable MariaDB
[root @ observium opt] # systemctl Start MariaDB
enters no password entered mysql preferably disposed may be provided to initialize the root password
[root @ observium opt] # mysql -u root -p
user authentication after successful, you need to create the database with the following commands
MariaDB [(none)]> the cREATE dATABASE observium;
Query the OK, 1 Row affected (0.00 sec)
database named observium, you will need this information later.
Now you need to create a database administrator user.
MariaDB [(none)]> the USER observiumadmin the CREATE @ localhost IDENTIFIED BY 'observiumpassword';
Query the OK, 0 rows affected (0.00 sec)
Next, you need to give the user the appropriate permissions administrator to manage the database created with
MariaDB [(none .)]> GRANT ALL pRIVILEGES ON * observium the tO observiumadmin @ localhost;
Query the OK, 0 rows affected (0.00 sec)
you need permission to write information back to the disk to activate the new MySQL users:
MariaDB [(none)]> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)


下载观察
首先,为Observium创建一个目录
[root@observium ~]# mkdir -p /opt/observium && cd /opt
观察社区版¶
如果您想安装Community Edition,请使用最新的.tar.gz版本进行安装。
下载Observium的最新.tar.gz并解压缩:
[root@observium opt]# wget http://www.observium.org/observium-community-latest.tar.gz
[root@observium opt]# tar zxvf observium-community-latest.tar.gz
现在进入到 Observium 目录
[root@marnet opt]# cd observium
将默认的配置文件 'config.php.default' 复制到 'config.php',并将数据库配置选项填充到配置文件中
[root@marnet observium]# cp config.php.default  config.php
[root@marnet observium]# vim config.php
// Database config ---  This MUST be configured
$config['db_extension'] = 'mysqli';
$config['db_host']      = 'localhost';
$config['db_user']      = 'observiumadmin';
$config['db_pass']      = 'observiumpassword';
$config['db_name']      = 'observium';

Now set the default database schema for the MySQL database:
[root @ marnet observium] # ./discovery.php -u
Observium network and server monitoring


出现以下界面为成功
由于Fping位于不同的位置,因此请在config.php中添加一行以告知Observium。
[root@marnet observium]# which fping
/usr/sbin/fping
添加以下内容
[root@marnet observium]# vim config.php
$config['fping'] = "/sbin/fping";

现在你需要创建一个文件目录来存储 rrd 文件,并修改其权限以便让 apache 能将写入到文件中
[root@marnet observium]# mkdir rrd

[root@marnet observium]# chown apache:apache rrd
现在你需要为 Observium 创建虚拟主机配置。

如果服务器只运行Observium,请更改/etc/httpd/conf.d/observium.conf并将以下内容添加到结尾:

[root@marnet observium]# vim  /etc/httpd/conf.d/observium.conf
<VirtualHost *>
   DocumentRoot /opt/observium/html/
   ServerName  observium.domain.com
   CustomLog /opt/observium/logs/access_log combined
   ErrorLog /opt/observium/logs/error_log
   <Directory "/opt/observium/html/">
     AllowOverride All
     Options FollowSymLinks MultiViews
     Require all granted
   </Directory>
</VirtualHost>
为apache创建日志目录
[root@marnet observium]# mkdir /opt/observium/logs
[root@marnet observium]# chown apache:apache /opt/observium/logs
添加第一个用户,使用10级管理员:
[root@marnet observium]# cd /opt/observium
[root@marnet observium]# ./adduser.php admin adminpassword 10
Observium CE 18.9.9420
Add User

User admin added successfully.
下一步为发现和探寻任务设置一个 cron 任务,创建一个新的文件 ‘/etc/cron.d/observium’ 并在其中添加以下的内容。

[root@marnet observium]# vim  /etc/cron.d/observium
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
你已经完成了 Observium 服务器的安装拉! 使用你的浏览器登录到 http://<Server IP>,然后上路吧。

Observium network and server monitoring

Observium network and server monitoring


能打开能登陆不报错就安装完了

如果打不开属于防火墙问题 执行以下命令
[root@marnet observium]# vim  /etc/selinux/config 
SELINUX=permissive

[root@marnet observium]# setenforce 0
setenforce: SELinux is disabled
[root@marnet observium]# firewall-cmd --permanent --zone=public --add-service=http
success
[root@marnet observium]# firewall-cmd --reload
success

Reproduced in: https: //blog.51cto.com/xia1314520ting/2406192

Guess you like

Origin blog.csdn.net/weixin_33883178/article/details/91850310