Friday, April 25, 2014

Cacti on Nginx on CentOS 6

http://forums.cacti.net/viewtopic.php?f=6&t=49363

http://better.blog.51cto.com/1886029/1199143


1. Setup Webserver (nginx-1.4.7) see file compile_nginx.txt
2. Setup mysql
3. Setup cacti
- Setup service snmp
#yum install net-snmp net-snmp-utils net-snmp-devel

- compile rrdtool
#yum install cairo-devel pango-devel libxml2-devel
#cd /data/tools
#wget http://oss.oetiker.ch/rrdtool/pub/rrdtool.tar.gz
#tar -zxvf rrdtool.tar.gz
#cd rrdtool-4.8
#./configure
#make && make install

#cd ..
#wget http://www.cacti.net/downloads/cacti-0.8.8b.tar.gz
#tar -zxvf cacti-0.8.8b.tar.gz
copy source cacti-0.8.8b to folder documentroot of webserver
#mv cacti-0.8.8b /zserver/nginx-1.4.7/html/cacti

#cd ..
#wget http://www.cacti.net/downloads/spine/cacti-spine-0.8.8b.tar.gz
#tar -zxvf cacti-spine-0.8.8b.tar.gz
#cd cacti-spine-0.8.8b
#./configure
#make && make install
- Config db for spine
#vi /usr/local/spine/etc/spine.conf
-----config db--------
:wq!

- setting spine
Into "Console" --> "Setting" --> "Paths" --> "Spine Poller File Path" = "/usr/local/spine/bin/spine" --> "Save"


- Test
#snmpwalk -v 1 -c cmn -O e 10.0.0.200

- Install plugins
http://docs.cacti.net/plugin

1. monitor
#cd /data/tools
#wget http://docs.cacti.net/_media/plugin:monitor-v1.3-1.tgz
#mv plugin:monitor-v1.3-1.tgz monitor-v1.3-1.tgz
#tar -zxvf monitor-v1.3-1.tgz
#mv monitor /zserver/nginx-1.4.7/html/cacti/plugins/
- Into "Plugin Management" to install

2. realtime
#cd /data/tools
#wget http://docs.cacti.net/_media/plugin:realtime-v0.5-2.tgz
#mv plugin:realtime-v0.5-2.tgz realtime-v0.5-2.tgz
#tar -zxvf realtime-v0.5-2.tgz
#mv realtime /zserver/nginx-1.4.7/html/cacti/plugins/
#cd /zserver/nginx-1.4.7/html/cacti
#mkdir realtime-image-cache
#chown nginx.nginx realtime-image-cache
- Into "Setting" --> tab "Misc" --> text-box "Cache Directory" with path: "/zserver/nginx-1.4.7/html/cacti/realtime-image-cache"

3. errorimage
4.

1 comment:

  1. Hi,

    I have moved the cacti site directory to my site directory
    /var/www/....
    /var/www/ is root owned and the rest of the cacti directory is nginx owned. my other site has same ownership and premissions 755, however, it's givign me a 403 forbidden error when i try to access the URL name for cacti, but my other vhosts is fine.

    ReplyDelete