Zabbix Web监控

测试对微软的Bing网站进行web监控

在新添加的主机上,配置创建Web scenarios

基本设置

  • Name
  • Update interval #检测时间间隔
  • Attempts #检测次数
  • Agent #检测代理,即使用什么浏览器访问web的url

在这里插入图片描述

设置检测对象

Steps

  • Name
  • URL
  • Timeout
  • Reuired string
  • Required status codes

在这里插入图片描述

监测获取的图形,包括Speed和Respons time

在这里插入图片描述

可以在zabbix的Dashboard上分别添加web监控的图形

  • Download Speed
  • Failed
  • Code
  • Response Time

在这里插入图片描述

status codes 可用过curl获取,可正常访问后返回的code200


 curl -o /dev/null -s -w %{http_code} www.baidu.com      
200

参数说明

   -I 仅测试HTTP头
    -m 10 最多查询10s
    -o /dev/null 屏蔽原有输出信息
    -s silent 模式,不输出任何东西
    -w %{http_code} 控制额外输出

-w 参数相关详解


 -w, --write-out <format>
              Make curl display information on stdout after a completed transfer. The format is a string that may contain plain text mixed with any number of variables. The format can be specified as a literal "string", or you can have curl read the
              format from a file with "@filename" and to tell curl to read the format from stdin you write "@-".

              The  variables  present in the output format will be substituted by the value or text that curl thinks fit, as described below. All variables are specified as %{variable_name} and to output a normal % you just write them as %%. You can
              output a newline by using \n, a carriage return with \r and a tab space with \t.

              NOTE: The %-symbol is a special symbol in the win32-environment, where all occurrences of % must be doubled when using this option.

              The variables available are:

              content_type   The Content-Type of the requested document, if there was any.

              filename_effective
                             The ultimate filename that curl writes out to. This is only meaningful if curl is told to write to a file with the -O, --remote-name or -o, --output option. It's most useful in combination with the  -J,  --remote-header-
                             name option. (Added in 7.26.0)

              ftp_entry_path The initial path curl ended up in when logging on to the remote FTP server. (Added in 7.15.4)

              http_code      The numerical response code that was found in the last retrieved HTTP(S) or FTP(s) transfer. In 7.18.2 the alias response_code was added to show the same info.

              http_connect   The numerical code that was found in the last response (from a proxy) to a curl CONNECT request. (Added in 7.12.4)

              http_version   The http version that was effectively used. (Added in 7.50.0)

              local_ip       The IP address of the local end of the most recently done connection - can be either IPv4 or IPv6 (Added in 7.29.0)

              local_port     The local port number of the most recently done connection (Added in 7.29.0)

              num_connects   Number of new connects made in the recent transfer. (Added in 7.12.3)

              num_redirects  Number of redirects that were followed in the request. (Added in 7.12.3)

              proxy_ssl_verify_result
                             The result of the HTTPS proxy's SSL peer certificate verification that was requested. 0 means the verification was successful. (Added in 7.52.0)

              redirect_url   When an HTTP request was made without -L, --location to follow redirects (or when --max-redir is met), this variable will show the actual URL a redirect would have gone to. (Added in 7.18.2)

              remote_ip      The remote IP address of the most recently done connection - can be either IPv4 or IPv6 (Added in 7.29.0)

              remote_port    The remote port number of the most recently done connection (Added in 7.29.0)

              scheme         The URL scheme (sometimes called protocol) that was effectively used (Added in 7.52.0)

              size_download  The total amount of bytes that were downloaded.

              size_header    The total amount of bytes of the downloaded headers.

              size_request   The total amount of bytes that were sent in the HTTP request.

              size_upload    The total amount of bytes that were uploaded.

              speed_download The average download speed that curl measured for the complete download. Bytes per second.

              speed_upload   The average upload speed that curl measured for the complete upload. Bytes per second.

              ssl_verify_result
                             The result of the SSL peer certificate verification that was requested. 0 means the verification was successful. (Added in 7.19.0)

              time_appconnect
                             The time, in seconds, it took from the start until the SSL/SSH/etc connect/handshake to the remote host was completed. (Added in 7.19.0)

              time_connect   The time, in seconds, it took from the start until the TCP connect to the remote host (or proxy) was completed.

              time_namelookup
                             The time, in seconds, it took from the start until the name resolving was completed.

              time_pretransfer
                             The time, in seconds, it took from the start until the file transfer was just about to begin. This includes all pre-transfer commands and negotiations that are specific to the particular protocol(s) involved.

              time_redirect  The  time,  in  seconds,  it  took for all redirection steps including name lookup, connect, pretransfer and transfer before the final transaction was started. time_redirect shows the complete execution time for multiple
                             redirections. (Added in 7.12.3)

              time_starttransfer
                             The time, in seconds, it took from the start until the first byte was just about to be transferred. This includes time_pretransfer and also the time the server needed to calculate the result.

              time_total     The total time, in seconds, that the full operation lasted.

              url_effective  The URL that was fetched last. This is most meaningful if you've told curl to follow location: headers.

              If this option is used several times, the last one will be used.

       --xattr
              When saving output to a file, this option tells curl to store certain file metadata in extended file attributes. Currently, the URL is stored in the xdg.origin.url attribute and, for HTTP, the content type is stored  in  the  mime_type
              attribute. If the file system does not support extended attributes, a warning is issued.



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值