-
SHELL> ./configure --prefix=/usr/local/mysql --localstatedir=/var/lib/mysql --with-charset=utf8SHELL> makeSHELL> make installSHELL> cp support-files/my-medium.cnf /etc/my.cnf
-
SHELL> cp support-files/mysql.server /etc/rc.d/init.d/mysqldSHELL> chmod 700 /etc/rc.d/init.d/mysqldSHELL> chkconfig --add mysqld
-
SHELL> groupadd mysql SHELL> useradd -g mysql mysql
-
SHELL> /usr/local/mysql/bin/mysql_install_db --user=mysql SHELL> chown -R root.mysql /var/lib/mysql
-
SHELL> chmod -R 770 /var/lib/mysqlSHELL> /usr/local/mysql/bin/mysqld_safe --user=mysql &SHELL> /etc/rc.d/init.d/mysqld start SHELL> ln -s /usr/local/mysql/bin/mysql /sbin/mysqlSHELL> ln -s /usr/local/mysql/bin/mysqladmin /sbin/mysqladmin
-
SHELL>./configure --prefix=/usr/local/php --enable-fastcgi --with-mysql=/usr/local/mysql --enable-force-cgi-redirect --with-freetype-dir=/usr --with-png-dir=/usr --with-gd --enable-gd-native-ttf --with-ttf --with-gdbm --with-gettext --with-iconv --with-jpeg-dir=/usr --with-zlib --with-xmlrpc --enable-calendar --enable-mbstring SHELL> makeSHELL> make installSHELL>cp -a php.ini-dist /usr/local/php/lib/php.ini
-
#!/bin/bashPHPFCGI="/usr/local/php/bin/php-cgi"FCGIPORT="8888"FCGI_WEB_SERVER_ADDRS="127.0.0.1"FCGIADDR="127.0.0.1"PHP_FCGI_CHILDREN=5PHP_FCGI_MAX_REQUESTS=1000ALLOWED_ENV="ORACLE_HOME PATH USER"if test x$PHP_FCGI_CHILDREN = x; then PHP_FCGI_CHILDREN=5fiALLOWED_ENV="$ALLOWED_ENV PHP_FCGI_CHILDREN"ALLOWED_ENV="$ALLOWED_ENV PHP_FCGI_MAX_REQUESTS"ALLOWED_ENV="$ALLOWED_ENV FCGI_WEB_SERVER_ADDRS"if test x$UID = x0; then EX="/bin/bash -m -c \"$PHPFCGI -q -b $FCGIADDR:$FCGIPORT\" $USERID"else EX="$PHPFCGI -b $FCGIADDR:$FCGIPORT"fiecho $EXE=for i in $ALLOWED_ENV; do E="$E $i=${!i}"donenohup env - $E sh -c "$EX" &> /dev/null &
-
SHELL> ./configureSHELL> makeSHELL> maie install
-
虚似机主代码
-
server { listen 80;
-
server_name 192.168.1.5; server_name 114.85.165.156; location / { root /var/www/zabbix; index index.html index.htm index.php; }location ~ .php$ { fastcgi_pass 127.0.0.1:8888; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /var/www/zabbix$fastcgi_script_name; fastcgi_param QUERY_STRING $query_string; fastcgi_param REQUEST_METHOD $request_method; fastcgi_param CONTENT_TYPE $content_type; fastcgi_param CONTENT_LENGTH $content_length; } }
-
SHELL> mysql -u<username> -p<password>mysql> create database zabbix;mysql> quit;SHELL> cd create/schemaSHELL> cat mysql.sql | mysql -u<username> -p<password> zabbixSHELL> cd ../dataSHELL> cat data.sql | mysql -u<username> -p<password> zabbixSHELL> cat p_w_picpaths_mysql.sql | mysql -u<username> -p<password> zabbix
-
SHELL> ./configure --prefix=/usr/local/zabbix--enable-server --enable-agent --with-mysql=/usr/loca/mysql/bin/mysq_config --with-net-snmp --with-jabber --with-libcurlSHELL> makeSHELL> make installSHELL> vi /etc/servicesSHELL> zabbix-agent 10050/tcp Zabbix AgentSHELL> zabbix-agent 10050/udp Zabbix AgentSHELL> zabbix-trapper 10051/tcp Zabbix TrapperSHELL> zabbix-trapper 10051/udp Zabbix Trapper
-
SHELL> ./configure --prefix=/usr/local/zabbix --enable-agentSHELL> make SHELL> make install
-
SHELL> vi frontends/php/include/db.inc.phpSHELL> cp -a frontends/php /var/www/zabbix $DB_TYPE ="MYSQL"; $DB_SERVER ="localhost";$DB_DATABASE ="zabbix";$DB_USER ="zabbix";$DB_PWD ="";SHELL> cp -a frontends/php /var/www/zabbix SHELL> chown -R zabbix.zabbix /var/www/zabbixSHELL> chmod -R 774 /var/www/zabbix
-
SHELL> vi /var/www/zabbix/include/page_header.php把457行替换成如下$printview = new CLink(S_PRINT,'192.168.1.5'.(empty($_GET)?'?':'&').'print=1', 'small_font');
-
SHELL> mkdir /etc/zabbixSHELL> cp misc/conf/* /etc/zabbix/
-
zabbix_agentd.conf如下Server=192.168.1.5Hostname=ZABBIX ServerListenPort=10050ListenIP=192.168.1.5 注:这里千万注意写公网IP,不要127.0.0.1我绕了好大圈子总算查出这个问题StartAgents=3RefreshActiveChecks=120DisableActive=1DebugLevel=3PidFile=/var/tmp/zabbix_agentd.pidLogFile=/tmp/zabbix_agentd.logTimeout=3UserParameter=mysql.ping,mysqladmin -uroot ping|grep alive|wc -lUserParameter=mysql.uptime,mysqladmin -uroot status|cut -f2 -d":"|cut -f1 -d"T"UserParameter=mysql.threads,mysqladmin -uroot status|cut -f3 -d":"|cut -f1 -d"Q"UserParameter=mysql.questions,mysqladmin -uroot status|cut -f4 -d":"|cut -f1 -d"S"UserParameter=mysql.slowqueries,mysqladmin -uroot status|cut -f5 -d":"|cut -f1 -d"O"UserParameter=mysql.qps,mysqladmin -uroot status|cut -f9 -d":"UserParameter=mysql.version,mysql -V
-
zabbix_agent.conf如下Server=192.168.1.5Timeout=3UserParameter=mysql.ping,mysqladmin -uroot ping|grep alive|wc -lUserParameter=mysql.uptime,mysqladmin -uroot status|cut -f2 -d":"|cut -f1 -d"T"UserParameter=mysql.threads,mysqladmin -uroot status|cut -f3 -d":"|cut -f1 -d"Q"UserParameter=mysql.questions,mysqladmin -uroot status|cut -f4 -d":"|cut -f1 -d"S"UserParameter=mysql.slowqueries,mysqladmin -uroot status|cut -f5 -d":"|cut -f1 -d"O"UserParameter=mysql.qps,mysqladmin -uroot status|cut -f9 -d":"UserParameter=mysql.version,mysql -V
-
zabbix_server.conf如下NodeID=0StartPollers=5StartTrappers=5ListenPort=10051HousekeepingFrequency=1SenderFrequency=30DebugLevel=3Timeout=5UnavailableDelay=15UnavailableDelay=60PidFile=/var/tmp/zabbix_server.pidLogFile=/tmp/zabbix_server.logAlertScriptsPath=/home/zabbix/bin/PingerFrequency=30DBHost=localhostDBName=zabbixDBUser=rootDBPassword=DBSocket=/tmp/mysql.sock
-
zabbix_trapper.conf如下DebugLevel=3imeout=3LogFile=/tmp/zabbix_trapper.logDBHost=localhostDBName=zabbixDBUser=rootDBPassword=DBSocket=/tmp/mysql.sock
-
SEHLL> cp misc/init.d/redhat/zabbix_* /usr/local/zabbix/sbin/编辑zabbix_agentd_ctl 和 zabbix_server_ctlBASEDIR=/usr/local/zabbix 为指定的zabbix安装目录.zabbix_server_ctl文件中的ZABBIX_SUCKERD=$BASEDIR/sbin/zabbix_server6.启动服务:服务器端SEHLL> /usr/local/zabbix/bin/zabbix_server_ctl start客户端SEHLL> /usr/local/zabbix/bin/zabbix_agentd_ctl start
-
SHELL> echo "/usr/local/zabbix/sbin/zabbix_agentd_ctl start" >> /etc/rc.localSHELL> echo "/usr/local/zabbix/sbin/zabbix_server_ctl start" >> /etc/rc.locaSHELL> echo "/usr/local/nginx/sbin/nginx " >> /etc/rc.localSHELL> echo "/shell/php-cgi start" >> /etc/rc.localSHELL> echo "/etc/rc.d/mysqld start" >> /etc/rc.local
-
1、解压bin\win32\zabbix_agentd.exe和misc/conf/zabbix_agentd.conf把这两个文件放到C盘根目录
-
2、创建zabbix_agentd.log存C盘根目录
-
3、设置zabbix_agentd.conf如下配置
-
-
Server=192.168.1.5Hostname=ZABBIX ServerListenPort=10050ListenIP=192.168.1.100 StartAgents=3RefreshActiveChecks=120DisableActive=1DebugLevel=3PidFile=C:\zabbix_agentd.pidLogFile=C:\zabbix_agentd.logTimeout=3UserParameter=mysql.ping,mysqladmin -uroot ping|grep alive|wc -lUserParameter=mysql.uptime,mysqladmin -uroot status|cut -f2 -d":"|cut -f1 -d"T"UserParameter=mysql.threads,mysqladmin -uroot status|cut -f3 -d":"|cut -f1 -d"Q"UserParameter=mysql.questions,mysqladmin -uroot status|cut -f4 -d":"|cut -f1 -d"S"UserParameter=mysql.slowqueries,mysqladmin -uroot status|cut -f5 -d":"|cut -f1 -d"O"UserParameter=mysql.qps,mysqladmin -uroot status|cut -f9 -d":"UserParameter=mysql.version,mysql -V
-
-
4、运行安装zabbix_agentd.exe -i
-
5、管理服务里面开启ZABBIX服务