怎样进行Nagios客户端安装
Nagios是一个开源的监控系统,可以用来监控网络服务器、网络设备、应用程序等。Nagios使用一个叫做Nagios客户端的程序来进行监控。下面我们就来介绍一下如何进行Nagios客户端的安装。
首先,下载Nagios客户端的安装包,目前最新的版本是3.5.1。下载地址为:
https://www.nagios.org/downloads/nagios-core/
下载完成后,解压安装包。
tar -xzf nagios-core-3.5.1.tar.gz
进入解压后的目录,执行以下命令来进行安装。
./configure --with-nagios-user=nagios --with-nagios-group=nagios
make all
make install
make install-init
make install-commandmode
make install-config
make install-webconf
安装完成后,需要执行以下命令来创建Nagios的web管理用户。
htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
创建完成后,需要重新启动Nagios。
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
如果一切正常,则会看到以下输出:
Nagios Core 3.5.1
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 2018-07-26
License: GPL
Website: https://www.nagios.org
Reading configuration data...
Read main config file okay...
Processing object config file '/usr/local/nagios/etc/objects/commands.cfg'...
Processing object config file '/usr/local/nagios/etc/objects/contacts.cfg'...
Processing object config file '/usr/local/nagios/etc/objects/timeperiods.cfg'...
Processing object config file '/usr/local/nagios/etc/objects/templates.cfg'...
Processing object config file '/usr/local/nagios/etc/objects/localhost.cfg'...
Read object config files okay...
Running pre-flight check on configuration data...
Checking objects...
Checked 8 services.
Checked 1 hosts.
Checked 1 host groups.
Checked 0 service groups.
Checked 1 contacts.
Checked 1 contact groups.
Checked 2 commands.
Checked 5 time periods.
Checked 0 host escalations.
Checked 0 service escalations.
Checking for circular paths...
Checked 1 hosts
Checked 0 service dependencies
Checked 0 host dependencies
Checked 5 timeperiods
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...
Total Warnings: 0
Total Errors: 0
Things look okay - No serious problems were detected during the pre-flight check
Finished pre-flight check on configuration data
Nagios Core 3.5.1 starting... (PID=31559)
如果看到以上输出,则说明Nagios客户端安装成功。
安装完成后,可以通过以下地址来访问Nagios的web界面:
http://your_server_ip/nagios
使用刚才创建的用户名和密码来登录。
登录成功后,就可以看到Nagios的监控界面了。
相关文章