echo "test" |mutt -s "my_first_test" aaa@126.com,会自动穿件/home/nagios/sent文件
./configure --prefix 作用
不指定prefix,则可执行文件默认放在/usr/local/bin,库文件默认放在/usr/local/lib,配置文件默认放在/usr/local/etc。其它的资源文件放在/usr/local/share。你要卸载这个程序,要么在原来的make目录下用一次make uninstall(前提是make文件指定过uninstall),要么去上述目录里面把相关的文件一个个手工删掉。
指定prefix,直接删掉一个文件夹就够了。
3.下载安装解压缩
tar -zxf nagios-4.0.4.tar.gz
进入根目录
cd nagios-4.0.4/
配置
enadmin@cgnmon:~/software/nagios-4.0.4$ ./configure --prefix=/usr/local/nagios
配置
./configure --prefix=/usr/local/nagios
编译
make all
make install && make install-init && make install-commandmode && make install-config
6.使用chkconfig管理服务
ubuntu中使用chkconfig可能有bug,解决方法参考:http://blog.db89.org/ubuntu-error-in-the-chkconfig-command-prompt-sbin-insserv-no-such-file-or-directory/
sudo ln -s /usr/lib/insserv/insserv /sbin/insserv
root@ubuntu-server:/sbin# ll /sbin/insserv
lrwxrwxrwx 1 root root 24 Mar 28 09:21 /sbin/insserv -> /usr/lib/insserv/insserv*
7.Nagios 启动的时候有下面的警告:
Starting nagios:No directory, logging in with HOME=/
done.
修改/etc/passwd
nagios:x:1001:1001::/home/nagios:/bin/sh 改为:
nagios:x:1001:1001::/usr/local/nagios:/bin/sh
Error: Could not open command file ‘/usr/local/nagios/var/rw/nagios.cmd‘ for update!
The permissions on the external command file and/or directory may be incorrect. Read the FAQs on how to setup proper permissions.
问题
enadmin@ubuntu-server:~$ sudo service apache2 restart
* Restarting web server apache2
apache2: Could not reliably determine the server‘s fully qualified domain name, using 127.0.1.1 for ServerName
... waiting apache2: Could not reliably determine the server‘s fully qualified domain name, using 127.0.1.1 for ServerName
...done.
解决方法
修改 httpd.conf 文件
打开终端,输入以下命令:
sudo vim /etc/apache2/httpd.conf
默认情况下,这个是一个空文件,在文件中加入以下内容:
ServerName localhost
保存文件退出,再次重启apache,错误提示没有了。