欧美一区二区三区老妇人-欧美做爰猛烈大尺度电-99久久夜色精品国产亚洲a-亚洲福利视频一区二区

Centos7安裝cacti和nagios

Centos7安裝cacti 和nagios

創(chuàng)新互聯(lián)是專業(yè)的蜀山網站建設公司,蜀山接單;提供成都做網站、網站制作,網頁設計,網站設計,建網站,PHP網站建設等專業(yè)做網站服務;采用PHP框架,可快速的進行蜀山網站開發(fā)網頁制作和功能擴展;專業(yè)做搜索引擎喜愛的網站,專業(yè)的做網站團隊,希望更多企業(yè)前來合作!

cacti

 

一、環(huán)境準備

0.設置主機名稱,SELINUX,防火墻以及時區(qū)

[root@localhost ~]# hostnamectl set-hostname nms01
[root@nms01 ~]# getenforce
Disabled
[root@nms01 ~]# timedatectl set-timezone Asia/Shanghai
[root@nms01 ~]# systemctl stop firewalld.service
[root@nms01 ~]# systemctl disable firewalld.service

1.安裝httpd

[root@nms01 ~]# yum install httpd httpd-devel -y
[root@nms01 ~]# systemctl enable httpd.service
Created symlink from /etc/systemd/system/multi-user.target.wants/httpd.service to /usr/lib/systemd/system/httpd.service.
[root@nms01 ~]# systemctl start httpd.service

2.安裝並設置數(shù)據(jù)庫mariadb

[root@localhost ~]# yum install mariadb mariadb-server mariadb-devel -y
[root@nms01 ~]# vi /etc/my.cnf.d/cacti.cnf
[MySQLd]
bind-address = 10.0.0.103
default-storage-engine = innodb
innodb_file_per_table
max_connections = 4096
collation-server = utf8_general_ci
character-set-server = utf8
[root@nms01 ~]# systemctl enable mariadb.service
Created symlink from /etc/systemd/system/multi-user.target.wants/mariadb.service to /usr/lib/systemd/system/mariadb.service.
[root@nms01 ~]# systemctl start mariadb.service
[root@nms01 ~]# mysql_secure_installation 
[root@nms01 ~]# 
[root@nms01 ~]# mysql -uroot -p
Enter password: 
MariaDB [(none)]> create database cacti;
Query OK, 1 row affected (0.00 sec)
MariaDB [(none)]> grant all on cacti.* to cacti@localhost identified by 'cacti';
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> flush privileges;
Query OK, 0 rows affected (0.00 sec)

3.安裝php

[root@nms01 ~]# yum install php-mysql php-pear php-common php-gd php-devel php php-mbstring php-cli -y

4.安裝php-snmp、net-snmp

[root@nms01 ~]# yum install php-snmp net-snmp-utils net-snmp-libs net-snmp-devel -y
[root@nms01 ~]# systemctl enable snmpd.service
Created symlink from /etc/systemd/system/multi-user.target.wants/snmpd.service to /usr/lib/systemd/system/snmpd.service.
[root@nms01 ~]# systemctl start snmpd.service

5.安裝rrdtool

[root@nms01 ~]# yum install rrdtool -y

二、下載安裝cacti

[root@nms01 ~]# yum install wget gcc  -y
[root@nms01 ~]# wget http://www.cacti.net/downloads/cacti-0.8.8h.tar.gz
[root@nms01 ~]# tar -xvf cacti-0.8.8h.tar.gz -C /usr/local/
[root@nms01 local]# ln -s cacti-0.8.8h cacti
[root@nms01 local]# vi cacti/include/config.php 
$database_type = "mysql";
$database_default = "cacti";
$database_hostname = "localhost";
$database_username = "cacti";
$database_password = "cacti";
$database_port = "3306";
$database_ssl = false;
[root@nms01 local]# useradd cacti -d /usr/local/cacti
[root@nms01 local]# chown -R cacti /usr/local/cacti/
[root@nms01 local]# chgrp -R cacti /usr/local/cacti
[root@nms01 local]# chmod -R 755 /usr/local/cacti/
[root@nms01 local]# mysql -ucacti -p cacti </usr/local/cacti/cacti.sql 
Enter password: 
###################################################################
[root~]# firewall-cmd --permanent --zone=public --add-service=http
[root~]# firewall-cmd --reload 
###################################################################
[root@nms01 local]# vi /etc/httpd/conf.d/cacti.conf
Alias /cacti    /usr/local/cacti   
<Directory /usr/local/cacti/>
         <IfModule mod_authz_core.c>
 # httpd 2.4
 Require all granted
         </IfModule>
 <IfModule !mod_authz_core.c>
 # httpd 2.2
 Order deny,allow
 Deny from all
 Allow from all
         </IfModule>
</Directory> 
[root@nms01 local]# systemctl restart httpd.service
[root@nms01 local]# vi /etc/cron.d/cacti
*/5 * * * *    cacti   /usr/bin/php /usr/local/cacti/poller.php > /dev/null 2>&1

訪問web頁設置

http://10.0.0.103/cacti/install/

三、下載安裝spine

[root@nms01 ~]# wget http://www.cacti.net/downloads/spine/cacti-spine-0.8.8h.tar.gz
[root@nms01 ~]# tar zxvf cacti-spine-0.8.8h.tar.gz
[root@nms01 ~]# cd cacti-spine-0.8.8h
[root@nms01 cacti-spine-0.8.8h]# ./configure 
[root@nms01 cacti-spine-0.8.8h]# make
[root@nms01 cacti-spine-0.8.8h]# make install
[root@nms01 ~]# cp /usr/local/spine/etc/spine.conf.dist /usr/local/spine/etc/spine.conf
[root@nms01 ~]# vi /usr/local/spine/etc/spine.conf
DB_Host         localhost
DB_Database     cacti
DB_User         cacti
DB_Pass         cacti
DB_Port         3306
[root@nms01 ~]# /usr/local/spine/bin/spine 
09/02/2016 04:58:04 PM - SPINE: Poller[0] FATAL: Unable to read configuration file! (Spine init)
[root@nms01 ~]# cp /usr/local/spine/etc/spine.conf /etc/spine.conf
[root@nms01 ~]# /usr/local/spine/bin/spine 
SPINE: Using spine config file [/etc/spine.conf]
SPINE: Version 0.8.8h starting
SPINE: Time: 0.0961 s, Threads: 5, Hosts: 2

其他

1.查看文件屬於那個包

[root@nms01 local]# yum provides snmpwalk

nagios

1.安裝相關依賴包

[root@nms01 ~]# yum install httpd php php-cli gcc glibc glibc-common gd gd-devel net-snmp openssl-devel wget unzip -y

2.創(chuàng)建用戶和組

[root@nms01 ~]# useradd nagios
[root@nms01 ~]# groupadd nagcmd
[root@nms01 ~]# usermod -a -G nagcmd nagios
[root@nms01 ~]# usermod -a -G nagcmd apache

3.下載nagios和nagios-plugins

[root@nms01 ~]# wget https://assets.nagios.com/downloads/nagioscore/releases/nagios-4.1.1.tar.gz
[root@nms01 ~]# wget http://nagios-plugins.org/download/nagios-plugins-2.1.1.tar.gz

4.解壓安裝nagios

[root@nms01 ~]# tar zxvf nagios-4.1.1.tar.gz
[root@nms01 ~]# cd nagios-4.1.1
[root@nms01 nagios-4.1.1]# ./configure --with-command-group=nagcmd
[root@nms01 nagios-4.1.1]# make all
[root@nms01 nagios-4.1.1]# make install
[root@nms01 nagios-4.1.1]# make install-init
[root@nms01 nagios-4.1.1]# make install-config
[root@nms01 nagios-4.1.1]# make install-commandmode
[root@nms01 nagios-4.1.1]# make install-webconf

5.修改httpd.conf文件

[root@nms01 ~]# vi /etc/httpd/conf/httpd.conf
<IfModule dir_module>
    DirectoryIndex index.html,index.php
</IfModule>

6.創(chuàng)建web訪問用戶名和密碼

[root@nms01 ~]# htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
New password: 
Re-type new password: 
Adding password for user nagiosadmin

7.安裝nagios-plugins

[root@nms01 ~]# tar xf nagios-plugins-2.1.1.tar.gz 
[root@nms01 ~]# cd nagios-plugins-2.1.1
[root@nms01 nagios-plugins-2.1.1]# ./configure --with-nagios-user=nagios --with-nagios-group=nagios --with-openssl
[root@nms01 nagios-plugins-2.1.1]# make all
[root@nms01 nagios-plugins-2.1.1]# make install

8.啟動服務並設置自啟動

[root@nms01 ~]# systemctl start httpd.service
[root@nms01 ~]# systemctl enable httpd.service
[root@nms01 ~]# service nagios start
[root@nms01 ~]# chkconfig nagios on
[root@nms01 ~]# chkconfig nagios --list
nagios         0:off1:off2:on3:on4:on5:on6:off

9.如果防火墻未關閉則做如下配置

[root@nms01 ~]# firewall-cmd --zone=public --add-port=80/tcp --permanent
[root@nms01 ~]# firewall-cmd --reload

10.訪問驗證

http://10.0.0.103/nagios/

當前標題:Centos7安裝cacti和nagios
標題路徑:http://www.chinadenli.net/article14/igpjde.html

成都網站建設公司_創(chuàng)新互聯(lián),為您提供企業(yè)建站搜索引擎優(yōu)化外貿建站響應式網站品牌網站制作域名注冊

廣告

聲明:本網站發(fā)布的內容(圖片、視頻和文字)以用戶投稿、用戶轉載內容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內容未經允許不得轉載,或轉載時需注明來源: 創(chuàng)新互聯(lián)

成都定制網站網頁設計