FreeBSD 下用nagios来监控网络服务器和网络服务(1)

FreeBSD 下用nagios来监控网络服务器和网络服务

nagios可以对服务器进行全面的监控,包括服务(apache、mysql、ntp、dns、disk、qmail和sshd等等)的状态,服务器的状态(up、down等等)。它是一个完全GPL协议的开源软件包,包含有nagios主程序和它的各个插件,配置非常灵活,可以监视的项目很多,可以自定义shell脚本进行监控服务,非常适合大型网络。

nagios的包含主动监控和被动监控。

主动检查是通过监控中心的主机发出请求,让运行在远程主机上的nrpe守护进程收集信息,然后报告它,它通过web接口把数据显示在页面上。

它的工作原理如下:

 

被动监控是当远程被监控主机处于防火墙之内的时候,只有远程主机可以访问到监控中心,防火墙之内可以设置另外一个监控中心,远程监控中心的nagios收集服务器信息以后,和nsca报告,由naca客户端报告naca的服务器端,然后报告监控中心的nagios,通过web接口显示监控结果。

nagios的功能非常强大, http://www.nagios.org是它的窝,只有e文、法文和日文,没有中文,可惜啊。

俺现在引用它的一段文字进行总结一下到底什么是nagios:

What Is This?

什么是nagios?

Nagios® is a system and network monitoring application. It watches hosts and services that you specify, alerting you when things go bad and when they get better.

Nagios was originally designed to run under Linux, although it should work under most other unices as well.

Some of the many features of Nagios® include:

Monitoring of network services (SMTP, POP3, HTTP, NNTP, PING, etc.)

Monitoring of host resources (processor load, disk usage, etc.)

Simple plugin design that allows users to easily develop their own service checks

Parallelized service checks

Ability to define network host hierarchy using “parent” hosts, allowing detection of and distinction between hosts that are down and those that are unreachable

Contact notifications when service or host problems occur and get resolved (via email, pager, or user-defined method)

Ability to define event handlers to be run during service or host events for proactive problem resolution

Automatic log file rotation

Support for implementing redundant monitoring hosts

Optional web interface for viewing current network status, notification and problem history, log file, etc.

Nagios是一个监视系统和网络的应用程序。它监视你所指定主机和服务,当监视的内容变好或者变坏时发出警告。Nagios最初是被设计在Linux平台上运行的,然而现在在其他平台上也运行良好。

Nagios的特性包括:

监视网络服务(SMTP, POP3, HTTP, NNTP, PING, 等等)

监视主机资源(处理器负载、磁盘空间等)

容许用户开发自己的插件去检查自定义的项目;

通过使用“父主机”,定义网络主机的分层,容许探测主机down掉或者不可到达。

可以定义在主机或服务运行期间,事件发生以后如何处理和解决方式;

自动记录错误日志;

支持冗余监视;

可选web接口,通过web页面查看当前网络状态,提示和报告故障历史,日志文件等;

Nagios的系统要求:

Linux、Unix等

apache

GD库(1.63以上)

zlib

pnglib

jpeglib

basic icons

等,其中apache的安装在blog中已经有相关的文章,搜索一下就行;gd、zlib、pnglib和jpeglib安装比较简单,步骤:

下载tarball

tar zxvf xxx.tar.gz

cd xxx

./configure

make && make install

———————————————————————-

Nagios的安装过程(FreeBSD)

———————————————————————-

nagios的安装比较简单,复杂的是设置和配置参数的设定。不过你要放松一点,毕竟俺们要搞定它,不是吗?那就开始吧:

1:获得最新的安装包,]http://www.nagios.org/download[/url]

2:以root身份登录服务器,目前最新的版本是2.5:

1)nagios,版本2.5:

fetch ]http://superb-west.dl.sourceforge.net/sourceforge/nagios/nagios-2.5.tar.gz[/url]

or

wget ]http://superb-west.dl.sourceforge.net/sourceforge/nagios/nagios-2.5.tar.gz[/url]

2)获得nagios插件,版本1.4.3:

]http://surfnet.dl.sourceforge.net/sourceforge/nagiosplug/nagios-plugins-1.4.3.tar.gz[/url]

以下文章点击率最高

Loading…

     

如果这文章对你有帮助,请扫左上角微信支付-支付宝,给于打赏,以助博客运营

发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注