当前位置: > Linux服务器 > 监控工具 >

nginx配置nagios之nagios配置文件

时间:2014-10-26 01:32来源:linux.it.net.cn 作者:it

nagios配置文件

nagios文件应该处于conf/domain/目录下。
nagios配置:
 

复制代码代码示例:
server  
{  
        listen       80;  
        server_name  192.168.44.44;  
        index index.html index.htm index.php;  
        root  /usr/local/nagios/share;  
        auth_basic "Nagios Access";  
        auth_basic_user_file /usr/local/nagios/etc/nagiospasswd;  
  
        location ~ .*\.(php|php5)?$  
        {  
                # root /usr/local/nagios/share;  
                # fastcgi_pass  unix:/export/servers/nginx/logs/php-cgi.sock;  
                fastcgi_pass  127.0.0.1:9000;  
                fastcgi_index index.php;  
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;  
                #include fcgi.conf;  
                include /export/servers/nginx/conf/fastcgi_params;  
        }  
  # www.jbxue.com
        location ~ \.cgi$  
        {  
                root  /usr/local/nagios/share;  
                rewrite ^/nagios/cgi-bin/(.*)\.cgi /$1.cgi break;  
                fastcgi_pass unix:/export/servers/nginx/logs/perl-fcgi.sock;  
                fastcgi_index index.cgi;  
                #fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;  
                fastcgi_param SCRIPT_FILENAME /usr/local/nagios/sbin$fastcgi_script_name;  
                #fastcgi_param HTTP_ACCEPT_LANGUAGE en_US;  
                include fastcgi_params;  
        }  
  
        location ~ \.pl$  
        {  
                root  /usr/local/nagios/share;  
                fastcgi_pass  unix:/export/servers/nginx/logs/nginx-fcgi.sock;  
                fastcgi_index index.pl;  
                #fastcgi_param SCRIPT_FILENAME  $document_root$fastcgi_script_name;  
                fastcgi_param SCRIPT_FILENAME /usr/local/nagios/sbin$fastcgi_script_name;  
                include /export/servers/nginx/conf/fastcgi_params;  
        }  
  
        location /nagios/  
        {  
                gzip off;  
                alias /usr/local/nagios/share/;  
        }  
  
        location /stylesheets  
        {  
                gzip off;  
                alias /usr/local/nagios/share/stylesheets;  
        }  
  
        location /pub  
        {  
                gzip off;  
                alias /usr/local/nagios/share/docs;  
        }  
  
        location /pnp4nagios {  
                alias /usr/local/pnp4nagios/share;  
                index index.php;  
                try_files $uri $uri/ @pnp4nagios;  
        }  
  
        location @pnp4nagios {  
                fastcgi_pass  127.0.0.1:9000;  
                fastcgi_index       index.php;  
                include        fastcgi_params;  
                fastcgi_split_path_info ^(.+\.php)(.*)$;  
                fastcgi_param PATH_INFO $fastcgi_path_info;  
                fastcgi_param SCRIPT_FILENAME /usr/local/pnp4nagios/share/index.php;  
        }    
 
 
(责任编辑:IT)
------分隔线----------------------------