Update Monitoring_Tools.sh

This commit is contained in:
Lsmoisu 2025-04-24 18:09:37 +08:00 committed by GitHub
parent 46367d1142
commit e466894772
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -634,15 +634,65 @@ if [ "$INSTALL_BLACKBOX" == "y" ]; then
modules: modules:
http_2xx: http_2xx:
prober: http prober: http
timeout: 5s
http: http:
valid_status_codes: [200, 201, 202, 203, 204] preferred_ip_protocol: "ip4"
method: GET http_post_2xx:
prober: http
http:
method: POST
tcp_connect:
prober: tcp
pop3s_banner:
prober: tcp
tcp:
query_response:
- expect: "^+OK"
tls: true
tls_config:
insecure_skip_verify: false
grpc:
prober: grpc
grpc:
tls: true
preferred_ip_protocol: "ip4"
grpc_plain:
prober: grpc
grpc:
tls: false
service: "service1"
ssh_banner:
prober: tcp
tcp:
query_response:
- expect: "^SSH-2.0-"
- send: "SSH-2.0-blackbox-ssh-check"
ssh_banner_extract:
prober: tcp
timeout: 5s
tcp:
query_response:
- expect: "^SSH-2.0-([^ -]+)(?: (.*))?$"
labels:
- name: ssh_version
value: "${1}"
- name: ssh_comments
value: "${2}"
irc_banner:
prober: tcp
tcp:
query_response:
- send: "NICK prober"
- send: "USER prober prober prober :prober"
- expect: "PING :([^ ]+)"
send: "PONG ${1}"
- expect: "^:[^ ]+ 001"
icmp: icmp:
prober: icmp prober: icmp
icmp_ttl5:
prober: icmp
timeout: 5s timeout: 5s
icmp: icmp:
preferred_ip_protocol: ip4 ttl: 5
EOF EOF
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo -e "${RED}错误:创建 Blackbox Exporter 配置文件失败!${NC}" echo -e "${RED}错误:创建 Blackbox Exporter 配置文件失败!${NC}"