免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 4281 | 回复: 0
打印 上一主题 下一主题

完整程序安裝Cacti在Solaris 10上 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2010-09-23 07:28 |只看该作者 |倒序浏览
本帖最后由 watchsat 于 2010-09-22 16:45 编辑

這是我最近安裝Cacati的完整程序, 包含重要文檔內容, 按圖施工保證成功!!!

用的是英文, 密碼部分就自己改成你要用的就成了.
  1. 1. Download and install pkgutil_sparc.pkg from:

  2. http://download.blastwave.org/csw/pkgutil_sparc.pkg


  3. 2. Create UNIX users mysql and cacti:

  4. /etc/passwd
  5. mysql:x:205:2001:MySQL services account:/opt/csw/mysql5:/bin/true
  6. cacti:x:2200:2002:Cacti services account:/opt/home/cacti:/bin/csh

  7. /etc/shadow
  8. mysql:KzE/F1n#NyVSg:14804::::::
  9. cacti:aDPW/3fAf6Mdk:14819::::::

  10. /etc/group
  11. mysql::2001:
  12. cacti::2002:



  13. 3. Create and source ~/.cshrc

  14. umask 022
  15. set filec
  16. stty erase ^H
  17. setenv DISPLAY ad070824.aeso.ca:0.0
  18. setenv EDITOR /usr/bin/vi
  19. setenv OPENWINHOME /usr/openwin
  20. setenv SPRO /opt/SUNWspro
  21. setenv CSW /opt/csw
  22. setenv GNUHOME /usr/local
  23. setenv NVL_INTERFACE eri0
  24. setenv JAVA_HOME /usr/local/j2eesdk/current/jdk
  25. setenv LD_LIBRARY_PATH

  26. /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

  27. :/opt/csw/gcc3/lib:/opt/csw/php53/lib:/opt/csw/netsnmp/lib
  28. setenv MANPATH

  29. $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

  30. /man:/opt/SUNWrtvc/man:/opt/hpnpl/man:$SPRO/man:/opt/SUNWconn/man
  31. set path=($OPENWINHOME/bin $CSW/bin $CSW/sbin $CSW/gcc3/bin $CSW/gcc3/sbin $CSW/mysql5/bin $CSW/php53/bin $CSW/apache2/sbin

  32. $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

  33. /etc/init.d /opt/hpnpl/bin /usr .)
  34. if ( $?prompt ) then
  35.         set history=999
  36. endif
  37. set prompt="`hostname`|`pwd`%"
  38. alias ls 'ls -F'
  39. alias cd 'cd \!*;set prompt="`hostname`|`pwd`%"'


  40. 4. Run the install tools for mySQL parts:

  41. pkgutil -i wget mysql5 mysql5devel mysql5test


  42. 5. Configure the mySQL:

  43. Create user/group maysql
  44. cp /opt/csw/mysql5/share/mysql/my-medium.cnf /opt/csw/mysql5/my.cnf
  45. /opt/csw/mysql5/bin/mysql_install_db
  46. chown -R mysql:mysql /opt/csw/mysql5/var/
  47. svcadm enable cswmysql5
  48. /opt/csw/mysql5/bin/mysqladmin -u root password 'edeletry53'


  49. 6. Run the install tools for Apache2 parts:

  50. pkgutil -i apache2 apache2c apache2rt apache2_dev apache2_64 apache2_manual


  51. 7. Run and intall support tools:

  52. pkgutil -i autoconf automake gcc3 gmake flex gm4 gtar libxml2 gd libtool

  53. Specical requirement for this step:
  54. 7.1. Have two terminals open.
  55. 7.2. make sure you have X11 in /usr/openwin/share/include/ on your Solaris 10.
  56. 7.3. on 2nd terminal, type following commands but don't hit enter:
  57. 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/
  58. 7.4. On the 1st terminal, run the installation processes.

  59. Now, here is the important part:
  60. 7.5. When the installation processes showed as following, hit enter on 2nd terminal:

  61. ## Executing postinstall script.
  62. *** NOTICE ***
  63. Fixing the system headers
  64. for a detailed log see /var/sadm/install/logs/CSWgcc3core-20100xxxxxx
  65. Don't forget: whenever your system headers change run the mkheaders script!

  66. 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

  67. prompt back:
  68. cp: /opt/csw/gcc3/lib/gcc/sparc-sun-solaris2.8/3.4.5/include/root/usr/openwin/share/include/: No such file or directory

  69. 7.7. Then, you will see the installation successfully on 1st terminal.

  70. PS: If you got errors, remove the CSWgcc3core and follow the steps as above, and only install the package via commend:
  71. pkgutil -i gcc3core
  72. 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.


  73. 8. run and install Net-SNMP:

  74. pkgutil -i netsnmp pm_netsnmp pm_snmpsession


  75. 9. Disable default SNMP agents:

  76. svcadm disable dmi
  77. svcadm disable sma
  78. svcadm disable seaport
  79. svcadm disable snmpdx



  80. 10. Configure the Net-SNMP:

  81. /opt/csw/bin/snmpconf -g basic_setup


  82. ************************************************
  83. *** Beginning basic system information setup ***
  84. ************************************************
  85. Do you want to configure the information returned in the system MIB group (contact info, etc)? (default = y):

  86. Configuring: syslocation
  87. Description:
  88.   The [typically physical] location of the system.
  89.     Note that setting this value here means that when trying to
  90.     perform an snmp SET operation to the sysLocation.0 variable will make
  91.     the agent return the "notWritable" error code.  IE, including
  92.     this token in the snmpd.conf file will disable write access to
  93.     the variable.
  94.     arguments:  location_string

  95. The location of the system: PDC

  96. Finished Output: syslocation  PDC

  97. Configuring: syscontact
  98. Description:
  99.   The contact information for the administrator
  100.     Note that setting this value here means that when trying to
  101.     perform an snmp SET operation to the sysContact.0 variable will make
  102.     the agent return the "notWritable" error code.  IE, including
  103.     this token in the snmpd.conf file will disable write access to
  104.     the variable.
  105.     arguments:  contact_string

  106. The contact information: root

  107. Finished Output: syscontact  root
  108. Do you want to properly set the value of the sysServices.0 OID (if you don't know, just say no)? (default = y):

  109. Configuring: sysservices
  110. Description:
  111.   The proper value for the sysServices object.
  112.     arguments:  sysservices_number

  113. does this host offer physical services (eg, like a repeater) [answer 0 or 1]: 1
  114. does this host offer datalink/subnetwork services (eg, like a bridge): 0
  115. does this host offer internet services (eg, supports IP): 1
  116. does this host offer end-to-end services (eg, supports TCP): 1
  117. does this host offer application services (eg, supports SMTP): 1

  118. Finished Output: sysservices 77
  119. **************************************
  120. *** BEGINNING ACCESS CONTROL SETUP ***
  121. **************************************
  122. Do you want to configure the agent's access control? (default = y):
  123. Do you want to allow SNMPv3 read-write user based access (default = y): n
  124. Do you want to allow SNMPv3 read-only user based access (default = y): n
  125. Do you want to allow SNMPv1/v2c read-write community access (default = y): n
  126. Do you want to allow SNMPv1/v2c read-only community access (default = y): y

  127. Configuring: rocommunity
  128. Description:
  129.   a SNMPv1/SNMPv2c read-only access community name
  130.     arguments:  community [default|hostname|network/bits] [oid]

  131. The community name to add read-only access for: public
  132. The hostname or network address to accept this community name from [RETURN for all]:
  133. The OID that this community should be restricted to [RETURN for no-restriction]:

  134. Finished Output: rocommunity  public
  135. Do another rocommunity line? (default = y): n
  136. ****************************************
  137. *** Beginning trap destination setup ***
  138. ****************************************
  139. Do you want to configure where and if the agent will send traps? (default = y): n
  140. ****************************************
  141. *** Beginning monitoring setup ***
  142. ****************************************
  143. Do you want to configure the agent's ability to monitor various aspects of your system? (default = y):
  144. Do you want to configure the agents ability to monitor processes? (default = y):

  145. Configuring: proc
  146. Description:
  147.   Check for processes that should be running.
  148.       proc NAME [MAX=0] [MIN=0]

  149.       NAME:  the name of the process to check for.  It must match
  150.              exactly (ie, http will not find httpd processes).
  151.       MAX:   the maximum number allowed to be running.  Defaults to 0.
  152.       MIN:   the minimum number to be running.  Defaults to 0.

  153.     The results are reported in the prTable section of the UCD-SNMP-MIB tree
  154.     Special Case:  When the min and max numbers are both 0, it assumes
  155.     you want a max of infinity and a min of 1.

  156. Name of the process you want to check on: sshd
  157. Maximum number of processes named 'sshd' that should be running [default = 0]: 1
  158. Minimum number of processes named 'sshd' that should be running [default = 0]: 0

  159. Finished Output: proc  sshd 1 0
  160. Do another proc line? (default = y): n
  161. Do you want to configure the agents ability to monitor disk space? (default = y):

  162. Configuring: disk
  163. Description:
  164.   Check for disk space usage of a partition.
  165.     The agent can check the amount of available disk space, and make
  166.     sure it is above a set limit.

  167.      disk PATH [MIN=100000]

  168.      PATH:  mount path to the disk in question.
  169.      MIN:   Disks with space below this value will have the Mib's errorFlag set.
  170.             Can be a raw byte value or a percentage followed by the %
  171.             symbol.  Default value = 100000.

  172.     The results are reported in the dskTable section of the UCD-SNMP-MIB tree

  173. Enter the mount point for the disk partion to be checked on: /
  174. Enter the minimum amount of space that should be available on /: %100

  175. Finished Output: disk  / %100
  176. Do another disk line? (default = y): n
  177. Do you want to configure the agents ability to monitor load average? (default = y): y

  178. Configuring: load
  179. Description:
  180.   Check for unreasonable load average values.
  181.     Watch the load average levels on the machine.

  182.      load [1MAX=12.0] [5MAX=12.0] [15MAX=12.0]

  183.      1MAX:   If the 1 minute load average is above this limit at query
  184.              time, the errorFlag will be set.
  185.      5MAX:   Similar, but for 5 min average.
  186.      15MAX:  Similar, but for 15 min average.

  187.     The results are reported in the laTable section of the UCD-SNMP-MIB tree

  188. Enter the maximum allowable value for the 1 minute load average: 12
  189. Enter the maximum allowable value for the 5 minute load average: 12
  190. Enter the maximum allowable value for the 15 minute load average: 12

  191. Finished Output: load  12 12 12
  192. Do another load line? (default = y): n
  193. Do you want to configure the agents ability to monitor file sizes? (default = y): n


  194. The following files were created:

  195.   snmpd.conf

  196. These files should be moved to /opt/csw/share/snmp if you
  197. want them used by everyone on the system.  In the future, if you add
  198. the -i option to the command line I'll copy them there automatically for you.

  199. Or, if you want them for your personal use only, copy them to
  200. //.snmp .  In the future, if you add the -p option to the
  201. command line I'll copy them there automatically for you.




  202. 11. Copy the new config file and restart the services:

  203. mv snmpd.conf /opt/csw/share/snmp/
  204. svcadm restart cswnetsnmp



  205. 12. Run the install tools for PHP:

  206. pkgutil -i php53 php53_mysql php53_mysqli php53_snmp ap2_modphp53


  207. 13: Configure PHP with Apache2:

  208. Create /opt/csw/apache2/php.ini:

  209. [PHP]
  210. engine = On
  211. zend.ze1_compatibility_mode = Off
  212. short_open_tag = Off
  213. asp_tags = Off
  214. precision    =  14
  215. y2k_compliance = On
  216. output_buffering = 4096
  217. zlib.output_compression = Off
  218. implicit_flush = Off
  219. unserialize_callback_func=
  220. serialize_precision = 100
  221. allow_call_time_pass_reference = Off
  222. safe_mode = Off
  223. safe_mode_gid = Off
  224. safe_mode_include_dir =
  225. safe_mode_exec_dir =
  226. safe_mode_allowed_env_vars = PHP_
  227. safe_mode_protected_env_vars = LD_LIBRARY_PATH
  228. disable_functions =
  229. disable_classes =
  230. expose_php = On
  231. error_reporting  =  E_ALL
  232. display_errors = Off
  233. display_startup_errors = Off
  234. log_errors = On
  235. log_errors_max_len = 1024
  236. ignore_repeated_errors = Off
  237. ignore_repeated_source = Off
  238. report_memleaks = On
  239. track_errors = Off
  240. variables_order = "GPCS"
  241. register_globals = Off
  242. register_long_arrays = Off
  243. register_argc_argv = Off
  244. auto_globals_jit = On
  245. post_max_size = 8M
  246. magic_quotes_runtime = Off
  247. magic_quotes_sybase = Off
  248. auto_prepend_file =
  249. auto_append_file =
  250. default_mimetype = "text/html"
  251. include_path = "/opt/csw/php53/include/php/:/opt/csw/php53/lib/php/"
  252. doc_root =
  253. user_dir =
  254. extension_dir = "/opt/csw/php53/lib/php/extensions/no-debug-non-zts-20090626"
  255. enable_dl = On
  256. file_uploads = On
  257. upload_max_filesize = 2M
  258. allow_url_fopen = On
  259. allow_url_include = Off
  260. default_socket_timeout = 60
  261. extension=curl.so
  262. extension=mysql.so
  263. extension=mysqli.so
  264. extension=snmp.so

  265. [Date]

  266. [filter]

  267. [iconv]

  268. [sqlite]

  269. [xmlrpc]

  270. [Pcre]

  271. [Syslog]
  272. define_syslog_variables  = Off

  273. [mail function]
  274. SMTP = localhost
  275. smtp_port = 25

  276. [SQL]
  277. sql.safe_mode = Off

  278. [ODBC]
  279. odbc.allow_persistent = On
  280. odbc.check_persistent = On
  281. odbc.max_persistent = -1
  282. odbc.max_links = -1
  283. odbc.defaultlrl = 4096
  284. odbc.defaultbinmode = 1

  285. [MySQL]
  286. mysql.allow_persistent = On
  287. mysql.max_persistent = -1
  288. mysql.max_links = -1
  289. mysql.default_port =
  290. mysql.default_socket =
  291. mysql.default_host =
  292. mysql.default_user =
  293. mysql.default_password =
  294. mysql.connect_timeout = 60
  295. mysql.trace_mode = Off

  296. [MySQLi]

  297. mysqli.max_links = -1
  298. mysqli.default_port = 3306
  299. mysqli.default_socket =
  300. mysqli.default_host =
  301. mysqli.default_user =
  302. mysqli.default_pw =
  303. mysqli.reconnect = Off

  304. [mSQL]
  305. msql.allow_persistent = On
  306. msql.max_persistent = -1
  307. msql.max_links = -1

  308. [OCI8]

  309. [PostgresSQL]
  310. pgsql.allow_persistent = On
  311. pgsql.auto_reset_persistent = Off
  312. pgsql.max_persistent = -1
  313. pgsql.max_links = -1
  314. pgsql.ignore_notice = 0
  315. pgsql.log_notice = 0

  316. [Sybase]
  317. sybase.allow_persistent = On
  318. sybase.max_persistent = -1
  319. sybase.max_links = -1
  320. sybase.min_error_severity = 10
  321. sybase.min_message_severity = 10
  322. sybase.compatability_mode = Off

  323. [Sybase-CT]
  324. sybct.allow_persistent = On
  325. sybct.max_persistent = -1
  326. sybct.max_links = -1
  327. sybct.min_server_severity = 10
  328. sybct.min_client_severity = 10

  329. [bcmath]
  330. bcmath.scale = 0

  331. [browscap]

  332. [Informix]
  333. ifx.default_host =
  334. ifx.default_user =
  335. ifx.default_password =
  336. ifx.allow_persistent = On
  337. ifx.max_persistent = -1
  338. ifx.max_links = -1
  339. ifx.textasvarchar = 0
  340. ifx.byteasvarchar = 0
  341. ifx.charasvarchar = 0
  342. ifx.blobinfile = 0
  343. ifx.nullformat = 0

  344. [Session]
  345. session.save_handler = files
  346. session.save_path = "/tmp"
  347. session.use_cookies = 1
  348. session.name = PHPSESSID
  349. session.auto_start = 0
  350. session.cookie_lifetime = 0
  351. session.cookie_path = /
  352. session.cookie_domain =
  353. session.cookie_httponly =
  354. session.serialize_handler = php
  355. session.gc_probability = 1
  356. session.gc_divisor     = 1000
  357. session.gc_maxlifetime = 1440
  358. session.bug_compat_42 = 0
  359. session.bug_compat_warn = 1
  360. session.referer_check =
  361. session.entropy_length = 0
  362. session.entropy_file =
  363. session.cache_limiter = nocache
  364. session.cache_expire = 180
  365. session.use_trans_sid = 0
  366. session.hash_function = 0
  367. session.hash_bits_per_character = 5
  368. url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=fakeentry"

  369. [MSSQL]
  370. mssql.allow_persistent = On
  371. mssql.max_persistent = -1
  372. mssql.max_links = -1
  373. mssql.min_error_severity = 10
  374. mssql.min_message_severity = 10
  375. mssql.compatability_mode = Off
  376. mssql.secure_connection = Off

  377. [Assertion]

  378. [COM]

  379. [mbstring]

  380. [FrontBase]

  381. [gd]

  382. [exif]

  383. [Tidy]
  384. tidy.clean_output = Off

  385. [soap]
  386. soap.wsdl_cache_enabled=1
  387. soap.wsdl_cache_dir="/tmp"
  388. soap.wsdl_cache_ttl=86400


  389. 14. Configure /opt/csw/apache2/etc/httpd.conf:

  390. 14.1. Modify from:

  391. <IfModule dir_module>
  392.     DirectoryIndex index.html
  393. </IfModule>

  394. To:

  395. <IfModule dir_module>
  396.     DirectoryIndex index.php index.html
  397. </IfModule>

  398. 14.2. Modify from:

  399. AddType application/x-compress .Z
  400. AddType application/x-gzip .gz .tgz

  401. To:

  402. AddType application/x-compress .Z
  403. AddType application/x-gzip .gz .tgz
  404. AddType application/x-httpd-php .php

  405. 14.3. Modify from:

  406. User nobody
  407. Group nobody


  408. To:

  409. User cacti
  410. Group cacti



  411. 15. Run the install tool for RRDtool:

  412. pkgutil -i rrdtool


  413. 16. Download and un-tar the Cacti:

  414. http://www.cacti.net/downloads/cacti-0.8.7g.tar.gz
  415. cd /opt/csw/apache2/share/htdocs; tar -zxf cacti-0.8.7g.tar.gz
  416. ln -s /opt/csw/apache2/share/htdocs/cacti-0.8.7g cacti


  417. 17. Create Cacti databases:

  418. mysql -u root -p

  419. create database cacti;
  420. use cacti;
  421. source /opt/csw/apache2/share/htdocs/cacti/cacti.sql;
  422. grant all on cacti.* to cactiuser@localhost identified by 'yyyyy';
  423. flush privileges;
  424. exit


  425. 18. Configure the Cacti with mySQL:

  426. vi /opt/csw/apache2/share/htdocs/cacti/include/config.php

  427. $database_type = "mysql";
  428. $database_default = "cacti";
  429. $database_hostname = "localhost";
  430. $database_username = "cactiuser";
  431. $database_password = "yyyyy";
  432. $database_port = "3306";


  433. 19. Clean out permissions and restart Apache2:

  434. chown -R 80:80 /opt/csw/apache2/
  435. chown -R cacti:cacti /opt/csw/apache2/share/htdocs/cacti/rra
  436. chown -R cacti:cacti /opt/csw/apache2/share/htdocs/cacti/log
  437. svcadm enable svc:/network/http:cswapache2


  438. 20. Setup cronjob for user cacti:

  439. crontab -e cacti


  440. 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



  441. 21. Login the Cacti as user "admin", go to "Console" -> "Setting" -> "Path" and make sure all setting like following:

  442. snmpwalk Binary Path:                                         /opt/csw/bin/snmpwalk

  443. snmpget Binary Path:                                        /opt/csw/bin/snmpget

  444. snmpbulkwalk Binary Path:                                /opt/csw/bin/snmpbulkwalk

  445. snmpgetnext Binary Path:                                /opt/csw/bin/snmpgetnext

  446. RRDTool Binary Path:                                        /opt/csw/bin/rrdtool

  447. RRDTool Default Font:                                        /opt/csw/share/rrdtool/fonts/DejaVuSansMono-Roman.ttf

  448. PHP Binary Path:                                        /opt/csw/php5/bin/php

  449. Logging:                                                /opt/csw/apache2/share/htdocs/cacti/log/cacti.log
复制代码
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP