参考文档 http://www.cnblogs.com/mchina/archive/2013/02/20/2883404.html
安装:
监控机
apt-get install icinga nagios-plugins nagios-plugins-contrib nangios-nrpe-pluginsnagios-nrpe-server
copy (360)里的案例 icinga-example.tar.gz
客户端 (批量操作时要包括监控机都要安装这个)
apt-get install nagios-plugins nagios-nrpe-plugins nagios-nrpe-server
再下载安装Sys-Statistics-Linux-0.66 (我的360)
http://exchange.nagios.org/directory/Plugins/Operating-Systems/Linux/check_linux_stats/details
再拷贝plugins 在 /usr/lib/nagios/plugins 下 (我的360)
cd /usr/lib/nagios/plugins
sudo chmod 755 ./*
sudo chown root:nagios resource.cfg
copy(我的360) 里的nrpe.conf 替换/etc/nagios/下面的
注意修改里面的 allowed_hosts=
/usr/lib/nagios/plugins/check_nrpe -H IP -c check_(all innrpe.cfg)
usr/lib/nagios/plugins 所有插件 可以在nrpe.cfg里定义命令的插件
安装fcgiwrap 并修改端口
cd /etc/nginx/scgi_params
scgi_param REQUEST_METHOD $request_method;
scgi_param REQUEST_URI $request_uri;
scgi_param QUERY_STRING $query_string;
scgi_param CONTENT_TYPE $content_type;
scgi_param DOCUMENT_URI $document_uri;
scgi_param DOCUMENT_ROOT $document_root;
scgi_param SCGI 1;
scgi_param SERVER_PROTOCOL $server_protocol;
scgi_param REMOTE_ADDR $remote_addr;
scgi_param REMOTE_PORT $remote_port;
scgi_param SERVER_PORT $server_port;
scgi_param SERVER_NAME $server_name;
cat /etc/nginx/site-enabled/icinga
#server {
#
# listen 80;
#
# server_name 192.168.122.101;
#
# auth_basic "Restricted Nagios Area!";
#
# auth_basic_user_file /etc/icinga/htpasswd.users;
#
# charset utf-8;
#
# root /usr/share/icinga/htdocs;
#
#
# if ($host != "192.168.122.101" ) {
# rewrite ^ http://192.168.122.101$request_uri permanent;
# }
#
# index index.php index.html index.htm;
#
# location = /robots.txt {
# allow all;
# log_not_found off;
# access_log off;
# }
# #Deny all attempts to access hidden files such as .htaccess, .htpasswd
# location ~ /\. {
# deny all;
# access_log off;
# log_not_found off;
# }
# location /icinga {
# alias /usr/share/icinga/htdocs;
# index index.html;
# auth_basic "Icinga Access";
# auth_basic_user_file /etc/icinga/htpasswd.users;
# }
# location / {
# auth_basic "Icinga Access";
# auth_basic_user_file /etc/icinga/htpasswd.users;
# }
# location /icinga/stylesheets {
# alias /etc/icinga/stylesheets;
# }
# location /stylesheets {
# alias /etc/icinga/stylesheets;
# }
# location /icinga/images {
# alias /usr/share/icinga/htdocs/images;
# }
# location ~ \.cgi$ {
#
# root /usr/lib/cgi-bin/icinga;
#
# rewrite ^/cgi-bin/icinga/(.*)$ /$1;
#
# include /etc/nginx/fastcgi_params;
#
# fastcgi_pass 127.0.0.1:8900;
#
# fastcgi_param AUTH_USER $remote_user;
#
# fastcgi_param REMOTE_USER $remote_user;
#
# fastcgi_param SCRIPT_FILENAME /usr/lib/cgi-bin/icinga$fastcgi_script_name;
#
# }
#
#}