<body><script type="text/javascript"> function setAttributeOnload(object, attribute, val) { if(window.addEventListener) { window.addEventListener('load', function(){ object[attribute] = val; }, false); } else { window.attachEvent('onload', function(){ object[attribute] = val; }); } } </script> <div id="navbar-iframe-container"></div> <script type="text/javascript" src="https://apis.google.com/js/platform.js"></script> <script type="text/javascript"> gapi.load("gapi.iframes:gapi.iframes.style.bubble", function() { if (gapi.iframes && gapi.iframes.getContext) { gapi.iframes.getContext().openChild({ url: 'https://www.blogger.com/navbar.g?targetBlogID\x3d4684235500622716427\x26blogName\x3dCaiwangqin\x27s+blog\x26publishMode\x3dPUBLISH_MODE_HOSTED\x26navbarType\x3dBLUE\x26layoutType\x3dCLASSIC\x26searchRoot\x3dhttp://blog.caiwangqin.com/search\x26blogLocale\x3dzh_CN\x26v\x3d2\x26homepageUrl\x3dhttp://blog.caiwangqin.com/\x26vt\x3d3393395200455623441', where: document.getElementById("navbar-iframe-container"), id: "navbar-iframe" }); } }); </script>

Caiwangqin's blog

Focus on Life, Cloud Service, Smart Hardware, Architecture, Technic and beyond…

Setup Cacti on EC2 Amazon Linux AMI

2012年8月17日星期五


  • Install Nginx 
sudo yum install nginx
config nginx: 
server {
        listen 8080;
        server_name monitor.domain.com;
        root /usr/share/cacti/;
        index index.php index.html;
        try_files $uri $uri/ /index.php;
        location ~ \.php$ {
                fastcgi_pass   unix:/tmp/php5-fpm.sock;
                fastcgi_index  index.php;
                fastcgi_param  SCRIPT_FILENAME $document_root$fastcgi_script_name;
                include        fastcgi_params;
        }
        location ~* \.(?:ico|css|js|gif|jpe?g|png)$ {
                expires max;
                add_header Pragma public;
                add_header Cache-Control "public, must-revalidate, proxy-revalidate";
        }
    }
  • Install php-fpm
 sudo yum install php-fpm
 config php-fpm: /etc/php-fpm.d/www.conf
 listen = /tmp/php5-fpm.sock
/etc/init.d/php-fpm start 
  • Install Cacti
sudo yum install cacti
update database in: /etc/cacti/db.php 
  • Setup Cacti spine
sudo yum install net-snmp-devel 
http://www.cacti.net/spine_install_rhlnx.php 
tar xvzf cacti-spine-0.8.7.tar.gzcd spine-0.8.7./configuremake 
Open: http://monitor.domain.com, login with admin/admin
 Console->Settings->Paths, Set Spine Poller File Path to: /usr/local/spine/bin/spine
 Console->Settings->Poller, Set Poller Type to: spine
  • Config SNMPD
sudo vi /etc/snmp/snmpd.conf
access  notConfigGroup ""      any       noauth    exact  all none none
view all    included  .1                               80
sudo /etc/init.d/snmpd restart
snmpwalk -v 2c -c public your_remote_ip system
snmpwalk -v 2c -c public your_remote_ip if
Reference: 
http://www.cnblogs.com/taosim/articles/2557762.html
http://docs.cacti.net/manual:087:4_help.2_debugging#debugging 

  • View graphs




posted by Caiwangqin, 22:50

5 Comments:

时间 2012年8月20日 15:21 , Blogger Caiwangqin 说...

for remote snmp:

add below into /etc/snmp/snmpd.conf

rocommunity jetlunserver
includeAllDisks
disk /
disk /var/data
disk /var/data2

 
时间 2012年8月20日 15:29 , Blogger Caiwangqin 说...

vi /etc/sysconfig/snmpd

OPTIONS="-LS0-6d -Lf /dev/null -p /var/run/snmpd.pid -a -x 0.0.0.0:161"

 
时间 2012年8月20日 17:29 , Blogger Caiwangqin 说...

http://www.percona.com/doc/percona-monitoring-plugins/cacti/mongodb-templates.html

Once the SSH connection is working, confirm that you can login to MongoDB from with the “mongo” cli tool. From this tool, confirm that the serverStatus command is present by running:

db._adminCommand({serverStatus : 1});

This should produce quite a bit of output. With all of this confirmed, test one of your hosts with the command below. You may need to change some of the example values below, such as the cacti username and the hostname you’re connecting to:

su - cacti -c 'env -i php /var/www/cacti/scripts/ss_get_by_ssh.php --type mongodb --host 127.0.0.1 --items jc,jd'

 
时间 2012年8月21日 10:16 , Blogger Caiwangqin 说...

http://docs.cacti.net/plugin:ugroup#installation

usually monitor, thold, settings plugin is needed

 
时间 2012年8月21日 11:14 , Blogger Caiwangqin 说...

Setup Nginx graph:

sudo passenger-install-nginx-module

select 2. No: I want to customize my Nginx installation. (for advanced users)

Where is your Nginx source code located?

Please specify the directory: /tmp/nginx-1.2.3

Extra Nginx configure options

If you want to pass extra arguments to the Nginx 'configure' script, then
please specify them. If not, then specify nothing and press Enter.

If you specify nothing then the 'configure' script will be run as follows:

sh ./configure --prefix='/opt/nginx' --with-http_ssl_module --with-http_gzip_static_module --with-cc-opt='-Wno-error' --with-pcre='/tmp/root-passenger-15137/pcre-8.30' --add-module='/usr/lib64/ruby/gems/1.8/gems/passenger-3.0.15/ext/nginx'

Extra arguments to pass to configure script: --with-http_stub_status_module

--------------------------------------------

Confirm configure flags

The Nginx configure script will be run as follows:

sh ./configure --prefix='/opt/nginx' --with-http_ssl_module --with-http_gzip_static_module --with-cc-opt='-Wno-error' --with-pcre='/tmp/root-passenger-15137/pcre-8.30' --add-module='/usr/lib64/ruby/gems/1.8/gems/passenger-3.0.15/ext/nginx' --with-http_stub_status_module

Is this what you want? (yes/no) [default=yes]: yes

 

发表评论

订阅 博文评论 [Atom]

<< 主页