中文字幕av专区_日韩电影在线播放_精品国产精品久久一区免费式_av在线免费观看网站

溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

The Nagios Monitoring數據如何寫進Mysql中

發布時間:2020-06-02 11:22:49 來源:網絡 閱讀:207 作者:三月 欄目:移動開發

下文主要給大家帶來The Nagios Monitoring數據如何寫進Mysql中,希望這些內容能夠帶給大家實際用處,這也是我編輯The Nagios Monitoring數據如何寫進Mysql中這篇文章的主要目的。好了,廢話不多說,大家直接看下文吧。

-------------------------------CMAKE-------------------------------

Install the compiler tool:

#tar xzf cmake-2.8.10.2.tar.gz 
#cd cmake-2.8.10.2
#./bootstrap
#make
#make install
-------------------------------Mysql-------------------------------
Preparatory work:
#groupadd mysql
#useradd -r -g mysql mysql
#mkdir /etc/mysql
#chown mysql:mysql /etc/mysql
 
Compile & Install:
#tar xzf mysql-5.6.10.tar.gz
#cd mysql-5.6.10
#cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql \
-DMYSQL_DATADIR=/var/mysql/data \
-DSYSCONFDIR=/etc/mysql \
-DEXTRA_CHARSETS=all \
-DENABLED_LOCAL_INFILE=1
#make
#make install
 
Database initialization:
#chown -R mysql:mysql /usr/local/mysql
#mkdir -p /var/mysql/data
#chown -R mysql:mysql /var/mysql
#cd /usr/local/mysql/scripts
#./mysql_install_db --user=mysql \
--basedir=/usr/local/mysql \
--datadir=/var/mysql/data \
--skip-name-resolve
#mv ../support-files/my-default.cnf /etc/mysql/my.cnf
#mv ../support-files/mysql.server /etc/rc.d/init.d/mysqld
#service mysqld start
 
Change Password & verify that the installation was successful:
#/usr/local/mysql/bin/mysqladmin -u root password 'mysql'
#/usr/local/mysql/bin/mysql -uroot -pmysql
>status
 
-------------------------------Ndoutils-------------------------------
The ndoutils installation:
#tar xzf ndoutils-1.5.2.tar.gz
#cd ndoutils-1.5.2
#./configure --prefix=/usr/local/nagios \
--with-mysql=/usr/local/mysql \
--sysconfdir=/etc/nagios \
--with-ndo2db-user=nagios \
--with-ndo2db-group=nagios \
--enable-mysql
 
Modify the installation configuration file, otherwise it will make an error:
#vi include/config.h
#Original configuration is as follows:
#include <mysql/mysql.h>
#include <mysql/errmsg.h>
#Modified as follows
#include </usr/local/mysql/include/mysql.h>
#include </usr/local/mysql/include/errmsg.h>
 
Installation:
#make
  
Copy the compiled daemon to your Nagios installation:
#cp src/ndomod-3x.o /usr/local/nagios/bin/
#cp src/ndo2db-3x /usr/local/nagios/bin/ndo2db
#chown nagios:nagios /usr/local/nagios/bin/ndo*
 
Copy the default configuration file to the configuration directory that you specify:
#cp config/ndo2db.cfg-sample /etc/nagios/ndo2db.cfg
#cp config/ndomod.cfg-sample /etc/nagios/ndomod.cfg
#chown nagios:nagios /etc/nagios/ndo*
 
Increase to start the service:
#cp daemon-init /etc/init.d/ndo2db
#chmod u+x /etc/init.d/ndo2db
 
Create a database:
#export PATH=$PATH:/usr/local/mysql/bin/
#mysql -uroot -pmysql
>create database nagios;
>quit
 
Creating a database structure:
#cd db
#mysql -uroot -p nagios<./mysql.sql
 
Modify the Nagios configuration file:
#vim /etc/nagios/nagios.cfg
#Add by Kingcraft
broker_module=/usr/local/nagios/bin/ndomod-3x.o config_file=/etc/nagios/ndomod.cfg
 
Empowering for the database user nagios:
#mysql -u root -pmysql
>grant all privileges on nagios.* to 'nagios'@'127.0.0.1' identified by 'nagios';
>quit
 
Modify the Ndoutils configuration file:
#vim /etc/nagios/ndo2db.cfg
db_user=nagios
db_pass=nagios
db_host=127.0.0.1
 
#vim /etc/nagios/ndomod.cfg
output=127.0.0.1
 
Create soft links, or can not start:
#ln -s /usr/local/mysql/lib/libmysqlclient.so.18 /usr/lib64
 
Verify whether the nagios data can be written to the database:
#service ndo2db start
#service nagios restart
 
#mysql -u root -pmysql
>use nagios
>select host_id,display_name,address from nagios_hosts;
+---------+-----------------+-----------------+
| host_id | display_name    | address         |
+---------+-----------------+-----------------+
|       1 | Linuxhost       | 192.168.174.130 |
|       2 | linksys-srw224p | 192.168.60.16   |
+---------+-----------------+-----------------+
對于以上關于The Nagios Monitoring數據如何寫進Mysql中,大家是不是覺得非常有幫助。如果需要了解更多內容,請繼續關注我們的行業資訊,相信你會喜歡上這些內容的。

向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

大宁县| 巴中市| 徐水县| 东方市| 喀什市| 海南省| 胶州市| 石林| 洪江市| 育儿| 依安县| 桂阳县| 华亭县| 望都县| 柳林县| 颍上县| 德化县| 祁阳县| 常德市| 都匀市| 云林县| 普兰县| 那曲县| 仲巴县| 开江县| 确山县| 阳信县| 巢湖市| 车险| 格尔木市| 德阳市| 凤台县| 彭阳县| 兴国县| 甘孜| 汉源县| 平湖市| 伊宁市| 定日县| 泰宁县| 岑巩县|