- 论坛徽章:
- 0
|
本帖最后由 watchsat 于 2010-09-22 16:45 编辑
這是我最近安裝Cacati的完整程序, 包含重要文檔內容, 按圖施工保證成功!!!
用的是英文, 密碼部分就自己改成你要用的就成了.- 1. Download and install pkgutil_sparc.pkg from:
- http://download.blastwave.org/csw/pkgutil_sparc.pkg
- 2. Create UNIX users mysql and cacti:
- /etc/passwd
- mysql:x:205:2001:MySQL services account:/opt/csw/mysql5:/bin/true
- cacti:x:2200:2002:Cacti services account:/opt/home/cacti:/bin/csh
- /etc/shadow
- mysql:KzE/F1n#NyVSg:14804::::::
- cacti:aDPW/3fAf6Mdk:14819::::::
- /etc/group
- mysql::2001:
- cacti::2002:
- 3. Create and source ~/.cshrc
- umask 022
- set filec
- stty erase ^H
- setenv DISPLAY ad070824.aeso.ca:0.0
- setenv EDITOR /usr/bin/vi
- setenv OPENWINHOME /usr/openwin
- setenv SPRO /opt/SUNWspro
- setenv CSW /opt/csw
- setenv GNUHOME /usr/local
- setenv NVL_INTERFACE eri0
- setenv JAVA_HOME /usr/local/j2eesdk/current/jdk
- setenv LD_LIBRARY_PATH
- /usr/lib:$SPRO/lib:$GNUHOME/lib:/opt/csw/lib:/usr/sfw/lib:/usr/local/ssl/lib:/opt/hpnpl/lib:/opt/csw/mysql/lib/mysql:/opt/csw/lib/sparcv9
- :/opt/csw/gcc3/lib:/opt/csw/php53/lib:/opt/csw/netsnmp/lib
- setenv MANPATH
- $CSW/man:$CSW/php53/man:/usr/share/man:/usr/dt/man:$GNUHOME/apache/man:$GNUHOME/samba/man:/opt/csw/man:/usr/sfw/man:/usr/bin/man:$GNUHOME
- /man:/opt/SUNWrtvc/man:/opt/hpnpl/man:$SPRO/man:/opt/SUNWconn/man
- set path=($OPENWINHOME/bin $CSW/bin $CSW/sbin $CSW/gcc3/bin $CSW/gcc3/sbin $CSW/mysql5/bin $CSW/php53/bin $CSW/apache2/sbin
- $CSW/netsnmp/bin $GNUHOME/bin $GNUHOME/sbin $GNUHOME/mysql/bin $SPRO/bin /bin /usr/bin /usr/sfw/bin /usr/sbin /usr/ucb /usr/ccs/bin /etc
- /etc/init.d /opt/hpnpl/bin /usr .)
- if ( $?prompt ) then
- set history=999
- endif
- set prompt="`hostname`|`pwd`%"
- alias ls 'ls -F'
- alias cd 'cd \!*;set prompt="`hostname`|`pwd`%"'
- 4. Run the install tools for mySQL parts:
- pkgutil -i wget mysql5 mysql5devel mysql5test
- 5. Configure the mySQL:
- Create user/group maysql
- cp /opt/csw/mysql5/share/mysql/my-medium.cnf /opt/csw/mysql5/my.cnf
- /opt/csw/mysql5/bin/mysql_install_db
- chown -R mysql:mysql /opt/csw/mysql5/var/
- svcadm enable cswmysql5
- /opt/csw/mysql5/bin/mysqladmin -u root password 'edeletry53'
- 6. Run the install tools for Apache2 parts:
- pkgutil -i apache2 apache2c apache2rt apache2_dev apache2_64 apache2_manual
- 7. Run and intall support tools:
- pkgutil -i autoconf automake gcc3 gmake flex gm4 gtar libxml2 gd libtool
- Specical requirement for this step:
- 7.1. Have two terminals open.
- 7.2. make sure you have X11 in /usr/openwin/share/include/ on your Solaris 10.
- 7.3. on 2nd terminal, type following commands but don't hit enter:
- cd /usr/openwin/share/include/ ; cp -r -p X11 /opt/csw/gcc3/lib/gcc/sparc-sun-solaris2.8/3.4.5/include/root/usr/openwin/share/include/
- 7.4. On the 1st terminal, run the installation processes.
- Now, here is the important part:
- 7.5. When the installation processes showed as following, hit enter on 2nd terminal:
- ## Executing postinstall script.
- *** NOTICE ***
- Fixing the system headers
- for a detailed log see /var/sadm/install/logs/CSWgcc3core-20100xxxxxx
- Don't forget: whenever your system headers change run the mkheaders script!
- 7.6. if you see this error means you hit the return too early, quickly run that commands line again and again until you got a normal
- prompt back:
- cp: /opt/csw/gcc3/lib/gcc/sparc-sun-solaris2.8/3.4.5/include/root/usr/openwin/share/include/: No such file or directory
- 7.7. Then, you will see the installation successfully on 1st terminal.
- PS: If you got errors, remove the CSWgcc3core and follow the steps as above, and only install the package via commend:
- pkgutil -i gcc3core
- Then re-run the step 7 again as above. Once the CSWgcc3core issue been fixed, it will finish the rest packages have not been installed.
- 8. run and install Net-SNMP:
- pkgutil -i netsnmp pm_netsnmp pm_snmpsession
- 9. Disable default SNMP agents:
- svcadm disable dmi
- svcadm disable sma
- svcadm disable seaport
- svcadm disable snmpdx
- 10. Configure the Net-SNMP:
- /opt/csw/bin/snmpconf -g basic_setup
- ************************************************
- *** Beginning basic system information setup ***
- ************************************************
- Do you want to configure the information returned in the system MIB group (contact info, etc)? (default = y):
- Configuring: syslocation
- Description:
- The [typically physical] location of the system.
- Note that setting this value here means that when trying to
- perform an snmp SET operation to the sysLocation.0 variable will make
- the agent return the "notWritable" error code. IE, including
- this token in the snmpd.conf file will disable write access to
- the variable.
- arguments: location_string
- The location of the system: PDC
- Finished Output: syslocation PDC
- Configuring: syscontact
- Description:
- The contact information for the administrator
- Note that setting this value here means that when trying to
- perform an snmp SET operation to the sysContact.0 variable will make
- the agent return the "notWritable" error code. IE, including
- this token in the snmpd.conf file will disable write access to
- the variable.
- arguments: contact_string
- The contact information: root
- Finished Output: syscontact root
- Do you want to properly set the value of the sysServices.0 OID (if you don't know, just say no)? (default = y):
- Configuring: sysservices
- Description:
- The proper value for the sysServices object.
- arguments: sysservices_number
- does this host offer physical services (eg, like a repeater) [answer 0 or 1]: 1
- does this host offer datalink/subnetwork services (eg, like a bridge): 0
- does this host offer internet services (eg, supports IP): 1
- does this host offer end-to-end services (eg, supports TCP): 1
- does this host offer application services (eg, supports SMTP): 1
- Finished Output: sysservices 77
- **************************************
- *** BEGINNING ACCESS CONTROL SETUP ***
- **************************************
- Do you want to configure the agent's access control? (default = y):
- Do you want to allow SNMPv3 read-write user based access (default = y): n
- Do you want to allow SNMPv3 read-only user based access (default = y): n
- Do you want to allow SNMPv1/v2c read-write community access (default = y): n
- Do you want to allow SNMPv1/v2c read-only community access (default = y): y
- Configuring: rocommunity
- Description:
- a SNMPv1/SNMPv2c read-only access community name
- arguments: community [default|hostname|network/bits] [oid]
- The community name to add read-only access for: public
- The hostname or network address to accept this community name from [RETURN for all]:
- The OID that this community should be restricted to [RETURN for no-restriction]:
- Finished Output: rocommunity public
- Do another rocommunity line? (default = y): n
- ****************************************
- *** Beginning trap destination setup ***
- ****************************************
- Do you want to configure where and if the agent will send traps? (default = y): n
- ****************************************
- *** Beginning monitoring setup ***
- ****************************************
- Do you want to configure the agent's ability to monitor various aspects of your system? (default = y):
- Do you want to configure the agents ability to monitor processes? (default = y):
- Configuring: proc
- Description:
- Check for processes that should be running.
- proc NAME [MAX=0] [MIN=0]
- NAME: the name of the process to check for. It must match
- exactly (ie, http will not find httpd processes).
- MAX: the maximum number allowed to be running. Defaults to 0.
- MIN: the minimum number to be running. Defaults to 0.
- The results are reported in the prTable section of the UCD-SNMP-MIB tree
- Special Case: When the min and max numbers are both 0, it assumes
- you want a max of infinity and a min of 1.
- Name of the process you want to check on: sshd
- Maximum number of processes named 'sshd' that should be running [default = 0]: 1
- Minimum number of processes named 'sshd' that should be running [default = 0]: 0
- Finished Output: proc sshd 1 0
- Do another proc line? (default = y): n
- Do you want to configure the agents ability to monitor disk space? (default = y):
- Configuring: disk
- Description:
- Check for disk space usage of a partition.
- The agent can check the amount of available disk space, and make
- sure it is above a set limit.
- disk PATH [MIN=100000]
- PATH: mount path to the disk in question.
- MIN: Disks with space below this value will have the Mib's errorFlag set.
- Can be a raw byte value or a percentage followed by the %
- symbol. Default value = 100000.
- The results are reported in the dskTable section of the UCD-SNMP-MIB tree
- Enter the mount point for the disk partion to be checked on: /
- Enter the minimum amount of space that should be available on /: %100
- Finished Output: disk / %100
- Do another disk line? (default = y): n
- Do you want to configure the agents ability to monitor load average? (default = y): y
- Configuring: load
- Description:
- Check for unreasonable load average values.
- Watch the load average levels on the machine.
- load [1MAX=12.0] [5MAX=12.0] [15MAX=12.0]
- 1MAX: If the 1 minute load average is above this limit at query
- time, the errorFlag will be set.
- 5MAX: Similar, but for 5 min average.
- 15MAX: Similar, but for 15 min average.
- The results are reported in the laTable section of the UCD-SNMP-MIB tree
- Enter the maximum allowable value for the 1 minute load average: 12
- Enter the maximum allowable value for the 5 minute load average: 12
- Enter the maximum allowable value for the 15 minute load average: 12
- Finished Output: load 12 12 12
- Do another load line? (default = y): n
- Do you want to configure the agents ability to monitor file sizes? (default = y): n
- The following files were created:
- snmpd.conf
- These files should be moved to /opt/csw/share/snmp if you
- want them used by everyone on the system. In the future, if you add
- the -i option to the command line I'll copy them there automatically for you.
- Or, if you want them for your personal use only, copy them to
- //.snmp . In the future, if you add the -p option to the
- command line I'll copy them there automatically for you.
- 11. Copy the new config file and restart the services:
- mv snmpd.conf /opt/csw/share/snmp/
- svcadm restart cswnetsnmp
- 12. Run the install tools for PHP:
- pkgutil -i php53 php53_mysql php53_mysqli php53_snmp ap2_modphp53
- 13: Configure PHP with Apache2:
- Create /opt/csw/apache2/php.ini:
- [PHP]
- engine = On
- zend.ze1_compatibility_mode = Off
- short_open_tag = Off
- asp_tags = Off
- precision = 14
- y2k_compliance = On
- output_buffering = 4096
- zlib.output_compression = Off
- implicit_flush = Off
- unserialize_callback_func=
- serialize_precision = 100
- allow_call_time_pass_reference = Off
- safe_mode = Off
- safe_mode_gid = Off
- safe_mode_include_dir =
- safe_mode_exec_dir =
- safe_mode_allowed_env_vars = PHP_
- safe_mode_protected_env_vars = LD_LIBRARY_PATH
- disable_functions =
- disable_classes =
- expose_php = On
- error_reporting = E_ALL
- display_errors = Off
- display_startup_errors = Off
- log_errors = On
- log_errors_max_len = 1024
- ignore_repeated_errors = Off
- ignore_repeated_source = Off
- report_memleaks = On
- track_errors = Off
- variables_order = "GPCS"
- register_globals = Off
- register_long_arrays = Off
- register_argc_argv = Off
- auto_globals_jit = On
- post_max_size = 8M
- magic_quotes_runtime = Off
- magic_quotes_sybase = Off
- auto_prepend_file =
- auto_append_file =
- default_mimetype = "text/html"
- include_path = "/opt/csw/php53/include/php/:/opt/csw/php53/lib/php/"
- doc_root =
- user_dir =
- extension_dir = "/opt/csw/php53/lib/php/extensions/no-debug-non-zts-20090626"
- enable_dl = On
- file_uploads = On
- upload_max_filesize = 2M
- allow_url_fopen = On
- allow_url_include = Off
- default_socket_timeout = 60
- extension=curl.so
- extension=mysql.so
- extension=mysqli.so
- extension=snmp.so
- [Date]
- [filter]
- [iconv]
- [sqlite]
- [xmlrpc]
- [Pcre]
- [Syslog]
- define_syslog_variables = Off
- [mail function]
- SMTP = localhost
- smtp_port = 25
- [SQL]
- sql.safe_mode = Off
- [ODBC]
- odbc.allow_persistent = On
- odbc.check_persistent = On
- odbc.max_persistent = -1
- odbc.max_links = -1
- odbc.defaultlrl = 4096
- odbc.defaultbinmode = 1
- [MySQL]
- mysql.allow_persistent = On
- mysql.max_persistent = -1
- mysql.max_links = -1
- mysql.default_port =
- mysql.default_socket =
- mysql.default_host =
- mysql.default_user =
- mysql.default_password =
- mysql.connect_timeout = 60
- mysql.trace_mode = Off
- [MySQLi]
- mysqli.max_links = -1
- mysqli.default_port = 3306
- mysqli.default_socket =
- mysqli.default_host =
- mysqli.default_user =
- mysqli.default_pw =
- mysqli.reconnect = Off
- [mSQL]
- msql.allow_persistent = On
- msql.max_persistent = -1
- msql.max_links = -1
- [OCI8]
- [PostgresSQL]
- pgsql.allow_persistent = On
- pgsql.auto_reset_persistent = Off
- pgsql.max_persistent = -1
- pgsql.max_links = -1
- pgsql.ignore_notice = 0
- pgsql.log_notice = 0
- [Sybase]
- sybase.allow_persistent = On
- sybase.max_persistent = -1
- sybase.max_links = -1
- sybase.min_error_severity = 10
- sybase.min_message_severity = 10
- sybase.compatability_mode = Off
- [Sybase-CT]
- sybct.allow_persistent = On
- sybct.max_persistent = -1
- sybct.max_links = -1
- sybct.min_server_severity = 10
- sybct.min_client_severity = 10
- [bcmath]
- bcmath.scale = 0
- [browscap]
- [Informix]
- ifx.default_host =
- ifx.default_user =
- ifx.default_password =
- ifx.allow_persistent = On
- ifx.max_persistent = -1
- ifx.max_links = -1
- ifx.textasvarchar = 0
- ifx.byteasvarchar = 0
- ifx.charasvarchar = 0
- ifx.blobinfile = 0
- ifx.nullformat = 0
- [Session]
- session.save_handler = files
- session.save_path = "/tmp"
- session.use_cookies = 1
- session.name = PHPSESSID
- session.auto_start = 0
- session.cookie_lifetime = 0
- session.cookie_path = /
- session.cookie_domain =
- session.cookie_httponly =
- session.serialize_handler = php
- session.gc_probability = 1
- session.gc_divisor = 1000
- session.gc_maxlifetime = 1440
- session.bug_compat_42 = 0
- session.bug_compat_warn = 1
- session.referer_check =
- session.entropy_length = 0
- session.entropy_file =
- session.cache_limiter = nocache
- session.cache_expire = 180
- session.use_trans_sid = 0
- session.hash_function = 0
- session.hash_bits_per_character = 5
- url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=fakeentry"
- [MSSQL]
- mssql.allow_persistent = On
- mssql.max_persistent = -1
- mssql.max_links = -1
- mssql.min_error_severity = 10
- mssql.min_message_severity = 10
- mssql.compatability_mode = Off
- mssql.secure_connection = Off
- [Assertion]
- [COM]
- [mbstring]
- [FrontBase]
- [gd]
- [exif]
- [Tidy]
- tidy.clean_output = Off
- [soap]
- soap.wsdl_cache_enabled=1
- soap.wsdl_cache_dir="/tmp"
- soap.wsdl_cache_ttl=86400
- 14. Configure /opt/csw/apache2/etc/httpd.conf:
- 14.1. Modify from:
- <IfModule dir_module>
- DirectoryIndex index.html
- </IfModule>
- To:
- <IfModule dir_module>
- DirectoryIndex index.php index.html
- </IfModule>
- 14.2. Modify from:
- AddType application/x-compress .Z
- AddType application/x-gzip .gz .tgz
- To:
- AddType application/x-compress .Z
- AddType application/x-gzip .gz .tgz
- AddType application/x-httpd-php .php
- 14.3. Modify from:
- User nobody
- Group nobody
- To:
- User cacti
- Group cacti
- 15. Run the install tool for RRDtool:
- pkgutil -i rrdtool
- 16. Download and un-tar the Cacti:
- http://www.cacti.net/downloads/cacti-0.8.7g.tar.gz
- cd /opt/csw/apache2/share/htdocs; tar -zxf cacti-0.8.7g.tar.gz
- ln -s /opt/csw/apache2/share/htdocs/cacti-0.8.7g cacti
- 17. Create Cacti databases:
- mysql -u root -p
- create database cacti;
- use cacti;
- source /opt/csw/apache2/share/htdocs/cacti/cacti.sql;
- grant all on cacti.* to cactiuser@localhost identified by 'yyyyy';
- flush privileges;
- exit
- 18. Configure the Cacti with mySQL:
- vi /opt/csw/apache2/share/htdocs/cacti/include/config.php
- $database_type = "mysql";
- $database_default = "cacti";
- $database_hostname = "localhost";
- $database_username = "cactiuser";
- $database_password = "yyyyy";
- $database_port = "3306";
- 19. Clean out permissions and restart Apache2:
- chown -R 80:80 /opt/csw/apache2/
- chown -R cacti:cacti /opt/csw/apache2/share/htdocs/cacti/rra
- chown -R cacti:cacti /opt/csw/apache2/share/htdocs/cacti/log
- svcadm enable svc:/network/http:cswapache2
- 20. Setup cronjob for user cacti:
- crontab -e cacti
- 0,5,10,15,20,25,30,35,40,45,50,55 * * * * /opt/csw/php53/bin/php /opt/csw/apache2/share/htdocs/cacti/poller.php > /dev/null 2>&1
- 21. Login the Cacti as user "admin", go to "Console" -> "Setting" -> "Path" and make sure all setting like following:
- snmpwalk Binary Path: /opt/csw/bin/snmpwalk
- snmpget Binary Path: /opt/csw/bin/snmpget
- snmpbulkwalk Binary Path: /opt/csw/bin/snmpbulkwalk
- snmpgetnext Binary Path: /opt/csw/bin/snmpgetnext
- RRDTool Binary Path: /opt/csw/bin/rrdtool
- RRDTool Default Font: /opt/csw/share/rrdtool/fonts/DejaVuSansMono-Roman.ttf
- PHP Binary Path: /opt/csw/php5/bin/php
- Logging: /opt/csw/apache2/share/htdocs/cacti/log/cacti.log
复制代码 |
|