2-2 监控IIS
最后更新于:2022-04-02 07:40:44
#### 监控IIS
将项目附件-->配置文件中的zbx_IIS_templates.xml导入到模板列表中
将模板添加到被监控主机
#### 模板代码
```xml
3.0
2017-02-27T09:26:57Z
Templates
Template Server IIS
Template Server IIS
Templates
IIS
-
Bytes Received/sec
0
0
perf_counter["\Web Service(_Total)\Bytes Received/sec",30]
30
90
365
0
0
0
0
0
0
1
50/1-7,00:00-24:00
0
0
0
IIS
-
Bytes Sent/sec
0
0
perf_counter["\Web Service(_Total)\Bytes Sent/sec",30]
30
90
365
0
0
0
0
0
0
1
50/1-7,00:00-24:00
0
0
0
IIS
-
Bytes Total/sec
0
0
perf_counter["\Web Service(_Total)\Bytes Total/sec",30]
30
90
365
0
0
0
0
0
0
1
50/1-7,00:00-24:00
0
0
0
IIS
-
Current Connections
0
0
perf_counter["\Web Service(_Total)\Current Connections",1]
30
90
365
0
3
0
0
0
0
1
50/1-7,00:00-24:00
0
0
0
IIS
-
Maximum Connections
0
0
perf_counter["\Web Service(_Total)\Maximum Connections",1]
30
90
365
0
3
0
0
0
0
1
50/1-7,00:00-24:00
0
0
0
IIS
```
### 什么原理呢?就是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同理
';