#以上避免了使用make install报错,报错内容查看博客结尾.具体原因不清楚,有知道的麻烦回帖告知.
make install-init #安装初始化,貌似make fullinstall有了安装,但无所谓
make install-config #安装配置
make install-commandmode #安装命令模式
4)自定义配置
vi /usr/local/nagios/etc/objects/contacts.cfg #在里面修改,如email
5)安装web接口,以便通过浏览器可以访问到nagios
make install-webconf
htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin #给nagios设置用户和密码
/etc/init.d/apache2 reload #重载,让新设置的用户和密码生效
6)编译nagios插件
cd ~/downloads
tar xzf nagios-plugins-1.4.15.tar.gz
cd nagios-plugins-1.4.15
./configure --with-nagios-user=nagios --with-nagios-group=nagios
make
make install
7)启动nagios
ln -s /etc/init.d/nagios /etc/rcS.d/S99nagios #让nagios随机启动
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg #验证naios配置文件是否正确
/etc/init.d/nagios start #启动nagios
8)通过浏览器进入nagios控制台
#再输入刚配置的用户nagiosadmin和你设置的密码
最后附上用make install安装nagios时所报错误
root@:/media/europa/callisto/nagios___/nagios-3.3.1/nagios# make install cd ./base && make install make[1]: Entering directory `/media/europa/callisto/nagios___/nagios-3.3.1/nagios/base' make install-basic make[2]: Entering directory `/media/europa/callisto/nagios___/nagios-3.3.1/nagios/base' /usr/bin/install -c -m 775 -o nagios -g nagios -d /usr/local/nagios/bin /usr/bin/install -c -m 774 -o nagios -g nagios nagios /usr/local/nagios/bin /usr/bin/install -c -m 774 -o nagios -g nagios nagiostats /usr/local/nagios/bin make[2]: Leaving directory `/media/europa/callisto/nagios___/nagios-3.3.1/nagios/base' make strip-post-install make[2]: Entering directory `/media/europa/callisto/nagios___/nagios-3.3.1/nagios/base' /usr/bin/strip /usr/local/nagios/bin/nagios /usr/bin/strip /usr/local/nagios/bin/nagiostats make[2]: Leaving directory `/media/europa/callisto/nagios___/nagios-3.3.1/nagios/base' make[1]: Leaving directory `/media/europa/callisto/nagios___/nagios-3.3.1/nagios/base' cd ./cgi && make install make[1]: Entering directory `/media/europa/callisto/nagios___/nagios-3.3.1/nagios/cgi' make install-basic make[2]: Entering directory `/media/europa/callisto/nagios___/nagios-3.3.1/nagios/cgi' /usr/bin/install -c -m 775 -o nagios -g nagios -d /usr/local/nagios/sbin for file in *.cgi; do \ /usr/bin/install -c -m 775 -o nagios -g nagios $file /usr/local/nagios/sbin; \ done make[2]: Leaving directory `/media/europa/callisto/nagios___/nagios-3.3.1/nagios/cgi' make strip-post-install make[2]: Entering directory `/media/europa/callisto/nagios___/nagios-3.3.1/nagios/cgi' for file in *.cgi; do \ /usr/bin/strip /usr/local/nagios/sbin/$file; \ done make[2]: Leaving directory `/media/europa/callisto/nagios___/nagios-3.3.1/nagios/cgi' make[1]: Leaving directory `/media/europa/callisto/nagios___/nagios-3.3.1/nagios/cgi' cd ./html && make install make[1]: Entering directory `/media/europa/callisto/nagios___/nagios-3.3.1/nagios/html' /usr/bin/install -c -m 775 -o nagios -g nagios -d /usr/local/nagios/share /usr/bin/install -c -m 775 -o nagios -g nagios -d /usr/local/nagios/share/media /usr/bin/install -c -m 775 -o nagios -g nagios -d /usr/local/nagios/share/stylesheets /usr/bin/install -c -m 775 -o nagios -g nagios -d /usr/local/nagios/share/contexthelp /usr/bin/install -c -m 775 -o nagios -g nagios -d /usr/local/nagios/share/docs /usr/bin/install -c -m 775 -o nagios -g nagios -d /usr/local/nagios/share/docs/images /usr/bin/install -c -m 775 -o nagios -g nagios -d /usr/local/nagios/share/images /usr/bin/install -c -m 775 -o nagios -g nagios -d /usr/local/nagios/share/images/logos /usr/bin/install -c -m 775 -o nagios -g nagios -d /usr/local/nagios/share/includes /usr/bin/install -c -m 775 -o nagios -g nagios -d /usr/local/nagios/share/includes/rss /usr/bin/install -c -m 775 -o nagios -g nagios -d /usr/local/nagios/share/includes/rss/extlib /usr/bin/install -c -m 775 -o nagios -g nagios -d /usr/local/nagios/share/ssi /usr/bin/install -c -m 664 -o nagios -g nagios robots.txt /usr/local/nagios/share rm -f /usr/local/nagios/share/index.html rm -f /usr/local/nagios/share/main.html rm -f /usr/local/nagios/share/side.html for file in *.php; \ do /usr/bin/install -c -m 664 -o nagios -g nagios $file /usr/local/nagios/share; done for file in stylesheets/*.css; \ do /usr/bin/install -c -m 664 -o nagios -g nagios $file /usr/local/nagios/share/stylesheets; done for file in contexthelp/*.html; \ do /usr/bin/install -c -m 664 -o nagios -g nagios $file /usr/local/nagios/share/contexthelp; done for file in images/*.gif; \ do /usr/bin/install -c -m 664 -o nagios -g nagios $file /usr/local/nagios/share/images; done for file in images/*.jpg; \ do /usr/bin/install -c -m 664 -o nagios -g nagios $file /usr/local/nagios/share/images; done for file in images/*.png; \ do /usr/bin/install -c -m 664 -o nagios -g nagios $file /usr/local/nagios/share/images; done for file in images/*.ico; \ do /usr/bin/install -c -m 664 -o nagios -g nagios $file /usr/local/nagios/share/images; done for file in images/logos/*.*; \ do /usr/bin/install -c -m 664 -o nagios -g nagios $file /usr/local/nagios/share/images/logos; done for file in includes/*.*; \ do /usr/bin/install -c -m 664 -o nagios -g nagios $file /usr/local/nagios/share/includes; done for file in includes/rss/*; \ do /usr/bin/install -c -m 664 -o nagios -g nagios $file /usr/local/nagios/share/includes/rss; done /usr/bin/install: omitting directory `includes/rss/extlib' /usr/bin/install: omitting directory `includes/rss/htdocs' /usr/bin/install: omitting directory `includes/rss/scripts' make[1]: *** [install] Error 1 make[1]: Leaving directory `/media/europa/callisto/nagios___/nagios-3.3.1/nagios/html' make: *** [install] Error 2 root@:/media/europa/callisto/nagios___/nagios-3.3.1/nagios#