标签:ali 检查 oca roc 用户 efi chmod check objects
一、服务端配置:yum -y install nagios nagios-plugins nagios-plugins-all nagios-plugins-nrpe nrpe
cfg_dir=/etc/nagios/conf.d #确保其中有这行代码
authorized_for_system_information=nagiosadmin,lee
authorized_for_configuration_information=nagiosadmin,lee
authorized_for_system_commands=nagiosadmin,lee
authorized_for_all_services=nagiosadmin,lee
authorized_for_all_hosts=nagiosadmin,lee
authorized_for_all_service_commands=nagiosadmin,lee
authorized_for_all_host_commands=nagiosadmin,lee
#添加
define command{
command_name check_nrpe
command_line $USER1/check_nrpe -H $HOSTADDRESS -c $ARG1
}
define contact{
contact_name nagiosadmin
use generic-contact
alias Nagios Admin
email complet@163.com
}
define contactgroup{
contactgroup_name admins
alias Nagios Administrators
members nagiosadmin
}
/etc/nagios/objects/localhost.cfg
作为模板):define host{
use linux-server
host_name lee
alias lee
address 192.168.8.82
}
#去掉这组定义
#define hostgroup{
# hostgroup_name linux-servers
# alias Linux Servers
# members lee
# }
define service{
use local-service
host_name lee
service_description PING
check_command check_ping!100.0,20%!500.0,60%
}
define service{
use local-service
host_name lee
service_description Root Partition
check_command check_local_disk!20%!10%!/
}
define service{
use local-service
host_name lee
service_description Current Users
check_command check_local_users!20!50
}
define service{
use local-service
host_name lee
service_description Total Processes
check_command check_local_procs!250!400!RSZDT
}
define service{
use local-service
host_name lee
service_description Current Load
check_command check_local_load!5.0,4.0,3.0!10.0,6.0,4.0
}
define service{
use local-service
host_name lee
service_description Swap Usage
check_command check_local_swap!20!10
}
define service{
use local-service
host_name lee
service_description SSH
check_command check_ssh
notifications_enabled 0
}
define service{
use local-service
host_name lee
service_description HTTP
check_command check_http
notifications_enabled 0
}
nagios -v /etc/nagios/nagios.cfg
chown nagios.nagios /etc/logrotate.d/nagios
chmod g+w /etc/logrotate.d/nagios
chown -R nagios.nagios /etc/nagios
htpasswd -c /etc/nagios/passwd lee
systemctl start httpd
systemctl start nagios
二、客户端配置:
yum -y install nagios-plugins nagios-plugins-nrpe nrpe
#添加服务端ip
allowed_hosts=127.0.0.1,192.168.8.81
systemctl start nrpe
三、测试:
标签:ali 检查 oca roc 用户 efi chmod check objects
原文地址:http://blog.51cto.com/12173069/2070827