当前位置:网站首页>Store Nagios monitoring information into MySQL
Store Nagios monitoring information into MySQL
2022-06-30 22:08:00 【Brother Xing plays with the clouds】
One 、NDOUtils Installation requirements :
Nagios: Installation method :http://www.linuxidc.com/Linux/2014-01/94658.htm
MySQL: Source installation method :http://www.linuxidc.com/Linux/2014-04/100758.htm
DBI and DBD-mysql Installation method: :
shell> perl -MCPAN -e shell
cpan> install DBI
cpan> install DBD::mysqlTwo 、 relation mysql Header files and Libraries :
No association may be made in config or make An error occurred when
ln -s /app/mysql/include/* /usr/include/
ln -s /app/mysql/lib/* /usr/lib/
echo '/usr/lib' >> /etc/ld.so.conf
ldconfig -v3、 ... and 、 install nodutils:
tar zxvf ndoutils-1.4b7.tar.gz
cd ndoutils-1.4b7
./configure --prefix=/usr/local/nagios --enable-mysql --disable-pgsql LDFLAGS=-L/app/mysql/lib --with-mysql-inc=/app/mysql/include/mysql --with-mysql-lib=/app/mysql/lib/mysql
makeFour 、 Copy files :
cp ./src/ndomod-3x.o /usr/local/nagios/bin
cp ./src/ndo2db-3x /usr/local/nagios/bin
cp ./src/log2ndo /usr/local/nagios/bin
cp ./src/file2sock /usr/local/nagios/bin
chown nagios:nagios /usr/local/nagios/bin/*5、 ... and 、 Copy configuration file :
cp ./config/ndo* /usr/local/nagios/etc/
chown nagios:nagios /usr/local/nagios/etc/*6、 ... and 、 establish ndo Of mysql Database and users
CREATE DATABASE `nagios` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
GRANT select,insert,update,delete ON nagios.* TO [email protected] identified by 'nagios';
FLUSH PRIVILEGES ;7、 ... and 、 Import database structure
cd ./db/
./installdb -u root -p 123456 -h localhost -d nagiosIf it's here root If there is no password, it needs to be modified . 8、 ... and 、 Modify the configuration file
vim /usr/local/nagios/etc/ndo2db.cfg
db_user=nagios
db_pass=nagios
socket_type=tcp
vim /usr/local/nagios/etc/nagios.cfg
broker_module=/usr/local/nagios/bin/ndomod-3x.o config_file=/usr/local/nagios/etc/ndomod.cfg
vim /usr/local/nagios/etc/ndomod.cfg
output_type=file
output=/usr/local/nagios/var/ndo.datNine 、 start-up ndo2db
/usr/local/nagios/bin/ndo2db-3x -c /usr/local/nagios/etc/ndo2db.cfgTen 、 restart nagios
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
service nagios restart11、 ... and 、 Check for correct installation
tail -f /usr/local/nagios/var/nagios.log
Errors involved :
start-up ndo Then it appears in the log :nagios ndo2db-3x: Error: mysql_query() failed for 'INSERT INTO nagios_configfilevariables SET instance_id='1', configfile_id='3', varname='cfg_file', varvalue='/usr/local/nagios//etc/objects/localhost\.cfg The solution is to use :mysql -uroot --password="canada" -h192.168.1.97 -e "alter table nagios.nagios_configfilevariables drop key instance_id;alter table nagios.nagios_configfilevariables add index (instance_id, configfile_id, varname); The table structure needs to be modified . alter table nagios.nagios_configfilevariables drop key instance_id; alter table nagios.nagios_configfilevariables add index (instance_id, configfile_id, varname);
tcp Connect Mysql /usr/local/nagios/bin/file2sock -s /usr/local/nagios/var/ndo.dat -d localhost -t tcp -p 5668
边栏推荐
- JD and Tencent renewed the three-year strategic cooperation agreement; The starting salary rose to 260000 yuan, and Samsung sk of South Korea scrambled for a raise to retain semiconductor talents; Fir
- 周少剑,很少见
- 1-10 respond to client content according to different URLs
- Jupyterbook clear console output
- Inventory the six second level capabilities of Huawei cloud gaussdb (for redis)
- 阿婆做的臭豆腐
- [backtracking] full arrangement II leetcode47
- Excitatory neurotransmitter glutamate and brain health
- 《安富莱嵌入式周报》第271期:2022.06.20--2022.06.26
- Web APIs comprehensive case -tab column switching - dark horse programmer
猜你喜欢

Domestic database disorder

Win11如何优化服务?Win11优化服务的方法

Niubi | the tools I have treasured for many years have made me free to fish with pay

Go Web 编程入门: 一探优秀测试库 GoConvey

JVM Part 21 of interview with big companies Q & A

Akk bacteria - the next generation of beneficial bacteria

电脑版微信文件存储在哪个文件夹可以找到

国产数据库乱象

Open the jupyter notebook/lab and FAQ & settings on the remote server with the local browser

《安富莱嵌入式周报》第271期:2022.06.20--2022.06.26
随机推荐
Uniapp life cycle / route jump
Nansen复盘加密巨头自救:如何阻止百亿多米诺倾塌
电脑版微信文件存储在哪个文件夹可以找到
Niubi | the tools I have treasured for many years have made me free to fish with pay
Ml & DL: introduction to hyperparametric optimization in machine learning and deep learning, evaluation index, over fitting phenomenon, and detailed introduction to commonly used parameter adjustment
1-1 basic concepts of database
机器学习工作要求研究生吗?
1-11 create online file service
WinDbg debugging tool introduction
Document Layout Analysis: A Comprehensive Survey 2019论文学习总结
1-7 path module
Uniapp third party network request
[micro service ~nacos] configuration center of Nacos
1-13 express listens to get and post requests & processes requests
PostgreSQL存储结构浅析
Modify the name of the launched applet
Which direction should college students choose to find jobs after graduation?
腾讯3年,功能测试进阶自动化测试,送给在手工测试中迷茫的你
[career planning for Digital IC graduates] Chap.1 overview of IC industry chain and summary of representative enterprises
The programmer's girlfriend gave me a fatigue driving test