observium和librenms常用配置

librenms.conf  nginx配置

server {
 listen      80;
 server_name librenms.XXX.com;
 root        /opt/librenms/html/;
 index       index.php;

        location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ {expires 30d;}
        location ~ .*\.(js|css)?$ { expires 12h;}

 location / { try_files $uri $uri/ /index.php?$query_string; }
 location /api/v0 { try_files $uri $uri/ /api_v0.php?$query_string; }
 location ~ \.php {
  include fastcgi.conf;
  fastcgi_split_path_info ^(.+\.php)(/.+)$;
  fastcgi_pass unix:/dev/shm/librenms.sock;
  fastcgi_param SCRIPT_FILENAME $request_filename;
}
 location ~ /\.ht { deny all; }
}

 

observium.conf nginx配置

server {
    listen 80;
    root /opt/observium/html/;
    index index.php;
    server_name   observium.XXX.com;
    error_log /var/log/nginx/observium.error.log ;
    access_log /var/log/nginx/observium.log ;

 location / { try_files $uri $uri/ /index.php?$query_string; }
 location /api/v0 { try_files $uri $uri/ /api_v0.php?$query_string; }
 location ~ \.php {
  include fastcgi.conf;
  fastcgi_split_path_info ^(.+\.php)(/.+)$;
  fastcgi_pass unix:/dev/shm/php-fpm.sock;
  fastcgi_param SCRIPT_FILENAME $request_filename;
 }
}

 

observium.sh  升级迭代版本

cd /opt
mv observium observium_old
wget  http://www.observium.org/observium-community-latest.tar.gz -O -|tar xz
mv /opt/observium_old/{rrd,logs,config.php} /opt/observium/
/opt/observium/discovery.php -u
/opt/observium/discovery.php -h all
rm -rf observium_old

添加新评论 »