个人工具

UbuntuHelp:Nagios3

来自Ubuntu中文

跳转至: 导航, 搜索

This page describes how to install and configure Nagios 3 on Ubuntu 9.04. This guide was done using Ubuntu 9.04. Appears to work ok with 9.10.

Introduction

Nagios is an open source host, service and network monitoring program. The official homepage is http://nagios.org/


导论

nagios是一个开源监控程序,它多用于监控主机,服务器以及网络。nagios的主页是http://nagios.org/

Preparations

You will first manually install Nagios 3 from the Ubuntu main repositories.

sudo apt-get install -y nagios3

This will install and configure Nagios 3 along with all the required dependencies including Apache2, Postfix and others. Postfix is used to send e-mail alerts. During the installation you will be prompted to select how you want to configure Postfix. For most setups you will select 'Internet Site' which is the default select. If you require other setup, please refer to the Postfix support page. Once Nagios has been installed you will need to create user accounts so you can login to the Nagios monitoring site. The site will be installed locally at http://localhost/nagios3 Create a 'nagiosadmin' user account so that you can login and administer the site.

sudo htpasswd -c /etc/nagios3/htpasswd.users nagiosadmin

Enter a strong password when prompted. You now have a very basic working installation of Nagios on your system (login at http://localhost/nagios3 with those credentials). It has been configured to monitor your local machine.

Post Install Tasks

Nagios 3's configuration files are located in /etc/nagios3 If you need to add new hosts or make changes to existing ones you can find them at: /etc/nagios3/conf.d All the plugin's are located at: /etc/nagios-plugins/config You might see a couple of errors which can be easily fixed. The first might be an SSH critical error if you don't have an OpenSSH server running on your local machine. You can either install OpenSSH server or remove this error warning by editing the file in /etc/nagios3/conf.d/hostgroups_nagios2.cfg and removing the localhost from the member. The second might be a hard disk check critical error related to the way Gnome is designed and how permissions are assigned to the .gvfs file in each users home directory, ex:

DISK CRITICAL - /home/rdp/.gvfs is not accessible: Permission denied

You can either give the nagios user permission to that file or just ignore the file during check. To ignore the file, edit the disk.cfg file located in /etc/nagios-plugins/config and add the arguments [-A -i '.gvfs'] at the end of the command line arguments for the command check_disk and check_all_disks.