红联Linux门户
Linux帮助

centos7下安装adagios

发布时间:2015-10-23 10:42:35来源:linux网站作者:小卡车7号

adagios使用Djang框架,界面比原生的nagios好看,并集成了绘图,web配置nagios等多个功能。
它有个在线的demo:
http://demo.adagios.org/status
安装步骤:
https://github.com/opinkerfi/adagios/wiki/Install-guide


1.增加yum源

rpm -ihv http://opensource.is/repo/ok-release.rpm
yum update -y ok-release
yum install -y epel-release

安装epel源后,如无法使用yum,提示One of the configured repositories failed epel,需修改下epel.repo

vi /etc/yum.repos.d/epel-testing.repo
删除里面的内容,增加如下配置
[epel]
name=Extra Packages for Enterprise Linux 7 - $basearch
baseurl=http://download.fedoraproject.org/pub/epel/7/$basearch
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-7&arch=$basearch
priority=10
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7


2.安装adagios

yum --enablerepo=ok-testing install -y pnp4nagios mk-livestatus nagios git adagios okconfig acl python-setuptools nagios-plugins-all


3.配置adagios

添加你的github账号,也可以任意写个,O(∩_∩)O
cd /etc/nagios/
git init
git config user.name "yourname"
git config user.email "yourname@yourdomain.com"
git add *
git commit -m "Initial commit"

chown -R nagios /etc/nagios/* /etc/nagios/.git
setfacl -R -m group:nagios:rwx /etc/nagios/
setfacl -R -m d:group:nagios:rwx /etc/nagios/

mkdir -p /etc/nagios/adagios
pynag config --append cfg_dir=/etc/nagios/adagios

pynag config --append "broker_module=/usr/lib64/nagios/brokers/npcdmod.o config_file=/etc/pnp4nagios/npcd.cfg"
pynag config --append "broker_module=/usr/lib64/mk-livestatus/livestatus.o /var/spool/nagios/cmd/livestatus"
pynag config --set "process_performance_data=1"

usermod -G apache nagios

关闭selinux
sed -i "s/SELINUX=enforcing/SELINUX=disabled/" /etc/sysconfig/selinux
setenforce 0


4.使用nagios

设置web登录密码
htpasswd -c /etc/nagios/passwd nagiosadmin

修改nagios账号权限
visudo
在末尾添加
Defaults:nagios !requiretty
nagios ALL = (root) NOPASSWD: /etc/init.d/nagios

开启服务
service nagios restart ; chkconfig nagios on
service httpd restart ; chkconfig httpd on
service npcd restart ; chkconfig npcd on

打开浏览器,输入http://ip/adagios 即可访问了。