注册 登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

Tenhlf的博客

 
 
 

日志

 
 

FreeBSD 8.0 Zabbix 1.8.1 Ports安装篇  

2010-02-12 13:18:10|  分类: FreeBSD |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |
系统环境 FreeBSD 8.0

# cd zabbix-server
# make install clean

                Options for zabbix-server 1.8.1,2       
[X] MYSQL   Use MySQL backend                        
[ ] PGSQL   Use PostgreSQL backend                     
[ ] SQLITE  Use SQLite backend                         
[ ] IPV6    Support for IPv6                           
[X] LDAP    Support for checking LDAP servers          
[X] JABBER  Use jabber media type                      
[X] FPING   Use fping for pinging hosts        




           Options for net-snmp 5.4.2.1_6                    

[ ] IPV6           Build with IPv6 support                  
[X] MFD_REWRITES   Build with 64-bit Interface Counters     
[X] PERL           Install additional perl modules          
[X] PERL_EMBEDDED  Build embedded perl                      
[X] TKMIB          Install graphical MIB browser            
[X] DUMMY          Enable dummy values as placeholders      
[ ] DMALLOC        Enable dmalloc debug memory allocator      




            Options for perl 5.8.9_3                       
[ ] DEBUGGING      Build with debugging support           
[ ] GDBM           Build GDBM_File extension             
[X] PERL_MALLOC    Use Perl malloc                       
[X] PERL_64BITINT  Use 64 bit integers (on i386)         
[ ] THREADS        Build threaded perl                  
[ ] SUIDPERL       Build set-user-id suidperl binary    
[ ] SITECUSTOMIZE  Run-time customization of @INC       
[X] USE_PERL       Rewrite links in /usr/bin     



            Options for libxslt 1.1.26                     
[ ] MEM_DEBUG  Enable memory debugging                
[X] CRYPTO     Enable crypto support for exslt



         Options for python26 2.6.4                     
[X] THREADS          Enable thread support                   
[ ] HUGE_STACK_SIZE  Use a larger thread stack                
[ ] SEM              Use POSIX semaphores (experimental)      
[ ] PTH              Use GNU Pth for threading/multiprocessing
[X] UCS4             Use UCS4 for unicode support            
[X] PYMALLOC         Use python's internal malloc            
[ ] IPV6             Enable IPv6 support                      
[ ] FPECTL           Enable floating point exception handling



           Options for m4 1.4.13,1                        
[ ] LIBSIGSEGV  Use libsigsegv for better diagnostics   



           Options for curl 7.19.7_1                       
[ ] CARES        Asynchronous DNS resolution via c-ares      
[ ] CURL_DEBUG   Enable curl diagnostic output               
[ ] GNUTLS       Use GNU TLS if OPENSSL is OFF              
[X] IPV6         IPv6 support                               
[ ] KERBEROS4    Kerberos 4 authentication                  
[ ] LDAP         LDAP support                                
[ ] LDAPS        LDAPS support (requires LDAP and SSL)      
[ ] LIBIDN       Internationalized Domain Names via libidn  
[ ] LIBSSH2      SCP/SFTP support via libssh2               
[ ] NTLM         NTLM authentication                        
[X] OPENSSL      OpenSSL support                           
[X] PROXY        Proxy support                             
[ ] TRACKMEMORY  Enable curl memory diagnostic output



          Options for ca_root_nss 3.12.4           
[ ] ETCSYMLINK  Add symlink to /etc/ssl/cert.pem   


======================================================================
Zabbix requires a database.  If you are using SQLite, one will be
created automatically.  Otherwise you can install one as follows (<db>
is your database engine and <db_client> is its client program):

% cd /usr/local/share/zabbix/server/create
% cat schema/<db>.sql data/data.sql data/images_<db>.sql | <db_client>

To upgrade an existing database, see the scripts in
/usr/local/share/zabbix/server/upgrades.
======================================================================
===> Installing rc.d startup script(s)
===>   Compressing manual pages for zabbix-server-1.8.1,2
===>   Registering installation for zabbix-server-1.8.1,2
===> SECURITY REPORT:
      This port has installed the following files which may act as network
      servers and may therefore pose a remote security risk to the system.
/usr/local/sbin/zabbix_server

      This port has installed the following startup scripts which may cause
      these network services to be started at boot time.
/usr/local/etc/rc.d/zabbix_server

      If there are vulnerabilities in these programs there may be a security
      risk to the system. FreeBSD makes no guarantee about the security of
      ports included in the Ports Collection. Please type 'make deinstall'
      to deinstall the port if this is a concern.

      For more information, and contact details about the security
      status of this software, see the following webpage:

# cd /usr/ports/net-mgmt/zabbix-frontend
# make install clean


            Options for zabbix-frontend 1.8.1,2
[X] MYSQL   Use MySQL backend                   
[ ] PGSQL   Use PostgreSQL backend             
[ ] SQLITE  Use SQLite backend  


 Options for php5 5.2.12                      
[X] CLI        Build CLI version                                
[X] CGI        Build CGI version                                
[X] APACHE     Build Apache module                              
[ ] DEBUG      Enable debug                                     
[X] SUHOSIN    Enable Suhosin protection system (not for jails)
[ ] MULTIBYTE  Enable zend multibyte support                    
[ ] IPV6       Enable ipv6 support                              
[ ] MAILHEAD   Enable mail header patch                         
[ ] REDIRECT   Enable force-cgi-redirect support (CGI only)     
[ ] DISCARD    Enable discard-path support (CGI only)           
[X] FASTCGI    Enable fastcgi support (CGI only)                
[X] PATHINFO   Enable path-info-check support (CGI only)    



             Options for php5-gd 5.2.12                   
[X] T1LIB     Include T1lib support                     
[X] TRUETYPE  Enable TrueType string function            
[ ] JIS       Enable JIS-mapped Japanese font support  


             Options for php5-pcre 5.2.12                   
[ ] BUNDLED_PCRE  Select if you use apache 2.0.x  

# cd /usr/ports/databases/mysql50-server/
# make install clean
# echo 'mysql_enable="YES"' >> /etc/rc.conf
# cp /usr/local/share/mysql/my-medium.cnf /etc/my.cnf
# ee /etc/my.cnf


    # Uncomment the following if you are using InnoDB tables
    innodb_data_home_dir = /var/db/mysql/
    innodb_data_file_path = ibdata1:10M:autoextend
    innodb_log_group_home_dir = /var/db/mysql/
    innodb_log_arch_dir = /var/db/mysql/
    # You can set .._buffer_pool_size up to 50 - 80 %
    # of RAM but beware of setting memory usage too high
    innodb_buffer_pool_size = 16M
    innodb_additional_mem_pool_size = 2M
    # Set .._log_file_size to 25 % of buffer pool size
    innodb_log_file_size = 5M
    innodb_log_buffer_size = 8M
    innodb_flush_log_at_trx_commit = 1
    innodb_lock_wait_timeout = 50

# /usr/local/etc/rc.d/mysql-server start
Starting mysql.

# sockstat -4 |grep 3306
mysql    mysqld     61646 13 tcp4   *:3306                *:*

# mysqladmin -u root password ******
For MySQL:

shell> mysql -u<username> -p<password>
mysql> create database zabbix character set utf8;
mysql> quit;
shell> cd /usr/local/share/zabbix/server/create/schema
shell> cat mysql.sql | mysql -u<username> -p<password> zabbix
shell> cd ../data
shell> cat data.sql | mysql -u<username> -p<password> zabbix
shell> cat images_mysql.sql | mysql -u<username> -p<password> zabbix


# echo "GRANT ALL ON zabbix.* TO zabbix@localhost IDENTIFIED BY 'zabbix'; FLUSH PRIVILEGES;" |

mysql -u root -p

# cp /usr/local/etc/zabbix/zabbix_server.conf.sample /usr/local/etc/zabbix/zabbix_server.conf
# ee /usr/local/etc/zabbix/zabbix_server.conf

    DBUser=zabbix
    DBPassword=zabbix

# echo 'zabbix_server_enable="YES"' >> /etc/rc.conf
# /usr/local/etc/rc.d/zabbix_server start
# sockstat -4
发现服务没有成功启动,查看日志文件/tmp/zabbix_server.log有下面的提示


 69083:20100212:094928.206 Can't allocate shared memory of size 8388608 [Cannot allocate memory]
 69083:20100212:094928.206 ERROR: Can't allocate shared memory for configuration cache.

不能分配共享缓存的配置,配置文件定义8M的共享缓存CacheSize=8M。

#  sysctl -a
kern.ipc.shmmin: 1
kern.ipc.shmmax: 33554432 (默认是32M)

安装手册中的案例

---------------------------------------------------------------------
为了改善 X11 界面使用共享内存的能力, 建议提高一些 sysctl(8) 变量的值:

kern.ipc.shmmax=67108864
kern.ipc.shmall=32768
---------------------------------------------------------------------
# sysctl kern.ipc.shmmax=67108864
kern.ipc.shmmax: 33554432 -> 67108864

# 最大线程数量8改为32
# sysctl kern.ipc.shmall=32768
kern.ipc.shmall: 8192 -> 32768

实际只需要修改最大线程数,服务就可以正常启动了。
将修改值写入配置文件,否则重启后配置将会丢失。
# echo 'kern.ipc.shmmax=67108864' >> /etc/sysctl.conf
# echo 'kern.ipc.shmall=32768' >> /etc/sysctl.conf

# /usr/local/etc/rc.d/zabbix_server start
# sockstat -4 |grep 10051
zabbix   zabbix_ser 858   4  tcp4   *:10051               *:*
zabbix   zabbix_ser 857   4  tcp4   *:10051               *:*
zabbix   zabbix_ser 856   4  tcp4   *:10051               *:*
zabbix   zabbix_ser 855   4  tcp4   *:10051               *:*
zabbix   zabbix_ser 854   4  tcp4   *:10051               *:*
zabbix   zabbix_ser 853   4  tcp4   *:10051               *:*
zabbix   zabbix_ser 852   4  tcp4   *:10051               *:*
zabbix   zabbix_ser 851   4  tcp4   *:10051               *:*
zabbix   zabbix_ser 850   4  tcp4   *:10051               *:*
zabbix   zabbix_ser 849   4  tcp4   *:10051               *:*
zabbix   zabbix_ser 848   4  tcp4   *:10051               *:*
zabbix   zabbix_ser 847   4  tcp4   *:10051               *:*
zabbix   zabbix_ser 846   4  tcp4   *:10051               *:*
zabbix   zabbix_ser 845   4  tcp4   *:10051               *:*
zabbix   zabbix_ser 844   4  tcp4   *:10051               *:*
zabbix   zabbix_ser 843   4  tcp4   *:10051               *:*
zabbix   zabbix_ser 842   4  tcp4   *:10051               *:*
zabbix   zabbix_ser 841   4  tcp4   *:10051               *:*
zabbix   zabbix_ser 840   4  tcp4   *:10051               *:*
zabbix   zabbix_ser 839   4  tcp4   *:10051               *:*
zabbix   zabbix_ser 838   4  tcp4   *:10051               *:*
zabbix   zabbix_ser 825   4  tcp4   *:10051               *:*

线程还真不少。



因为ports自动安装了apache13模块,这里就直接启动就ok了

# echo 'apache_enable="YES"' >> /etc/rc.conf
# /usr/local/etc/rc.d/apache start
# sockstat -4 |grep 80
www      httpd      66975 16 tcp4   *:80                  *:*
www      httpd      66974 16 tcp4   *:80                  *:*
www      httpd      66973 16 tcp4   *:80                  *:*
www      httpd      66972 16 tcp4   *:80                  *:*
www      httpd      66971 16 tcp4   *:80                  *:*
root     httpd      66970 16 tcp4   *:80                  *:*

# ee /usr/local/etc/apache/httpd.conf 加入下面的内容
---------------------------------------------------
# php5
   AddType application/x-httpd-php .php
   AddType application/x-httpd-php-source .phps

# Zabbix
   Alias /zabbix/ /usr/local/www/zabbix/
   <Directory /usr/local/www/nzabbix>
     Order deny,allow
     Deny from all
     Allow from 127.0.0.1,192.168.101.16
   </Directory>
---------------------------------------------------
# /usr/local/etc/rc.d/apache restart

打开浏览器http://192.168.101.5/zabbix/
进入Check of pre-requisites页面,
PHP post max size     8M     16M     32M     Fail
PHP max execution time     30     300     600     Fail
PHP timezone     no                     Fail
PHP MB string overload     no                 Fail

根据提示修改php.ini的配置值

# cp /usr/local/etc/php.ini-recommended /usr/local/etc/php.ini
# ee /usr/local/etc/php.ini

post_max_size = 32m
max_execution_time = 600
[Date]
; Defines the default timezone used by the date functions
date.timezone = Asia/Shanghai

mbstring.func_overload = 7

重启apache,还是报

PHP MB string overload     no                 Fail


# cd /usr/ports/converters/php5-mbstring
# make install clean

    Options for php5-mbstring 5.2.12          
[X] REGEX  Enable multibyte regex support

重启后ok。然后根据提示进行web的相关配置。在第7步install的时候,要将配置文件下载下来,然后考到相应的
位置,即使配置信息一样,好像安装程序都无法完成。只能是配置页面产生的内容才有效。
                  
Default user name is Admin, password zabbix
  评论这张
 
阅读(2559)| 评论(0)
推荐 转载

历史上的今天

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2018