smartctl

作者: flycloud_hz | 来源:发表于2023-05-17 16:44 被阅读0次

    磁盘监控smartctl

    # https://github.com/AnalogJ/scrutiny`
    cd docker
    docker-compose -f example.omnibus.docker-compose.yml up -d  
    docker-compose -f example.omnibus.docker-compose.yml down
    # http://localhost:8080/web/dashboard
    

    查看错误

    smartctl -l error /dev/sda
    

    查看信息

    smartctl -a /dev/sda
    

    id

    id为5和197有错误时建议更换磁盘

    5 Reallocated_Sector_Ct
    197 Current_Pending_Sector
    

    保存信息

    # !/bin/bash
    
    for i in sd{a..l}
    do
        echo "==========DISK HEALTH $i ==========="
        smartctl -a /dev/$i
    done
    

    docker compose file

    version: '3'
    
    services:
      node_exporter:
        image: quay.io/prometheus/node-exporter:latest
        container_name: node_exporter
        command:
          - '--path.rootfs=/host'
          - '--web.listen-address=:9902'
          - '--collector.disable-defaults'
          - '--collector.textfile'
          - '--collector.textfile.directory=/var/lib/node_exporter'
        network_mode: host
        pid: host
        restart: unless-stopped
        volumes:
          - '/:/host:ro,rslave'
          - '/var/lib/node_exporter:/var/lib/node_exporter'
    

    相关文章

      网友评论

          本文标题:smartctl

          本文链接:https://www.haomeiwen.com/subject/urvisdtx.html