当前位置: 首页 > news >正文

网站的后台一般用什么做的杭州萧山网络

网站的后台一般用什么做的,杭州萧山网络,域名注册商平台,做盗版系统网站会不会介绍 Blackbox Exporter是Prometheus社区提供的官方黑盒监控解决方案#xff0c;其允许用户通过#xff1a;HTTP、HTTPS、DNS、TCP以及ICMP的方式对网络进行探测。用户可以直接使用go get命令获取Blackbox Exporter源码并生成本地可执行文件#xff1a; go get prometheus…介绍 Blackbox Exporter是Prometheus社区提供的官方黑盒监控解决方案其允许用户通过HTTP、HTTPS、DNS、TCP以及ICMP的方式对网络进行探测。用户可以直接使用go get命令获取Blackbox Exporter源码并生成本地可执行文件 go get prometheus/blackbox_exportergithub 地址: https://github.com/prometheus/blackbox_exporter 部署 1 二进制方式 1.1 下载解压 curl -o blackbox_exporter-0.24.0.linux-amd64.tar.gz https://github.com/prometheus/blackbox_exporter/releases/download/v0.24.0/blackbox_exporter-0.24.0.linux-amd64.tar.gztar -xf blackbox_exporter-0.24.0.linux-amd64.tar.gz -C /usr/local/ mv /usr/local/blackbox_exporter-0.24.0.linux-amd64 /usr/local/blackbox_exporter-0.24.01.2 配置 systemd [Unit] DescriptionThe blackbox exporter Afternetwork-online.target remote-fs.target nss-lookup.target Wantsnetwork-online.target[Service] ExecStart/usr/local/blackbox_exporter-0.24.0/blackbox_exporter --config.file/usr/local/blackbox_exporter-0.24.0/blackbox.ymlKillSignalSIGQUITRestartalwaysRestartPreventExitStatus1 6 SIGABRTTimeoutStopSec5 KillModeprocess PrivateTmptrue LimitNOFILE1048576 LimitNPROC1048576[Install] WantedBymulti-user.target 1.3 配置文件 blackbox.yml 2 容器方式 docker 镜像地址 https://hub.docker.com/r/prom/blackbox-exporter/tags docker pull prom/blackbox-exporter:v0.23.0运行Blackbox Exporter时需要用户提供探针的配置信息这些配置信息可能是一些自定义的HTTP头信息也可能是探测时需要的一些TSL配置也可能是探针本身的验证行为。在Blackbox Exporter每一个探针配置称为一个module并且以YAML配置文件的形式提供给Blackbox Exporter。 每一个module主要包含以下配置内容包括探针类型prober、验证访问超时时间timeout、以及当前探针的具体配置项 # 探针类型http、 tcp、 dns、 icmp.prober: prober_string# 超时时间[ timeout: duration ]# 探针的详细配置最多只能配置其中的一个[ http: http_probe ][ tcp: tcp_probe ][ dns: dns_probe ][ icmp: icmp_probe ]下面是一个简化的探针配置文件blockbox.yml包含两个HTTP探针配置项 modules:http_2xx:prober: httptimeout: 10shttp:method: GETpreferred_ip_protocol: ip4http_post_2xx:prober: httphttp:method: POST通过运行以下命令并指定使用的探针配置文件启动Blockbox Exporter实例 blackbox_exporter --config.file/etc/prometheus/blackbox.yml启动成功后就可以通过访问http://127.0.0.1:9115/probe?modulehttp_2xxtargetbaidu.com对baidu.com进行探测。这里通过在URL中提供module参数指定了当前使用的探针target参数指定探测目标探针的探测结果通过Metrics的形式返回 # HELP probe_dns_lookup_time_seconds Returns the time taken for probe dns lookup in seconds # TYPE probe_dns_lookup_time_seconds gauge probe_dns_lookup_time_seconds 0.011633673 # HELP probe_duration_seconds Returns how long the probe took to complete in seconds # TYPE probe_duration_seconds gauge probe_duration_seconds 0.117332275 # HELP probe_failed_due_to_regex Indicates if probe failed due to regex # TYPE probe_failed_due_to_regex gauge probe_failed_due_to_regex 0 # HELP probe_http_content_length Length of http content response # TYPE probe_http_content_length gauge probe_http_content_length 81 # HELP probe_http_duration_seconds Duration of http request by phase, summed over all redirects # TYPE probe_http_duration_seconds gauge probe_http_duration_seconds{phaseconnect} 0.055551141 probe_http_duration_seconds{phaseprocessing} 0.049736019 probe_http_duration_seconds{phaseresolve} 0.011633673 probe_http_duration_seconds{phasetls} 0 probe_http_duration_seconds{phasetransfer} 3.8919e-05 # HELP probe_http_redirects The number of redirects # TYPE probe_http_redirects gauge probe_http_redirects 0 # HELP probe_http_ssl Indicates if SSL was used for the final redirect # TYPE probe_http_ssl gauge probe_http_ssl 0 # HELP probe_http_status_code Response HTTP status code # TYPE probe_http_status_code gauge probe_http_status_code 200 # HELP probe_http_version Returns the version of HTTP of the probe response # TYPE probe_http_version gauge probe_http_version 1.1 # HELP probe_ip_protocol Specifies whether probe ip protocol is IP4 or IP6 # TYPE probe_ip_protocol gauge probe_ip_protocol 4 # HELP probe_success Displays whether or not the probe was a success # TYPE probe_success gauge probe_success 1从返回的样本中用户可以获取站点的DNS解析耗时、站点响应时间、HTTP响应状态码等等和站点访问质量相关的监控指标从而帮助管理员主动的发现故障和问题。 与Prometheus集成 接下来只需要在Prometheus下配置对Blockbox Exporter实例的采集任务即可。最直观的配置方式 - job_name: baidu_http2xx_probeparams:module:- http_2xxtarget: - baidu.commetrics_path: /probestatic_configs:- targets:- 127.0.0.1:9115 - job_name: prometheus_http2xx_probeparams:module:- http_2xxtarget:- prometheus.iometrics_path: /probestatic_configs:- targets:- 127.0.0.1:9115假如我们有N个目标站点且都需要M种探测方式那么Prometheus中将包含N * M个采集任务从配置管理的角度来说显然是不可接受的。 这里我们也可以采用Relabling的方式对这些配置进行简化配置方式如下 scrape_configs:- job_name: blackboxmetrics_path: /probeparams:module: [http_2xx]static_configs:- targets:- http://prometheus.io # Target to probe with http.- https://prometheus.io # Target to probe with https.- http://example.com:8080 # Target to probe with http on port 8080.relabel_configs:- source_labels: [__address__]target_label: __param_target- source_labels: [__param_target]target_label: instance- target_label: __address__replacement: 127.0.0.1:9115 http://127.0.0.1:9115/probe?modulehttp_2xxtargetbaidu.com 第1步根据 static_configs.targets 实例的地址写入 __param_target 标签中。__param_name 形式的标签表示采集任务时会在请求目标地址中添加name参数的值等同于params的设置第2步获取 __param_target的值并覆写到 instance 标签中第3步覆写Target实例的__address__标签值为BlockBox Exporter实例的访问地址。 blackbox.yml modules:http_2xx:prober: httphttp_post_2xx:prober: httphttp:method: POSTpreferred_ip_protocol: ip4tcp_connect:prober: tcppop3s_banner:prober: tcptcp:query_response:- expect: ^OKtls: truetls_config:insecure_skip_verify: falsegrpc:prober: grpcgrpc:tls: truepreferred_ip_protocol: ip4grpc_plain:prober: grpcgrpc:tls: falseservice: service1ssh_banner:prober: tcptcp:query_response:- expect: ^SSH-2.0-- send: SSH-2.0-blackbox-ssh-checkirc_banner:prober: tcptcp:query_response:- send: NICK prober- send: USER prober prober prober :prober- expect: PING :([^ ])send: PONG ${1}- expect: ^:[^ ] 001 icmp:prober: icmpicmp_ttl5:prober: icmptimeout: 5sicmp:ttl: 5example.yml modules:http_2xx_example:prober: httptimeout: 5shttp:valid_http_versions: [HTTP/1.1, HTTP/2.0]valid_status_codes: [] # Defaults to 2xxmethod: GETheaders:Host: vhost.example.comAccept-Language: en-USOrigin: example.comno_follow_redirects: falsefail_if_ssl: falsefail_if_not_ssl: falsefail_if_body_matches_regexp:- Could not connect to databasefail_if_body_not_matches_regexp:- Download the latest version herefail_if_header_matches: # Verifies that no cookies are set- header: Set-Cookieallow_missing: trueregexp: .*fail_if_header_not_matches:- header: Access-Control-Allow-Originregexp: (\*|example\.com)tls_config:insecure_skip_verify: falsepreferred_ip_protocol: ip4 # defaults to ip6ip_protocol_fallback: false # no fallback to ip6http_with_proxy:prober: httphttp:proxy_url: http://127.0.0.1:3128skip_resolve_phase_with_proxy: truehttp_with_proxy_and_headers:prober: httphttp:proxy_url: http://127.0.0.1:3128proxy_connect_header:Proxy-Authorization:- Bearer tokenhttp_post_2xx:prober: httptimeout: 5shttp:method: POSTheaders:Content-Type: application/jsonbody: {}http_basic_auth_example:prober: httptimeout: 5shttp:method: POSTheaders:Host: login.example.combasic_auth:username: usernamepassword: mysecrethttp_custom_ca_example:prober: httphttp:method: GETtls_config:ca_file: /certs/my_cert.crthttp_gzip:prober: httphttp:method: GETcompression: gziphttp_gzip_with_accept_encoding:prober: httphttp:method: GETcompression: gzipheaders:Accept-Encoding: gziptls_connect:prober: tcptimeout: 5stcp:tls: truetcp_connect_example:prober: tcptimeout: 5simap_starttls:prober: tcptimeout: 5stcp:query_response:- expect: OK.*STARTTLS- send: . STARTTLS- expect: OK- starttls: true- send: . capability- expect: CAPABILITY IMAP4rev1smtp_starttls:prober: tcptimeout: 5stcp:query_response:- expect: ^220 ([^ ]) ESMTP (.)$- send: EHLO prober\r- expect: ^250-STARTTLS- send: STARTTLS\r- expect: ^220- starttls: true- send: EHLO prober\r- expect: ^250-AUTH- send: QUIT\rirc_banner_example:prober: tcptimeout: 5stcp:query_response:- send: NICK prober- send: USER prober prober prober :prober- expect: PING :([^ ])send: PONG ${1}- expect: ^:[^ ] 001icmp_example:prober: icmptimeout: 5sicmp:preferred_ip_protocol: ip4source_ip_address: 127.0.0.1dns_udp_example:prober: dnstimeout: 5sdns:query_name: www.prometheus.ioquery_type: Avalid_rcodes:- NOERRORvalidate_answer_rrs:fail_if_matches_regexp:- .*127.0.0.1fail_if_all_match_regexp:- .*127.0.0.1fail_if_not_matches_regexp:- www.prometheus.io.\t300\tIN\tA\t127.0.0.1fail_if_none_matches_regexp:- 127.0.0.1validate_authority_rrs:fail_if_matches_regexp:- .*127.0.0.1validate_additional_rrs:fail_if_matches_regexp:- .*127.0.0.1dns_soa:prober: dnsdns:query_name: prometheus.ioquery_type: SOAdns_tcp_example:prober: dnsdns:transport_protocol: tcp # defaults to udppreferred_ip_protocol: ip4 # defaults to ip6query_name: www.prometheus.ioGranfana
http://www.zqtcl.cn/news/218017/

相关文章:

  • 网站开发开源程序网站建设及推广销售话术
  • 门户网站和官网的区别美间在线设计平台
  • 淮南制作网站游戏代理哪个平台正规
  • seo网站推广软件 快排手机网页小游戏
  • 上海免费网站建设品牌长沙com建站网站设计
  • 大网站成本品牌设计风格
  • 电大形考任在哪个网站做湖南seo推广服务
  • dede网站 异步生成wordpress 页面新建
  • 郑州网站制作网页网站优化我自己可以做吗
  • 合肥做网站的公司百度做兼职去哪个网站
  • 重庆市城市建设规划官方网站一款app从开发到上线的流程
  • 微网站开发难吗登录qq网页版
  • 网站不备案能解析吗网站开发项目中职责
  • 三优科技 网站开发网站开发实训报告总结
  • 离线推广网站规划书常用的网站都有哪些
  • 成都 视频网站建设网站邮件推送
  • 深圳均安网站制作温州网站优化案例
  • 做网站需要哪些流程网站建设中项目经理的职责
  • 专业低价建设微网站微商城怎么样在wordpress上添加播放视频
  • 网站制作经费预算表域名备案信息查询系统
  • 苏州网站建设找苏州聚尚网络推荐南昌个人网站制作怎么做
  • 普法网站建设wordpress伪静态404错误
  • 易语言如何做浏网站湛江高端网站开发
  • 窦各庄网站建设wordpress 意见反馈
  • 建站公司还有前途吗海拉尔做网站的公司
  • 素材网站有哪些如何做简单视频网站
  • 如何做网站公证宁波网站建设公司比较好
  • 网站建设公司行情新网站建设风格
  • 30天网站建设实录 pdf微信分销工具
  • 深圳电子商务网站 开发招标文件范本