服务器监控之zabbix监控Nginx篇

原创 2016年05月31日 09:40:39

最近一直在做服务器端性能优化的事, 而监控是性能优化的首要条件.下面是用zabbix监控Nginx安装的过程:

1.linux下Nginx的安装

大家可以参考我以前写的Nginx安装配置篇(Session共享)

2. 配置Nginx_status

在${NGINX_HOME}/conf/nginx.conf的server{}中添加以代码:
        location /nginx_status {
                stub_status on;
                access_log  off;
                #allow 127.0.0.1;
                #deny all;
        }
注: 为了安全可以添加allow, deny; allow 是允许某个ip或者一个ip段访问, deny禁止某个ip或者一个ip段访问;

3. 安装zabbix_server与zabbix_agent

大家可以去网上找找相关的资料.

4. 配置zabbix_agent: /etc/zabbix/zabbix_agentd.conf文件

Server=zabbix_server的ip
ServerActive=zabbix_server的ip
Hostname=本机ip #不要写127.0.0.1

5. 添加nginx_status.sh脚本文件

#!/bin/bash

#script to fetch nginx statuses for tribily monitoring systems
# Author: krish@toonheart.com
# License: GPLv2
# Set Variables
BKUP_DATE=`/bin/date +%Y%m%d`
LOG="/data/log/zabbix/webstatus.log"
HOST=127.0.0.1
PORT="80"
# Functions to return nginx stats
function active {
  /usr/bin/curl "http://$HOST:$PORT/nginx_status" 2>/dev/null| grep 'Active' | awk '{print $NF}'
}
function reading {
  /usr/bin/curl "http://$HOST:$PORT/nginx_status" 2>/dev/null| grep 'Reading' | awk '{print $2}'
}
function writing {
  /usr/bin/curl "http://$HOST:$PORT/nginx_status" 2>/dev/null| grep 'Writing' | awk '{print $4}'
}
function waiting {
  /usr/bin/curl "http://$HOST:$PORT/nginx_status" 2>/dev/null| grep 'Waiting' | awk '{print $6}'
}
function accepts {
  /usr/bin/curl "http://$HOST:$PORT/nginx_status" 2>/dev/null| awk NR==3 | awk '{print $1}'
}
function handled {
  /usr/bin/curl "http://$HOST:$PORT/nginx_status" 2>/dev/null| awk NR==3 | awk '{print $2}'
}
function requests {
  /usr/bin/curl "http://$HOST:$PORT/nginx_status" 2>/dev/null| awk NR==3 | awk '{print $3}'
}
# Run the requested function
$1

6. 在/etc/zabbix/zabbix_agentd.d/下添加zabbix_nginx的数据收集文件userparameter_nginx.conf

UserParameter=nginx.accepts,/etc/zabbix/scripts/nginx_status.sh accepts
UserParameter=nginx.handled,/etc/zabbix/scripts/nginx_status.sh handled  
UserParameter=nginx.requests,/etc/zabbix/scripts/nginx_status.sh requests  
UserParameter=nginx.connections.active,/etc/zabbix/scripts/nginx_status.sh active  
UserParameter=nginx.connections.reading,/etc/zabbix/scripts/nginx_status.sh reading  
UserParameter=nginx.connections.writing,/etc/zabbix/scripts/nginx_status.sh writing  
UserParameter=nginx.connections.waiting,/etc/zabbix/scripts/nginx_status.sh waiting

7. 重启zabbix-agent服务

service zabbix-agent restart

8.测试zabbix-server可以获取数据

zabbix_get -s nginx服务ip -p 10050 -k "nginx.connections.active"

9. 配置zabbix-server的nginx status模版

<?xml version="1.0" encoding="UTF-8"?>
<zabbix_export version="1.0" date="14.03.11" time="08.48">
  <hosts>
    <host name="Nginx Status">
      <proxy_hostid>0</proxy_hostid>
      <useip>1</useip>
      <dns></dns>
      <ip>127.0.0.1</ip>
      <port>10050</port>
      <status>3</status>
      <useipmi>0</useipmi>
      <ipmi_ip>127.0.0.1</ipmi_ip>
      <ipmi_port>623</ipmi_port>
      <ipmi_authtype>0</ipmi_authtype>
      <ipmi_privilege>2</ipmi_privilege>
      <ipmi_username></ipmi_username>
      <ipmi_password></ipmi_password>
      <groups>
        <group>Freetrade</group>
      </groups>
      <triggers/>
      <items>
        <item type="7" key="nginx.accepts" value_type="3">
          <description>Nginx Accepts</description>
          <ipmi_sensor></ipmi_sensor>
          <delay>30</delay>
          <history>365</history>
          <trends>365</trends>
          <status>0</status>
          <data_type>0</data_type>
          <units></units>
          <multiplier>0</multiplier>
          <delta>0</delta>
          <formula>0</formula>
          <lastlogsize>0</lastlogsize>
          <logtimefmt></logtimefmt>
          <delay_flex></delay_flex>
          <authtype>0</authtype>
          <username></username>
          <password></password>
          <publickey></publickey>
          <privatekey></privatekey>
          <params></params>
          <trapper_hosts>localhost</trapper_hosts>
          <snmp_community></snmp_community>
          <snmp_oid></snmp_oid>
          <snmp_port>161</snmp_port>
          <snmpv3_securityname></snmpv3_securityname>
          <snmpv3_securitylevel>0</snmpv3_securitylevel>
          <snmpv3_authpassphrase></snmpv3_authpassphrase>
          <snmpv3_privpassphrase></snmpv3_privpassphrase>
          <applications>
            <application>Nginx</application>
          </applications>
        </item>
        <item type="7" key="nginx.connections.active" value_type="3">
          <description>Nginx Connections Active</description>
          <ipmi_sensor></ipmi_sensor>
          <delay>30</delay>
          <history>365</history>
          <trends>365</trends>
          <status>0</status>
          <data_type>0</data_type>
          <units></units>
          <multiplier>0</multiplier>
          <delta>0</delta>
          <formula>0</formula>
          <lastlogsize>0</lastlogsize>
          <logtimefmt></logtimefmt>
          <delay_flex></delay_flex>
          <authtype>0</authtype>
          <username></username>
          <password></password>
          <publickey></publickey>
          <privatekey></privatekey>
          <params></params>
          <trapper_hosts>localhost</trapper_hosts>
          <snmp_community></snmp_community>
          <snmp_oid></snmp_oid>
          <snmp_port>161</snmp_port>
          <snmpv3_securityname></snmpv3_securityname>
          <snmpv3_securitylevel>0</snmpv3_securitylevel>
          <snmpv3_authpassphrase></snmpv3_authpassphrase>
          <snmpv3_privpassphrase></snmpv3_privpassphrase>
          <applications>
            <application>Nginx</application>
          </applications>
        </item>
        <item type="7" key="nginx.connections.reading" value_type="3">
          <description>Nginx Connections Reading</description>
          <ipmi_sensor></ipmi_sensor>
          <delay>30</delay>
          <history>365</history>
          <trends>365</trends>
          <status>0</status>
          <data_type>0</data_type>
          <units></units>
          <multiplier>0</multiplier>
          <delta>0</delta>
          <formula>0</formula>
          <lastlogsize>0</lastlogsize>
          <logtimefmt></logtimefmt>
          <delay_flex></delay_flex>
          <authtype>0</authtype>
          <username></username>
          <password></password>
          <publickey></publickey>
          <privatekey></privatekey>
          <params></params>
          <trapper_hosts>localhost</trapper_hosts>
          <snmp_community></snmp_community>
          <snmp_oid></snmp_oid>
          <snmp_port>161</snmp_port>
          <snmpv3_securityname></snmpv3_securityname>
          <snmpv3_securitylevel>0</snmpv3_securitylevel>
          <snmpv3_authpassphrase></snmpv3_authpassphrase>
          <snmpv3_privpassphrase></snmpv3_privpassphrase>
          <applications>
            <application>Nginx</application>
          </applications>
        </item>
        <item type="7" key="nginx.connections.waiting" value_type="3">
          <description>Nginx Connections Waiting</description>
          <ipmi_sensor></ipmi_sensor>
          <delay>30</delay>
          <history>365</history>
          <trends>365</trends>
          <status>0</status>
          <data_type>0</data_type>
          <units></units>
          <multiplier>0</multiplier>
          <delta>0</delta>
          <formula>0</formula>
          <lastlogsize>0</lastlogsize>
          <logtimefmt></logtimefmt>
          <delay_flex></delay_flex>
          <authtype>0</authtype>
          <username></username>
          <password></password>
          <publickey></publickey>
          <privatekey></privatekey>
          <params></params>
          <trapper_hosts>localhost</trapper_hosts>
          <snmp_community></snmp_community>
          <snmp_oid></snmp_oid>
          <snmp_port>161</snmp_port>
          <snmpv3_securityname></snmpv3_securityname>
          <snmpv3_securitylevel>0</snmpv3_securitylevel>
          <snmpv3_authpassphrase></snmpv3_authpassphrase>
          <snmpv3_privpassphrase></snmpv3_privpassphrase>
          <applications>
            <application>Nginx</application>
          </applications>
        </item>
        <item type="7" key="nginx.connections.writing" value_type="3">
          <description>Nginx Connections Writing</description>
          <ipmi_sensor></ipmi_sensor>
          <delay>30</delay>
          <history>365</history>
          <trends>365</trends>
          <status>0</status>
          <data_type>0</data_type>
          <units></units>
          <multiplier>0</multiplier>
          <delta>0</delta>
          <formula>0</formula>
          <lastlogsize>0</lastlogsize>
          <logtimefmt></logtimefmt>
          <delay_flex></delay_flex>
          <authtype>0</authtype>
          <username></username>
          <password></password>
          <publickey></publickey>
          <privatekey></privatekey>
          <params></params>
          <trapper_hosts>localhost</trapper_hosts>
          <snmp_community></snmp_community>
          <snmp_oid></snmp_oid>
          <snmp_port>161</snmp_port>
          <snmpv3_securityname></snmpv3_securityname>
          <snmpv3_securitylevel>0</snmpv3_securitylevel>
          <snmpv3_authpassphrase></snmpv3_authpassphrase>
          <snmpv3_privpassphrase></snmpv3_privpassphrase>
          <applications>
            <application>Nginx</application>
          </applications>
        </item>
        <item type="7" key="nginx.handled" value_type="3">
          <description>Nginx Handled</description>
          <ipmi_sensor></ipmi_sensor>
          <delay>30</delay>
          <history>365</history>
          <trends>365</trends>
          <status>0</status>
          <data_type>0</data_type>
          <units></units>
          <multiplier>0</multiplier>
          <delta>0</delta>
          <formula>0</formula>
          <lastlogsize>0</lastlogsize>
          <logtimefmt></logtimefmt>
          <delay_flex></delay_flex>
          <authtype>0</authtype>
          <username></username>
          <password></password>
          <publickey></publickey>
          <privatekey></privatekey>
          <params></params>
          <trapper_hosts>localhost</trapper_hosts>
          <snmp_community></snmp_community>
          <snmp_oid></snmp_oid>
          <snmp_port>161</snmp_port>
          <snmpv3_securityname></snmpv3_securityname>
          <snmpv3_securitylevel>0</snmpv3_securitylevel>
          <snmpv3_authpassphrase></snmpv3_authpassphrase>
          <snmpv3_privpassphrase></snmpv3_privpassphrase>
          <applications>
            <application>Nginx</application>
          </applications>
        </item>
        <item type="7" key="nginx.requests" value_type="3">
          <description>Nginx Requests</description>
          <ipmi_sensor></ipmi_sensor>
          <delay>30</delay>
          <history>365</history>
          <trends>365</trends>
          <status>0</status>
          <data_type>0</data_type>
          <units></units>
          <multiplier>0</multiplier>
          <delta>0</delta>
          <formula>0</formula>
          <lastlogsize>0</lastlogsize>
          <logtimefmt></logtimefmt>
          <delay_flex></delay_flex>
          <authtype>0</authtype>
          <username></username>
          <password></password>
          <publickey></publickey>
          <privatekey></privatekey>
          <params></params>
          <trapper_hosts>localhost</trapper_hosts>
          <snmp_community></snmp_community>
          <snmp_oid></snmp_oid>
          <snmp_port>161</snmp_port>
          <snmpv3_securityname></snmpv3_securityname>
          <snmpv3_securitylevel>0</snmpv3_securitylevel>
          <snmpv3_authpassphrase></snmpv3_authpassphrase>
          <snmpv3_privpassphrase></snmpv3_privpassphrase>
          <applications>
            <application>Nginx</application>
          </applications>
        </item>
      </items>
      <templates/>
      <graphs>
        <graph name="Nginx Socket Status" width="900" height="200">
          <ymin_type>0</ymin_type>
          <ymax_type>0</ymax_type>
          <ymin_item_key></ymin_item_key>
          <ymax_item_key></ymax_item_key>
          <show_work_period>1</show_work_period>
          <show_triggers>1</show_triggers>
          <graphtype>0</graphtype>
          <yaxismin>0.0000</yaxismin>
          <yaxismax>100.0000</yaxismax>
          <show_legend>0</show_legend>
          <show_3d>0</show_3d>
          <percent_left>0.0000</percent_left>
          <percent_right>0.0000</percent_right>
          <graph_elements>
            <graph_element item="Nginx Status:nginx.accepts">
              <drawtype>0</drawtype>
              <sortorder>0</sortorder>
              <color>00EE00</color>
              <yaxisside>0</yaxisside>
              <calc_fnc>2</calc_fnc>
              <type>0</type>
              <periods_cnt>5</periods_cnt>
            </graph_element>
            <graph_element item="Nginx Status:nginx.handled">
              <drawtype>0</drawtype>
              <sortorder>0</sortorder>
              <color>EE0000</color>
              <yaxisside>0</yaxisside>
              <calc_fnc>2</calc_fnc>
              <type>0</type>
              <periods_cnt>5</periods_cnt>
            </graph_element>
            <graph_element item="Nginx Status:nginx.requests">
              <drawtype>0</drawtype>
              <sortorder>1</sortorder>
              <color>EEEE00</color>
              <yaxisside>0</yaxisside>
              <calc_fnc>2</calc_fnc>
              <type>0</type>
              <periods_cnt>5</periods_cnt>
            </graph_element>
          </graph_elements>
        </graph>
        <graph name="Nginx Clients Status" width="900" height="200">
          <ymin_type>0</ymin_type>
          <ymax_type>0</ymax_type>
          <ymin_item_key></ymin_item_key>
          <ymax_item_key></ymax_item_key>
          <show_work_period>1</show_work_period>
          <show_triggers>1</show_triggers>
          <graphtype>0</graphtype>
          <yaxismin>0.0000</yaxismin>
          <yaxismax>100.0000</yaxismax>
          <show_legend>0</show_legend>
          <show_3d>0</show_3d>
          <percent_left>0.0000</percent_left>
          <percent_right>0.0000</percent_right>
          <graph_elements>
            <graph_element item="Nginx Status:nginx.connections.active">
              <drawtype>0</drawtype>
              <sortorder>0</sortorder>
              <color>0000EE</color>
              <yaxisside>0</yaxisside>
              <calc_fnc>2</calc_fnc>
              <type>0</type>
              <periods_cnt>5</periods_cnt>
            </graph_element>
            <graph_element item="Nginx Status:nginx.connections.writing">
              <drawtype>0</drawtype>
              <sortorder>1</sortorder>
              <color>EE0000</color>
              <yaxisside>0</yaxisside>
              <calc_fnc>2</calc_fnc>
              <type>0</type>
              <periods_cnt>5</periods_cnt>
            </graph_element>
            <graph_element item="Nginx Status:nginx.connections.waiting">
              <drawtype>0</drawtype>
              <sortorder>2</sortorder>
              <color>EEEE00</color>
              <yaxisside>0</yaxisside>
              <calc_fnc>2</calc_fnc>
              <type>0</type>
              <periods_cnt>5</periods_cnt>
            </graph_element>
            <graph_element item="Nginx Status:nginx.connections.reading">
              <drawtype>0</drawtype>
              <sortorder>3</sortorder>
              <color>00EE00</color>
              <yaxisside>0</yaxisside>
              <calc_fnc>2</calc_fnc>
              <type>0</type>
              <periods_cnt>5</periods_cnt>
            </graph_element>
          </graph_elements>
        </graph>
      </graphs>
      <macros/>
    </host>
  </hosts>
  <dependencies/><?xml version="1.0" encoding="UTF-8"?>
<zabbix_export version="1.0" date="14.03.11" time="08.48">
  <hosts>
    <host name="Nginx Status">
      <proxy_hostid>0</proxy_hostid>
      <useip>1</useip>
      <dns></dns>
      <ip>127.0.0.1</ip>
      <port>10050</port>
      <status>3</status>
      <useipmi>0</useipmi>
      <ipmi_ip>127.0.0.1</ipmi_ip>
      <ipmi_port>623</ipmi_port>
      <ipmi_authtype>0</ipmi_authtype>
      <ipmi_privilege>2</ipmi_privilege>
      <ipmi_username></ipmi_username>
      <ipmi_password></ipmi_password>
      <groups>
        <group>Freetrade</group>
      </groups>
      <triggers/>
      <items>
        <item type="7" key="nginx.accepts" value_type="3">
          <description>Nginx Accepts</description>
          <ipmi_sensor></ipmi_sensor>
          <delay>30</delay>
          <history>365</history>
          <trends>365</trends>
          <status>0</status>
          <data_type>0</data_type>
          <units></units>
          <multiplier>0</multiplier>
          <delta>0</delta>
          <formula>0</formula>
          <lastlogsize>0</lastlogsize>
          <logtimefmt></logtimefmt>
          <delay_flex></delay_flex>
          <authtype>0</authtype>
          <username></username>
          <password></password>
          <publickey></publickey>
          <privatekey></privatekey>
          <params></params>
          <trapper_hosts>localhost</trapper_hosts>
          <snmp_community></snmp_community>
          <snmp_oid></snmp_oid>
          <snmp_port>161</snmp_port>
          <snmpv3_securityname></snmpv3_securityname>
          <snmpv3_securitylevel>0</snmpv3_securitylevel>
          <snmpv3_authpassphrase></snmpv3_authpassphrase>
          <snmpv3_privpassphrase></snmpv3_privpassphrase>
          <applications>
            <application>Nginx</application>
          </applications>
        </item>
        <item type="7" key="nginx.connections.active" value_type="3">
          <description>Nginx Connections Active</description>
          <ipmi_sensor></ipmi_sensor>
          <delay>30</delay>
          <history>365</history>
          <trends>365</trends>
          <status>0</status>
          <data_type>0</data_type>
          <units></units>
          <multiplier>0</multiplier>
          <delta>0</delta>
          <formula>0</formula>
          <lastlogsize>0</lastlogsize>
          <logtimefmt></logtimefmt>
          <delay_flex></delay_flex>
          <authtype>0</authtype>
          <username></username>
          <password></password>
          <publickey></publickey>
          <privatekey></privatekey>
          <params></params>
          <trapper_hosts>localhost</trapper_hosts>
          <snmp_community></snmp_community>
          <snmp_oid></snmp_oid>
          <snmp_port>161</snmp_port>
          <snmpv3_securityname></snmpv3_securityname>
          <snmpv3_securitylevel>0</snmpv3_securitylevel>
          <snmpv3_authpassphrase></snmpv3_authpassphrase>
          <snmpv3_privpassphrase></snmpv3_privpassphrase>
          <applications>
            <application>Nginx</application>
          </applications>
        </item>
        <item type="7" key="nginx.connections.reading" value_type="3">
          <description>Nginx Connections Reading</description>
          <ipmi_sensor></ipmi_sensor>
          <delay>30</delay>
          <history>365</history>
          <trends>365</trends>
          <status>0</status>
          <data_type>0</data_type>
          <units></units>
          <multiplier>0</multiplier>
          <delta>0</delta>
          <formula>0</formula>
          <lastlogsize>0</lastlogsize>
          <logtimefmt></logtimefmt>
          <delay_flex></delay_flex>
          <authtype>0</authtype>
          <username></username>
          <password></password>
          <publickey></publickey>
          <privatekey></privatekey>
          <params></params>
          <trapper_hosts>localhost</trapper_hosts>
          <snmp_community></snmp_community>
          <snmp_oid></snmp_oid>
          <snmp_port>161</snmp_port>
          <snmpv3_securityname></snmpv3_securityname>
          <snmpv3_securitylevel>0</snmpv3_securitylevel>
          <snmpv3_authpassphrase></snmpv3_authpassphrase>
          <snmpv3_privpassphrase></snmpv3_privpassphrase>
          <applications>
            <application>Nginx</application>
          </applications>
        </item>
        <item type="7" key="nginx.connections.waiting" value_type="3">
          <description>Nginx Connections Waiting</description>
          <ipmi_sensor></ipmi_sensor>
          <delay>30</delay>
          <history>365</history>
          <trends>365</trends>
          <status>0</status>
          <data_type>0</data_type>
          <units></units>
          <multiplier>0</multiplier>
          <delta>0</delta>
          <formula>0</formula>
          <lastlogsize>0</lastlogsize>
          <logtimefmt></logtimefmt>
          <delay_flex></delay_flex>
          <authtype>0</authtype>
          <username></username>
          <password></password>
          <publickey></publickey>
          <privatekey></privatekey>
          <params></params>
          <trapper_hosts>localhost</trapper_hosts>
          <snmp_community></snmp_community>
          <snmp_oid></snmp_oid>
          <snmp_port>161</snmp_port>
          <snmpv3_securityname></snmpv3_securityname>
          <snmpv3_securitylevel>0</snmpv3_securitylevel>
          <snmpv3_authpassphrase></snmpv3_authpassphrase>
          <snmpv3_privpassphrase></snmpv3_privpassphrase>
          <applications>
            <application>Nginx</application>
          </applications>
        </item>
        <item type="7" key="nginx.connections.writing" value_type="3">
          <description>Nginx Connections Writing</description>
          <ipmi_sensor></ipmi_sensor>
          <delay>30</delay>
          <history>365</history>
          <trends>365</trends>
          <status>0</status>
          <data_type>0</data_type>
          <units></units>
          <multiplier>0</multiplier>
          <delta>0</delta>
          <formula>0</formula>
          <lastlogsize>0</lastlogsize>
          <logtimefmt></logtimefmt>
          <delay_flex></delay_flex>
          <authtype>0</authtype>
          <username></username>
          <password></password>
          <publickey></publickey>
          <privatekey></privatekey>
          <params></params>
          <trapper_hosts>localhost</trapper_hosts>
          <snmp_community></snmp_community>
          <snmp_oid></snmp_oid>
          <snmp_port>161</snmp_port>
          <snmpv3_securityname></snmpv3_securityname>
          <snmpv3_securitylevel>0</snmpv3_securitylevel>
          <snmpv3_authpassphrase></snmpv3_authpassphrase>
          <snmpv3_privpassphrase></snmpv3_privpassphrase>
          <applications>
            <application>Nginx</application>
          </applications>
        </item>
        <item type="7" key="nginx.handled" value_type="3">
          <description>Nginx Handled</description>
          <ipmi_sensor></ipmi_sensor>
          <delay>30</delay>
          <history>365</history>
          <trends>365</trends>
          <status>0</status>
          <data_type>0</data_type>
          <units></units>
          <multiplier>0</multiplier>
          <delta>0</delta>
          <formula>0</formula>
          <lastlogsize>0</lastlogsize>
          <logtimefmt></logtimefmt>
          <delay_flex></delay_flex>
          <authtype>0</authtype>
          <username></username>
          <password></password>
          <publickey></publickey>
          <privatekey></privatekey>
          <params></params>
          <trapper_hosts>localhost</trapper_hosts>
          <snmp_community></snmp_community>
          <snmp_oid></snmp_oid>
          <snmp_port>161</snmp_port>
          <snmpv3_securityname></snmpv3_securityname>
          <snmpv3_securitylevel>0</snmpv3_securitylevel>
          <snmpv3_authpassphrase></snmpv3_authpassphrase>
          <snmpv3_privpassphrase></snmpv3_privpassphrase>
          <applications>
            <application>Nginx</application>
          </applications>
        </item>
        <item type="7" key="nginx.requests" value_type="3">
          <description>Nginx Requests</description>
          <ipmi_sensor></ipmi_sensor>
          <delay>30</delay>
          <history>365</history>
          <trends>365</trends>
          <status>0</status>
          <data_type>0</data_type>
          <units></units>
          <multiplier>0</multiplier>
          <delta>0</delta>
          <formula>0</formula>
          <lastlogsize>0</lastlogsize>
          <logtimefmt></logtimefmt>
          <delay_flex></delay_flex>
          <authtype>0</authtype>
          <username></username>
          <password></password>
          <publickey></publickey>
          <privatekey></privatekey>
          <params></params>
          <trapper_hosts>localhost</trapper_hosts>
          <snmp_community></snmp_community>
          <snmp_oid></snmp_oid>
          <snmp_port>161</snmp_port>
          <snmpv3_securityname></snmpv3_securityname>
          <snmpv3_securitylevel>0</snmpv3_securitylevel>
          <snmpv3_authpassphrase></snmpv3_authpassphrase>
          <snmpv3_privpassphrase></snmpv3_privpassphrase>
          <applications>
            <application>Nginx</application>
          </applications>
        </item>
      </items>
      <templates/>
      <graphs>
        <graph name="Nginx Socket Status" width="900" height="200">
          <ymin_type>0</ymin_type>
          <ymax_type>0</ymax_type>
          <ymin_item_key></ymin_item_key>
          <ymax_item_key></ymax_item_key>
          <show_work_period>1</show_work_period>
          <show_triggers>1</show_triggers>
          <graphtype>0</graphtype>
          <yaxismin>0.0000</yaxismin>
          <yaxismax>100.0000</yaxismax>
          <show_legend>0</show_legend>
          <show_3d>0</show_3d>
          <percent_left>0.0000</percent_left>
          <percent_right>0.0000</percent_right>
          <graph_elements>
            <graph_element item="Nginx Status:nginx.accepts">
              <drawtype>0</drawtype>
              <sortorder>0</sortorder>
              <color>00EE00</color>
              <yaxisside>0</yaxisside>
              <calc_fnc>2</calc_fnc>
              <type>0</type>
              <periods_cnt>5</periods_cnt>
            </graph_element>
            <graph_element item="Nginx Status:nginx.handled">
              <drawtype>0</drawtype>
              <sortorder>0</sortorder>
              <color>EE0000</color>
              <yaxisside>0</yaxisside>
              <calc_fnc>2</calc_fnc>
              <type>0</type>
              <periods_cnt>5</periods_cnt>
            </graph_element>
            <graph_element item="Nginx Status:nginx.requests">
              <drawtype>0</drawtype>
              <sortorder>1</sortorder>
              <color>EEEE00</color>
              <yaxisside>0</yaxisside>
              <calc_fnc>2</calc_fnc>
              <type>0</type>
              <periods_cnt>5</periods_cnt>
            </graph_element>
          </graph_elements>
        </graph>
        <graph name="Nginx Clients Status" width="900" height="200">
          <ymin_type>0</ymin_type>
          <ymax_type>0</ymax_type>
          <ymin_item_key></ymin_item_key>
          <ymax_item_key></ymax_item_key>
          <show_work_period>1</show_work_period>
          <show_triggers>1</show_triggers>
          <graphtype>0</graphtype>
          <yaxismin>0.0000</yaxismin>
          <yaxismax>100.0000</yaxismax>
          <show_legend>0</show_legend>
          <show_3d>0</show_3d>
          <percent_left>0.0000</percent_left>
          <percent_right>0.0000</percent_right>
          <graph_elements>
            <graph_element item="Nginx Status:nginx.connections.active">
              <drawtype>0</drawtype>
              <sortorder>0</sortorder>
              <color>0000EE</color>
              <yaxisside>0</yaxisside>
              <calc_fnc>2</calc_fnc>
              <type>0</type>
              <periods_cnt>5</periods_cnt>
            </graph_element>
            <graph_element item="Nginx Status:nginx.connections.writing">
              <drawtype>0</drawtype>
              <sortorder>1</sortorder>
              <color>EE0000</color>
              <yaxisside>0</yaxisside>
              <calc_fnc>2</calc_fnc>
              <type>0</type>
              <periods_cnt>5</periods_cnt>
            </graph_element>
            <graph_element item="Nginx Status:nginx.connections.waiting">
              <drawtype>0</drawtype>
              <sortorder>2</sortorder>
              <color>EEEE00</color>
              <yaxisside>0</yaxisside>
              <calc_fnc>2</calc_fnc>
              <type>0</type>
              <periods_cnt>5</periods_cnt>
            </graph_element>
            <graph_element item="Nginx Status:nginx.connections.reading">
              <drawtype>0</drawtype>
              <sortorder>3</sortorder>
              <color>00EE00</color>
              <yaxisside>0</yaxisside>
              <calc_fnc>2</calc_fnc>
              <type>0</type>
              <periods_cnt>5</periods_cnt>
            </graph_element>
          </graph_elements>
        </graph>
      </graphs>
      <macros/>
    </host>
  </hosts>
  <dependencies/>
</zabbix_export>

10. 监控图片如下





版权声明:本文为博主原创文章,未经博主允许不得转载。 举报

相关文章推荐

如何监控 Nginx?

什么是 Nginx?Nginx(”engine-x”)是一个 HTTP 和反向代理服务器,同时也是一个邮件代理服务器和通用的 TCP 代理服务器。作为一个免费开源的服务器,Nginx 具有高性能、稳定...

Nginx负载均衡+监控状态检测

Nginx负载均衡与可用性检查 在业界,一直流传这样一句话:Nginx抗并发能力强!为什么Nginx抗并发能力强?原因是使用了非阻塞、异步传输 阻塞:如apache代理tomcat时,apac...
  • ye1992
  • ye1992
  • 2016-05-11 09:08
  • 2834

我是如何成为一名python大咖的?

人生苦短,都说必须python,那么我分享下我是如何从小白成为Python资深开发者的吧。2014年我大学刚毕业..

nginx状态监控

通过查看Nginx的并发连接,我们可以更清除的知道网站的负载情况。Nginx并发查看有两种方法(之所以这么说,是因为笔者只知道两种),一种是通过web界面,一种是通过命令,web查看要比命令查看显示的...

zabbix监控nginx性能状态

来源URL: http://liqingbiao.blog.51cto.com/3044896/1894902?b4 nginx在生产环境中的应用越来越广泛,所以需要对nginx的性能状态做...

[Zabbix3.0 ]添加Nginx监控

通过Nginx的http_stub_status_module模块提供的状态信息来监控,所以在Agent端需要配置Nginx状态获取的脚本,和添加key信息等,然后在Server端配置Nginx的监控...

利用Zabbix监控Nginx

如果有数据返回,说明zabbix通信正常,如果返回ZBX_NOTSUPPORTED,说明监控项有问题。进入系统配置->主机->监控项,查看你的客户端主机的监控项是活跃还是不支持配置完agentd后必须...

mapreduce作业reduce被大量kill掉

之前有一段时间,我们的hadoop2.4集群压力非常大,导致提交的job出现大量的reduce被kill掉,相同的job运行时间比在hadoop0.20.203上面长了很多,这个问题其实是reduce...

源码安装zabbix3.0.0

CentOS6.7 zabbix3.0.0 1、基础软件包安装,采用yum安装 yum -y install wget vim tree gcc gcc-c++ autoconf httpd...

利用Zabbix监控Nginx

利用Zabbix监控Nginx 转自 http://www.linuxidc.com/Linux/2012-07/64798.htm

如果

如果,还会有那么多的如果吗?她还要有一个星期就好考试了。时间过的真快,转眼就要到考试的时候了,我一直在为她加油。我相信她一定没有问题的。楠楠加油。
返回顶部
收藏助手
不良信息举报
您举报文章:深度学习:神经网络中的前向传播和反向传播算法推导
举报原因:
原因补充:

(最多只允许输入30个字)