ITeye博客

Install zabbix Server

yanwenhan · 2008-07-24 16:13 · 流量监控 · Markdown


Install zabbix Server

 Install mysql 【mysql】 Version:mysql-5.0.51.tar.gz

Run: #groupadd mysql #useradd -g mysql mysql

cd mysql-5.0.51

Run: ./configure
--prefix=/usr/local/mysql
--with-mysqld-user=mysql

cp support-files/my-medium.cnf /etc/my.cnf cd /usr/local/mysql bin/mysql_install_db --user=mysql chown -R mysql.mysql var

Run: make;make install Error Handling: (main reasons for the system has not been installed compiler) 1.checking for tgetent in -ltermcap... no checking for termcap functions library... configure: error: No curses/termcap library found Solution: yum install libtermcap-devel yum install ncurses-devel 2.../depcomp: line 512: exec: g++: not found

 Install apache

【Apache】 Version:Apache 2.0.63 ./configure
--prefix=/usr/local/apache

 Install PHP ./configure --with-apxs2=/usr/local/apache/bin/apxs --with-config-file-path=/etc --with-mysql=/usr/local/mysql --with-gd --with-jpeg-dir --with-zlib-dir --with-png-dir --with-freetype-dir --enable-track-vars --enable-sockets --enable-ftp --disable-debug --enable-bcmath

You must use “--enable-bcmatch”

Error 1: configure: error: xml2-config not found. Please check your libxml2 installation. Solution: yum install libxml2-devel

Error 2:If configure fails try --with-xpm-dir= configure: error: freetype.h not found. Solution: yum install freetype-devel

 Make;make install  cp php.ini-dist /www/php/php.ini  Install zabbix

cd create/ cd schema/ cat mysql.sql | mysql -u root zabbix cd .. cd data/ cat data.sql | mysql -u root zabbix cat images_mysql.sql | mysql -u root zabbix

mkdir /etc/zabbix

Error solution: ./zabbix_server: error while loading shared libraries: libmysqlclient.so.15: cannot open shared object file: No such file or directory

./configure --prefix=/data/zabbix/ --enable-server --enable-agent --with-mysql make make install

Configuration:

Detected OS: linux-gnu Install path: /data/zabbix/ Compilation arch: linux

Compiler: gcc Compiler flags: -g -O2 -I/usr/local/mysql/include/mysql

Enable server: yes With database: MySQL WEB Monitoring via: no Native Jabber: no SNMP: no IPv6: no Linker flags: -L/usr/local/mysql/lib/mysql
Libraries: -lm -lresolv -lmysqlclient

Enable agent: yes Linker flags:
Libraries: -lm -lresolv

LDAP support: no  Copy frontends to htodcs:

Cp –rf /root/zabbix/zabbix-1.4.4/frontends/php/* /data/WebSite/htdocs/

 Enter user interface http://127.0.01./index.php  User is admin, password is empty.


Install zabbix to client

  1. version: 1.4.4

  2. tar zxvf zabbix_agents_1.4.4.linux2_6.x86_64.tar.gz cd zabbix cp file to target directory cp zabbix_agentd.conf to /etc/zabbix/

  3. Modify /etc/zabbix/zabbix_agentd.conf Server= your IP, if you want to add your UserParameter, you must modify “UserParameter=”. example: UserParameter=iowait,vmstat|grep -v memory |awk '{print $16}' |grep -v wa

  4. run zabbix_agentd


About UserParameter (Java_app_*)

Currently java environment need to monitor these parameters in the following:

UserParameter=ServerInfo.ThreadCount,curl -s 'http://127.0.0.1:8180/ecws/status' |grep ServerInfo.JVMInfo|cut -f2 -d "="|cut -f1 -d "," UserParameter=ServerInfo.FreeMem,curl -s 'http://127.0.0.1:8180/ecws/status' |grep ServerInfo.JVMInfo|cut -f2 -d "="|cut -f2 -d "," UserParameter=ServerInfo.MaxMem,curl -s 'http://127.0.0.1:8180/ecws/status' |grep ServerInfo.JVMInfo|cut -f2 -d "="|cut -f4 -d "," UserParameter=ServerInfo.TotalMem,curl -s 'http://127.0.0.1:8180/ecws/status' |grep ServerInfo.JVMInfo|cut -f2 -d "="|cut -f3 -d "," UserParameter=ServerInfo.CurrentStatus,curl -s 'http://127.0.0.1:8180/ecws/status' |grep CurrentStatus|cut -f2 -d "=" UserParameter=ApplicationInfo.DependencyCheck.DatabaseDependencyCheck,curl -s 'http://127.0.0.1:8180/ecws/status' |grep DatabaseDependencyCheck|cut -f2 -d "=" UserParameter=ApplicationInfo.DependencyCheck.EncryptionServiceDependencyCheck,curl -s 'http://127.0.0.1:8180/ecws/status' |grep EncryptionServiceDependencyCheck|cut -f2 -d "=" UserParameter=ApplicationInfo.DependencyCheck.PaymentServiceDependencyCheck,curl -s 'http://127.0.0.1:8180/ecws/status' |grep PaymentServiceDependencyCheck|cut -f2 -d "=" UserParameter=DBConnection.Active,curl -s 'http://127.0.0.1:8180/ecws/status' |grep DBConnection.DBConnection|cut -f2 -d "="|cut -f1 -d "," UserParameter=DBConnection.Available,curl -s 'http://127.0.0.1:8180/ecws/status' |grep DBConnection.DBConnection|cut -f2 -d "="|cut -f2 -d "," UserParameter=DBConnection.Opened,curl -s 'http://127.0.0.1:8180/ecws/status' |grep DBConnection.DBConnection|cut -f2 -d "="|cut -f3 -d ","

If you want to install it to other servers, Please modify these item: http://127.0.0.1:8180/ecws/status

  1. port: 8180 changed to correct port
  2. /ecws changed to correct directory

Then you must be restart zabbix_agentd


Sum of multi-server Item data

Attention: you can put these shell to anyone server.

 Please see the shell “payflow-int.sh”

  1. you must replace URL from “http://payflow-app0.int.real.com:9080/payflow/status” A. is payflow-app01.int real.com and payflow-app02.int.real.com,if you have 01-09, you can use . B. port: 9080 changed to correct port C. /payflow/status changed to correct directory
  2. if you want to change other UserParameter, you must change “grep ServerInfo.JVMInfo” to what you need.

 Copy flow-int.sh,pws-int.sh,rcws-int.sh to the correct server.  Add these UserParameter to /etc/zabbix/zabbix-agented.conf

UserParameter=Payflow-int.ThreadCount,/data/zabbix/bin/payflow-int.sh ThreadCount UserParameter=Payflow-int.active,/data/zabbix/bin/payflow-int.sh active UserParameter=Payflow-int.available,/data/zabbix/bin/payflow-int.sh available UserParameter=Payflow-int.opened,/data/zabbix/bin/payflow-int.sh opened UserParameter=Payflow-int.PayflowApplication.ModeRequest.NEW_REQUEST,/data/zabbix/bin/payflow-int.sh PayflowApplication.ModeRequest.NEW_REQUEST UserParameter=Payflow-int.PayflowApplication.ModeRequest.SUBMIT,/data/zabbix/bin/payflow-int.sh PayflowApplication.ModeRequest.SUBMIT UserParameter=Payflow-int.PayflowApplication.Error,/data/zabbix/bin/payflow-int.sh Error

Sum Total of RCWS-INT

UserParameter=RCWS-INT.ThreadCount,/data/zabbix/bin/rcws-int.sh ThreadCount UserParameter=RCWS-INT.Active,/data/zabbix/bin/rcws-int.sh Active UserParameter=RCWS-INT.available,/data/zabbix/bin/rcws-int.sh available UserParameter=RCWS-INT.opened,/data/zabbix/bin/rcws-int.sh opened UserParameter=RCWS-INT.createOrder,/data/zabbix/bin/rcws-int.sh createOrder UserParameter=RCWS-INT.createNewOrder,/data/zabbix/bin/rcws-int.s createNewOrder UserParameter=RCWS-INT.PreviewOrder,/data/zabbix/bin/rcws-int.s PreviewOrder UserParameter=RCWS-INT.PWSFacade.authorize,/data/zabbix/bin/rcws-int.s PWSFacade.authorize UserParameter=RCWS-INT.PWSFacade.settlementCharge,/data/zabbix/bin/rcws-int.s PWSFacade.settlementCharge UserParameter=RCWS-INT.POAPPaymentService.authorizeBill,/data/zabbix/bin/rcws-int.s POAPPaymentService.authorizeBill

Sum Total of PWS-INT

UserParameter=PWS-INT.ThreadCount,/data/zabbix/bin/pws-int.sh ThreadCount UserParameter=PWS-INT.PaymentTransactionService.authorize,/data/zabbix/bin/pws-int.sh PaymentTransactionService.authorize UserParameter=PWS-INT.PaymentTransactionService.authenticatePaymentMethod,/data/zabbix/bin/pws-int.sh PaymentTransactionService.authenticatePaymentMethod UserParameter=PWS-INT.PaymentTransactionService.settle,/data/zabbix/bin/pws-int.sh PaymentTransactionService.settle UserParameter=PWS-INT.VCastPaymentProcessorAdapter.authorize,/data/zabbix/bin/pws-int.sh VCastPaymentProcessorAdapter.authorize UserParameter=PWS-INT.VCastPaymentProcessorAdapter.settle,/data/zabbix/bin/pws-int.sh VCastPaymentProcessorAdapter.settle

 Then you must restart zabbix_agented  You add the UserParameter to anyone server. Please Reference in front of the UserParameter.


shell payflow-int.sh

#:!/bin/sh if ; then echo "Please enter parameter!" else #Sum Total of ThreadCount if ; then echo curl -s 'http://payflow-app0.int.real.com:9080/payflow/status' |grep ServerInfo.JVMInfo|cut -f2 -d "="|cut -f1 -d ","|awk 'BEGIN{sum=0}{sum+=$1}END{ print sum}' fi

    #Sum Total of DBConnection.active
    if  ; then
            echo `curl -s 'http://payflow-app0.int.real.com:9080/payflow/status' |grep DBConnection.DBConnection|cut -f2 -d "="|cut -f1 -d ","|awk 'BEGIN{sum=0}{sum+=

$1}END{print sum}'` fi

   #Sum Total of DBConnection.available
    if  ; then
            echo `curl -s 'http://payflow-app0.int.real.com:9080/payflow/status' |grep DBConnection.DBConnection|cut -f2 -d "="|cut -f2 -d ","|awk 'BEGIN{sum=0}{sum+=

$1}END{print sum}'` fi

    #Sum Total of DBConnection.opened
    if  ; then
            echo `curl -s 'http://payflow-app0.int.real.com:9080/payflow/status' |grep DBConnection.DBConnection|cut -f2 -d "="|cut -f3 -d ","|awk 'BEGIN{sum=0}{sum+=

$1}END{print sum}'` fi

    #Sum Total of PayflowApplication.ModeRequest.NEW_REQUEST
    if  ; then
            echo `curl -s 'http://payflow-app0.int.real.com:9080/payflow/status' |grep PayflowApplication.ModeRequest.NEW_REQUEST|cut -f2 -d "="|cut -f1 -d ","|awk 'B

EGIN{sum=0}{sum+=$1}END{print sum}'` fi

    #Sum Total of PayflowApplication.ModeRequest.SUBMIT
    if  ; then
             echo `curl -s 'http://payflow-app0.int.real.com:9080/payflow/status' |grep PayflowApplication.ModeRequest.SUBMIT|cut -f2 -d "="|cut -f1 -d ","|awk 'BEGIN

{sum=0}{sum+=$1}END{print sum}'` fi

    #Sum Total of Error
    if  ; then
             echo `curl -s 'http://payflow-app0.int.real.com:9080/payflow/status' |grep Error|cut -f2 -d "="|cut -f1 -d ","|awk 'BEGIN{sum=0}{sum+=$1}END{print sum}'`
    fi

fi


Shell pws-int.sh

#!/bin/sh if ; then echo "Please enter parameter!" else #Sum Total of ThreadCount if ; then echo curl -s 'http://pws-app0.int.real.com:8480/pws/status' |grep ServerInfo.JVMInfo|cut -f2 -d "="|cut -f1 -d ","|awk 'BEGIN{sum=0}{sum+=$1}END{print su m}' fi

    #Sum Total of PaymentTransactionService.authorize
    if  ; then
            echo `curl -s 'http://pws-app0.int.real.com:8480/pws/status' |grep PaymentTransactionService.authorize|cut -f2 -d "="|cut -f1 -d ","|awk 'BEGIN{sum=0}{sum

+=$1}END{print sum}'` fi

   #Sum Total of PaymentTransactionService.authenticatePaymentMethod
    if  ; then
            echo `curl -s 'http://pws-app0.int.real.com:8480/pws/status' |grep PaymentTransactionService.authenticatePaymentMethod|cut -f2 -d "="|cut -f2 -d ","|awk '

BEGIN{sum=0}{sum+=$1}END{print sum}'` fi

    #Sum Total of PaymentTransactionService.settle
    if  ; then
            echo `curl -s 'http://pws-app0.int.real.com:8480/pws/status' |grep PaymentTransactionService.settle|cut -f2 -d "="|cut -f3 -d ","|awk 'BEGIN{sum=0}{sum+=$

1}END{print sum}'` fi

    #Sum Total of VCastPaymentProcessorAdapter.authorize
    if  ; then
            echo `curl -s 'http://pws-app0.int.real.com:8480/pws/status' |grep VCastPaymentProcessorAdapter.authorize|cut -f2 -d "="|cut -f1 -d ","|awk 'BEGIN{sum=0}{

sum+=$1}END{print sum}'` fi

    #Sum Total of VCastPaymentProcessorAdapter.settle
    if  ; then
             echo `curl -s 'http://pws-app0.int.real.com:8480/pws/status' |grep VCastPaymentProcessorAdapter.settle|cut -f2 -d "="|cut -f1 -d ","|awk 'BEGIN{sum=0}{su

m+=$1}END{print sum}'` fi

fi


shell rcws-int.sh

#!/bin/sh if ; then echo "Please enter parameter!" else #Sum Total of ThreadCount if ; then echo curl -s 'http://rcws-app0.int.real.com:8380/rcws/status' |grep ServerInfo.JVMInfo|cut -f2 -d "="|cut -f1 -d ","|awk 'BEGIN{sum=0}{sum+=$1}END{print sum}' fi

    #Sum Total of DBConnection.Active
    if  ; then
            echo `curl -s 'http://rcws-app0.int.real.com:8380/rcws/status' |grep DBConnection.DBConnection|cut -f2 -d "="|cut -f1 -d ","|awk 'BEGIN{sum=0}{sum+=$1}END

{print sum}'` fi

   #Sum Total of DBConnection.available
    if  ; then
            echo `curl -s 'http://rcws-app0.int.real.com:8380/rcws/status' |grep DBConnection.DBConnection|cut -f2 -d "="|cut -f2 -d ","|awk 'BEGIN{sum=0}{sum+=$1}END

{print sum}'` fi

    #Sum Total of DBConnection.opened
    if  ; then
            echo `curl -s 'http://rcws-app0.int.real.com:8380/rcws/status' |grep DBConnection.DBConnection|cut -f2 -d "="|cut -f3 -d ","|awk 'BEGIN{sum=0}{sum+=$1}END

{print sum}'` fi

    #Sum Total of createOrder
    if  ; then
            echo `curl -s 'http://rcws-app0.int.real.com:8380/rcws/status' |grep createOrder|cut -f2 -d "="|cut -f1 -d ","|awk 'BEGIN{sum=0}{sum+=$1}END{print sum}'`
    fi

    #Sum Total of createNewOrder
    if  ; then
             echo `curl -s 'http://rcws-app0.int.real.com:8380/rcws/status' |grep createNewOrder|cut -f2 -d "="|cut -f1 -d ","|awk 'BEGIN{sum=0}{sum+=$1}END{print sum

}'` fi

    #Sum Total of PreviewOrder
    if  ; then
             echo `curl -s 'http://rcws-app0.int.real.com:8380/rcws/status' |grep PreviewOrder|cut -f2 -d "="|cut -f1 -d ","|awk 'BEGIN{sum=0}{sum+=$1}END{print sum}'

` fi

    #Sum Total of PWSFacade.authorize
    if  ; then
             echo `curl -s 'http://rcws-app0.int.real.com:8380/rcws/status' |grep PWSFacade.authorize|cut -f2 -d "="|cut -f1 -d ","|awk 'BEGIN{sum=0}{sum+=$1}END{prin

t sum}'` fi

    #Sum Total of PWSFacade.settlementCharge
    if  ; then
             echo `curl -s 'http://rcws-app0.int.real.com:8380/rcws/status' |grep PWSFacade.settlementCharge|cut -f2 -d "="|cut -f1 -d ","|awk 'BEGIN{sum=0}{sum+=$1}E

ND{print sum}'` fi

    #Sum Total of POAPPaymentService.authorizeBill
    if  ; then
             echo `curl -s 'http://rcws-app0.int.real.com:8380/rcws/status' |grep POAPPaymentService.authorizeBill|cut -f2 -d "="|cut -f1 -d ","|awk 'BEGIN{sum=0}{sum

+=$1}END{print sum}'`
fi

fi

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。