<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>琪埃信息系统（上海）有限公司 &#187; 监视服务器</title>
	<atom:link href="http://www.qiais.com/achives/category/%e7%9b%91%e8%a7%86%e6%9c%8d%e5%8a%a1%e5%99%a8/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.qiais.com</link>
	<description>琪埃信息系统</description>
	<lastBuildDate>Tue, 11 Feb 2020 01:50:29 +0000</lastBuildDate>
	<language>zh-CN</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=4.0</generator>
	<item>
		<title>监视服务器Zabbix安装配置以及常见问题</title>
		<link>http://www.qiais.com/achives/788/</link>
		<comments>http://www.qiais.com/achives/788/#comments</comments>
		<pubDate>Sun, 10 May 2015 09:34:00 +0000</pubDate>
		<dc:creator><![CDATA[sai]]></dc:creator>
				<category><![CDATA[监视服务器]]></category>

		<guid isPermaLink="false">http://www.qiais.com/?p=788</guid>
		<description><![CDATA[关于Zabbix 对于服务器架设管理人员来说，Zabbix是一款功能强大而且免费的监视系统。 Zabbix可以...]]></description>
				<content:encoded><![CDATA[<p><strong>关于Zabbix</strong><br />
对于服务器架设管理人员来说，Zabbix是一款功能强大而且免费的监视系统。</p>
<p>Zabbix可以时时刻刻监视我们服务器的运行状态，包括CPU，MEMORY，HDD等。通过创建事件驱动，当硬件达到某设定临界值（比如CPU使用高达90%）时还可以发邮件通知管理者。</p>
<p>Zabbix还可以监视日志，这个非常有用，当我们系统出现异常时，我们可以及时了解系统出现哪些问题，在客户抱怨之前修复改善系统，不至于等到系统快瘫痪了才发现问题。</p>
<p>另外，Zabbix2.4支持中文界面了。</p>
<p><strong>Zabbix安装</strong><br />
详细安装步骤参看官方文档。<br />
源代码安装：</p>
<p>https://www.zabbix.com/documentation/2.4/manual/installation/install</p>
<p>安装包安装：</p>
<p>https://www.zabbix.com/documentation/2.4/manual/installation/install_from_packages</p>
<p>数据库配置：<br />
不管是源代码安装还是安装包安装，我们都需要配置数据库。</p>
<p>https://www.zabbix.com/documentation/2.4/manual/appendix/install/db_scripts</p>
<p>顺利安装后界面<br />
<a href="http://www.qiais.com/wp-content/uploads/2015/05/スクリーンショット-2015-05-10-18.29.57.png"><img src="http://www.qiais.com/wp-content/uploads/2015/05/スクリーンショット-2015-05-10-18.29.57-600x515.png" alt="スクリーンショット 2015-05-10 18.29.57" width="600" height="515" class="alignnone size-medium wp-image-797" /></a></p>
<p><strong>常见问题</strong><br />
1，通过源代码安装，可能会出现zabbix_server,zabbix_agentd不能正常启动，不能正常停止的问题。解决方法为自己编写启动停止脚本，参看下面的脚本。<br />
2，图形界面乱码问题，解决方法参考下面［修复图形界面的乱码］。</p>
<p><strong>Zabbix server启动停止脚本</strong></p>
<pre class="brush: plain; title: ; notranslate">
#!/bin/bash
#
# chkconfig: - 55 45
# description: zabbix_server
# probe: false
 
# Source function library.
. /etc/rc.d/init.d/functions
 
# Source networking configuration.
. /etc/sysconfig/network
 
# Check that networking is up. If you are running without a network, comment this out.
[ &quot;${NETWORKING}&quot; = &quot;no&quot; ] &amp;&amp; exit 0
 
RETVAL=0
progdir=&quot;/usr/local/sbin/&quot;
prog=&quot;zabbix_server&quot;
 
start() {
        # Start daemons.
  if [ -n &quot;`/sbin/pidof $prog`&quot; ]; then
        echo -n &quot;$prog: already running&quot;
        failure $&quot;$prog start&quot;
        echo
        return 1
  fi
        echo -n $&quot;Starting $prog: &quot;
  # we can't seem to use daemon here - emulate its functionality
        su -c $progdir$prog - $USER
  RETVAL=$?
  usleep 100000
  if [ -z &quot;`/sbin/pidof $progdir$prog`&quot; ]; then
        RETVAL=1
  fi
  [ $RETVAL -ne 0 ] &amp;&amp; failure $&quot;$prog startup&quot;
  [ $RETVAL -eq 0 ] &amp;&amp; touch /var/lock/subsys/$prog &amp;&amp; success $&quot;$prog startup&quot;
  echo
  return $RETVAL
}
stop() {
  RETVAL=0
  pid=
        # Stop daemons.
        echo -n $&quot;Stopping $prog: &quot;
  pid=`/sbin/pidof -s $prog`
  if [ -n &quot;$pid&quot; ]; then
   kill -TERM $pid
        else
   failure $&quot;$prog stop&quot;
   echo
   return 1
        fi
  RETVAL=$?
  [ $RETVAL -ne 0 ] &amp;&amp; failure $&quot;$prog stop&quot;
  [ $RETVAL -eq 0 ] &amp;&amp; rm -f /var/lock/subsys/$prog &amp;&amp; success $&quot;$prog stop&quot;
  echo
  return $RETVAL
}
restart() {
  stop
sleep 5
  start
}
 
# See how we were called.
case &quot;$1&quot; in
  start)
        start
        ;;
  stop)
        stop
        ;;
  restart)
        restart
        ;;
  condrestart)
        [ -f /var/lock/subsys/$prog ] &amp;&amp; restart
        ;;
  *)
         echo $&quot;Usage: $0 {start|stop|restart|condrestart}&quot;
        exit 1
esac
 
exit $?
</pre>
<p><strong>Zabbix agentd启动停止脚本</strong></p>
<pre class="brush: plain; title: ; notranslate">
#!/bin/bash
#
# chkconfig: - 55 45
# description: zabbix_agentd
# probe: false
 
# Source function library.
. /etc/rc.d/init.d/functions
 
# Source networking configuration.
. /etc/sysconfig/network
 
# Check that networking is up. If you are running without a network, comment this out.
[ &quot;${NETWORKING}&quot; = &quot;no&quot; ] &amp;&amp; exit 0
 
RETVAL=0
progdir=&quot;/usr/local/sbin/&quot;
prog=&quot;zabbix_agentd&quot;
 
start() {
        # Start daemons.
  if [ -n &quot;`/sbin/pidof $prog`&quot; ]; then
        echo -n &quot;$prog: already running&quot;
        failure $&quot;$prog start&quot;
        echo
        return 1
  fi
        echo -n $&quot;Starting $prog: &quot;
  # we can't seem to use daemon here - emulate its functionality
        su -c $progdir$prog - $USER
  RETVAL=$?
  usleep 100000
  if [ -z &quot;`/sbin/pidof $progdir$prog`&quot; ]; then
        # The child processes have died after fork()ing, e.g.
        # because of a broken config file
        RETVAL=1
  fi
  [ $RETVAL -ne 0 ] &amp;&amp; failure $&quot;$prog startup&quot;
  [ $RETVAL -eq 0 ] &amp;&amp; touch /var/lock/subsys/$prog &amp;&amp; success $&quot;$prog startup&quot;
  echo
  return $RETVAL
}
stop() {
  RETVAL=0
  pid=
        # Stop daemons.
        echo -n $&quot;Stopping $prog: &quot;
  pid=`/sbin/pidof -s $prog`
  if [ -n &quot;$pid&quot; ]; then
   kill -TERM $pid
        else
   failure $&quot;$prog stop&quot;
   echo
   return 1
        fi
  RETVAL=$?
  [ $RETVAL -ne 0 ] &amp;&amp; failure $&quot;$prog stop&quot;
  [ $RETVAL -eq 0 ] &amp;&amp; rm -f /var/lock/subsys/$prog &amp;&amp; success $&quot;$prog stop&quot;
  echo
  return $RETVAL
}
restart() {
  stop
# wait for forked daemons to die
  usleep 1000000
  start
}
 
# See how we were called.
case &quot;$1&quot; in
  start)
        start
        ;;
  stop)
        stop
        ;;
  restart)
        restart
        ;;
  condrestart)
        [ -f /var/lock/subsys/$prog ] &amp;&amp; restart
        ;;
  *)
         echo $&quot;Usage: $0 {start|stop|restart|condrestart}&quot;
        exit 1
esac
 
exit $?
</pre>
<p><strong>修复图形界面的乱码</strong><br />
使用默认的字体的话，内存使用，CPU使用图形界面的中文将会出现乱码。<br />
解决方法就是替换默认字体。<br />
在百度上搜索下载FZLTCHJW.TTF，将其上传到前台PHP的fonts目录<br />
编辑前台PHP的defines.inc.php文件</p>
<pre class="brush: plain; title: ; notranslate">
//define('ZBX_GRAPH_FONT_NAME',         'DejaVuSans'); // font file name
define('ZBX_GRAPH_FONT_NAME',           'FZLTCHJW'); // font file name
</pre>
<p>乱码修复后的界面<br />
<a href="http://www.qiais.com/wp-content/uploads/2015/05/スクリーンショット-2015-05-10-18.27.00.png"><img src="http://www.qiais.com/wp-content/uploads/2015/05/スクリーンショット-2015-05-10-18.27.00-600x364.png" alt="スクリーンショット 2015-05-10 18.27.00" width="600" height="364" class="alignnone size-medium wp-image-795" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.qiais.com/achives/788/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
