🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
#### 监控IIS 将项目附件-->配置文件中的zbx_IIS_templates.xml导入到模板列表中 将模板添加到被监控主机 #### 模板代码 ```xml <?xml version="1.0" encoding="UTF-8"?> <zabbix_export> <version>3.0</version> <date>2017-02-27T09:26:57Z</date> <groups> <group> <name>Templates</name> </group> </groups> <templates> <template> <template>Template Server IIS</template> <name>Template Server IIS</name> <description/> <groups> <group> <name>Templates</name> </group> </groups> <applications> <application> <name>IIS</name> </application> </applications> <items> <item> <name>Bytes Received/sec</name> <type>0</type> <snmp_community/> <multiplier>0</multiplier> <snmp_oid/> <key>perf_counter[&quot;\Web Service(_Total)\Bytes Received/sec&quot;,30]</key> <delay>30</delay> <history>90</history> <trends>365</trends> <status>0</status> <value_type>0</value_type> <allowed_hosts/> <units/> <delta>0</delta> <snmpv3_contextname/> <snmpv3_securityname/> <snmpv3_securitylevel>0</snmpv3_securitylevel> <snmpv3_authprotocol>0</snmpv3_authprotocol> <snmpv3_authpassphrase/> <snmpv3_privprotocol>0</snmpv3_privprotocol> <snmpv3_privpassphrase/> <formula>1</formula> <delay_flex>50/1-7,00:00-24:00</delay_flex> <params/> <ipmi_sensor/> <data_type>0</data_type> <authtype>0</authtype> <username/> <password/> <publickey/> <privatekey/> <port/> <description/> <inventory_link>0</inventory_link> <applications> <application> <name>IIS</name> </application> </applications> <valuemap/> <logtimefmt/> </item> <item> <name>Bytes Sent/sec</name> <type>0</type> <snmp_community/> <multiplier>0</multiplier> <snmp_oid/> <key>perf_counter[&quot;\Web Service(_Total)\Bytes Sent/sec&quot;,30]</key> <delay>30</delay> <history>90</history> <trends>365</trends> <status>0</status> <value_type>0</value_type> <allowed_hosts/> <units/> <delta>0</delta> <snmpv3_contextname/> <snmpv3_securityname/> <snmpv3_securitylevel>0</snmpv3_securitylevel> <snmpv3_authprotocol>0</snmpv3_authprotocol> <snmpv3_authpassphrase/> <snmpv3_privprotocol>0</snmpv3_privprotocol> <snmpv3_privpassphrase/> <formula>1</formula> <delay_flex>50/1-7,00:00-24:00</delay_flex> <params/> <ipmi_sensor/> <data_type>0</data_type> <authtype>0</authtype> <username/> <password/> <publickey/> <privatekey/> <port/> <description/> <inventory_link>0</inventory_link> <applications> <application> <name>IIS</name> </application> </applications> <valuemap/> <logtimefmt/> </item> <item> <name>Bytes Total/sec</name> <type>0</type> <snmp_community/> <multiplier>0</multiplier> <snmp_oid/> <key>perf_counter[&quot;\Web Service(_Total)\Bytes Total/sec&quot;,30]</key> <delay>30</delay> <history>90</history> <trends>365</trends> <status>0</status> <value_type>0</value_type> <allowed_hosts/> <units/> <delta>0</delta> <snmpv3_contextname/> <snmpv3_securityname/> <snmpv3_securitylevel>0</snmpv3_securitylevel> <snmpv3_authprotocol>0</snmpv3_authprotocol> <snmpv3_authpassphrase/> <snmpv3_privprotocol>0</snmpv3_privprotocol> <snmpv3_privpassphrase/> <formula>1</formula> <delay_flex>50/1-7,00:00-24:00</delay_flex> <params/> <ipmi_sensor/> <data_type>0</data_type> <authtype>0</authtype> <username/> <password/> <publickey/> <privatekey/> <port/> <description/> <inventory_link>0</inventory_link> <applications> <application> <name>IIS</name> </application> </applications> <valuemap/> <logtimefmt/> </item> <item> <name>Current Connections</name> <type>0</type> <snmp_community/> <multiplier>0</multiplier> <snmp_oid/> <key>perf_counter[&quot;\Web Service(_Total)\Current Connections&quot;,1]</key> <delay>30</delay> <history>90</history> <trends>365</trends> <status>0</status> <value_type>3</value_type> <allowed_hosts/> <units/> <delta>0</delta> <snmpv3_contextname/> <snmpv3_securityname/> <snmpv3_securitylevel>0</snmpv3_securitylevel> <snmpv3_authprotocol>0</snmpv3_authprotocol> <snmpv3_authpassphrase/> <snmpv3_privprotocol>0</snmpv3_privprotocol> <snmpv3_privpassphrase/> <formula>1</formula> <delay_flex>50/1-7,00:00-24:00</delay_flex> <params/> <ipmi_sensor/> <data_type>0</data_type> <authtype>0</authtype> <username/> <password/> <publickey/> <privatekey/> <port/> <description/> <inventory_link>0</inventory_link> <applications> <application> <name>IIS</name> </application> </applications> <valuemap/> <logtimefmt/> </item> <item> <name>Maximum Connections</name> <type>0</type> <snmp_community/> <multiplier>0</multiplier> <snmp_oid/> <key>perf_counter[&quot;\Web Service(_Total)\Maximum Connections&quot;,1]</key> <delay>30</delay> <history>90</history> <trends>365</trends> <status>0</status> <value_type>3</value_type> <allowed_hosts/> <units/> <delta>0</delta> <snmpv3_contextname/> <snmpv3_securityname/> <snmpv3_securitylevel>0</snmpv3_securitylevel> <snmpv3_authprotocol>0</snmpv3_authprotocol> <snmpv3_authpassphrase/> <snmpv3_privprotocol>0</snmpv3_privprotocol> <snmpv3_privpassphrase/> <formula>1</formula> <delay_flex>50/1-7,00:00-24:00</delay_flex> <params/> <ipmi_sensor/> <data_type>0</data_type> <authtype>0</authtype> <username/> <password/> <publickey/> <privatekey/> <port/> <description/> <inventory_link>0</inventory_link> <applications> <application> <name>IIS</name> </application> </applications> <valuemap/> <logtimefmt/> </item> </items> <discovery_rules/> <macros/> <templates/> <screens/> </template> </templates> </zabbix_export> ``` ### 什么原理呢?就是Windows自带的typeperf(perfcount) 首先在win主机的DOS界面输入 ```shell typeperf -qx > C:\typeperf.txt ``` 利用typeperf -qx命令导出win上自带的IIS性能计数器名称,并指定导出路径C盘 #### 导出来的东西就是(部分) ```shell \Web Service(_Total)\Total Bytes Sent \Web Service(_Total)\Bytes Sent/sec \Web Service(_Total)\Bytes Received/sec \Web Service(_Total)\Current Connections \Web Service(_Total)\Maximum Connections ``` Zabbix中已经自带了perf_counter函数,直接添加即可 #### 具体看模板: ```shell perf_counter["\Web Service(_Total)\Bytes Received/sec",30] perf_counter["\Web Service(_Total)\Current Connections",1] ``` 最后的30是计算30秒内的平均值,记得选择浮点数 连接数设置1秒,避免浮点 具体还想要展示什么参数,自己添加模板就可以了,SQL Server同理