zoukankan      html  css  js  c++  java
  • prometheus node_exporter部署

    curl url | sh 方式:

    install.sh

    #!/bin/bash
    
    #-------------------VAR------------------------------------------------
    ABS_INSTALL_PATH=/usr/local/bin/
    ABS_INSTALL_PREFIX=/usr/local/bin/node_exporter
    
    #-------------------FUN------------------------------------------------
    install_package(){
            if [ -e ${ABS_INSTALL_PREFIX} ];then
                    echo "====================WARNING====================="
                    echo "you may have installed node_exporter "
    
            else
                    yum install wget -y
                    cd ${ABS_INSTALL_PATH}
                    wget http://10.0.0.80/envs/yum/prometheus_node_exporter/node_exporter
    
    
                    if [ -e node_exporter ];then
                      chmod +x node_exporter
                      groupadd -r prometheus
                      useradd -r -g prometheus -s /sbin/nologin -M -c "prometheus Daemons" prometheus
    
                      cd /usr/lib/systemd/system
                      wget http://10.0.0.80/envs/yum/prometheus_node_exporter/node_exporter.service
                      systemctl start node_exporter
                      systemctl enable node_exporter
    
                    else
                      echo "=node_exporter file not exist"
                    fi
            fi
    }
    main(){
            install_package
    }
    #-------------------PROGRAM--------------------------------------------
    main
    

      

    node_exporter.service

    [Service]
    User=prometheus
    Group=prometheus
    ExecStart=/usr/local/bin/node_exporter
    
    [Install]
    WantedBy=multi-user.target
    
    [Unit]
    Description=node_exporter
    After=network.target
    

      

    手动起:

    nohup /usr/local/bin/node_exporter --web.listen-address=":9101" &

  • 相关阅读:
    python通过scapy编写arp扫描器
    red hat重置密码
    浅谈跨域劫持
    python中的socket
    利用Python进行端口扫描
    自己搜罗了一些感觉蛮有意思的爬虫相关的网站
    与py2neo的第一次接触
    基本上所有的库的列表都在这里了,传送门~~~
    关于neo4j初入门(5)
    关于neo4j初入门(4)
  • 原文地址:https://www.cnblogs.com/jabbok/p/12850115.html
Copyright © 2011-2022 走看看