http://www.monitorix.org/doc_debian.html ==安装== 首先使用root用户执行如下命令:
echo "deb http://apt.izzysoft.de/ubuntu generic universe" >> /etc/apt/sources.list wget http://apt.izzysoft.de/izzysoft.asc apt-key add izzysoft.asc rm izzysoft.asc这样apt-get就可以找到monitorix包了。 apt-get update apt-get install monitorix
root@lunaserver001:~# apt-get install monitorix Reading package lists... Done Building dependency tree Reading state information... Done The following extra packages will be installed: libdbi-perl libdbi1 libemail-date-format-perl libmime-lite-perl libmime-types-perl libnet-daemon-perl libplrpc-perl librrd4 librrds-perl libxml-namespacesupport-perl libxml-sax-base-perl libxml-sax-expat-perl libxml-sax-perl libxml-simple-perl nullmailer rrdtool ttf-dejavu ttf-dejavu-extra The following NEW packages will be installed: libdbi-perl libdbi1 libemail-date-format-perl libmime-lite-perl libmime-types-perl libnet-daemon-perl libplrpc-perl librrd4 librrds-perl libxml-namespacesupport-perl libxml-sax-base-perl libxml-sax-expat-perl libxml-sax-perl libxml-simple-perl monitorix nullmailer rrdtool ttf-dejavu ttf-dejavu-extra 0 upgraded, 19 newly installed, 0 to remove and 80 not upgraded. Need to get 5,567 kB of archives. After this operation, 12.6 MB of additional disk space will be used. Do you want to continue [Y/n]? y=== Run monitorix with NGINX ===
apt-get install libfcgi-perl wget http://nginxlibrary.com/downloads/perl-fcgi/fastcgi-wrapper -O /usr/bin/fastcgi-wrapper.pl wget http://nginxlibrary.com/downloads/perl-fcgi/perl-fcgi -O /etc/init.d/perl-fcgi chmod +x /usr/bin/fastcgi-wrapper.pl chmod +x /etc/init.d/perl-fcgi update-rc.d perl-fcgi defaults /etc/init.d/perl-fcgi startmonitorix的nginx配置文件位于/etc/nginx/sites-enabled中,是直接配置在luna-server的nginx配置文件中, vi /etc/nginx/sites-enabled/luna-server-nginx.conf, 内容如下:
server {
####
#for monitorix
location /monitorix {
index index.html;
}
location ~ \.pl|cgi$ {
# try_files $uri =404;
gzip off;
fastcgi_pass 127.0.0.1:8999;
fastcgi_index index.pl;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Originating-IP $remote_addr;
proxy_set_header HTTP_REMOTE_ADDR $remote_addr;
proxy_set_header REMOTE_ADDR $remote_addr;
}
####
}
然后将montrix的文件链接到luna-server的public目录:
ln -s /usr/share/monitorix /usr/local/luna-server/public/monitorix
将 /etc/monitorix.conf文件的$BASE_CGI调整一下,像这样:our $BASE_CGI = "/cgi-bin";
然后,将/usr/share/monitorix/index.html文件的form的action修改成: