温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

nagios如何安装配置

发布时间:2021-10-21 11:53:50 来源:亿速云 阅读:112 作者:小新 栏目:移动开发

这篇文章主要为大家展示了“nagios如何安装配置”,内容简而易懂,条理清晰,希望能够帮助大家解决疑惑,下面让小编带领大家一起研究并学习一下“nagios如何安装配置”这篇文章吧。

1安装前准备:
Apache2
GCC编译器与开发库
GD库与开发库
php

2创建帐号:
/usr/sbin/useradd nagios --创建帐号组
mkdir /usr/local/nagios --创建安装目录
chown nagios:nagios /usr/local/nagios  --修改目录权限
usermod -G nagios apache --将Web帐号加入nagios组,可以在web操作。


3安装:
wget http://ncu.dl.sourceforge.net/project/nagios/nagios-3.x/nagios-3.2.3/nagios-3.2.3.tar.gz
tar -zxvf nagios-3.2.3.tar.gz
./configure --prefix=/usr/local/nagios
make all
make install   -- This installs the main program, CGIs, and HTML files
make install-init  -- This installs the init script in /etc/rc.d/init.d
make install-commandmode -- This installs and configures permissions on the
make install-config  -- This installs *SAMPLE* config files in /usr/local/nagios/etc
make install-webconf  -- This installs the Apache config file for the Nagios

4.配置文件:
more /etc/httpd/conf.d/nagios.conf
¥¥¥AuthUserFile /usr/local/nagios/etc/htpasswd.users
cp /etc/httpd/conf.d/nagios.conf /var/www/html/
nagios页面访问账号:
/usr/bin/htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
New password:     --nagiosadmin 帐号权限已经默认设置了。
Re-type new password:    --配置文件看/usr/local/nagios/etc/nagios.cfg
Adding password for user root  --重点/usr/local/nagios/etc/cgi.cfg

这里注意: nagiosadmin作为默认用户是用从WEB页面直接操作CGI功能,换句话说也就可以在页面中直接进行操作,如果需要修改用户名,那么需要在/usr/local/nagios/etc/cgi.cfg 赋予新永明WEB页面操作权限,当然一般使用nagios就不建议采用页面操作。


log日志
touch /usr/local/nagios/var/nagios.log
chown nagios:nagios /usr/local/nagios/var/nagios.log
5.配置开机启动:
设置nagios为开机启动
[root@localhostnagios]# chkconfig nagios on
[root@localhostnagios]# service nagios start
[root@localhost soft]# service httpd restart
6.测试
http://192.168.28.X/nagios/

安装首要插件:nagios-plugins

以上是“nagios如何安装配置”这篇文章的所有内容,感谢各位的阅读!相信大家都有了一定的了解,希望分享的内容对大家有所帮助,如果还想学习更多知识,欢迎关注亿速云行业资讯频道!

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI