# 安装脚本
代码语言:javascript复制#!/bin/bash
# 请将安装包node_exporter-1.0.1.linux-amd64.tar.gz放在和我同级的目录下
echo ">>>>>>>>>>>>>开始安装node_exporter<<<<<<<<<<<<<"
mkdir -p /opt/exporter
cd $(dirname $0)
tar -zxvf node_exporter-1.0.1.linux-amd64.tar.gz -C /opt/exporter/
cd /opt/exporter
mv node_exporter-1.0.1.linux-amd64 node_exporter
chmod 777 node_exporter
echo ">>>>>>>>>>>>>安装完毕开始启动<<<<<<<<<<<<<"
nohup /opt/exporter/node_exporter/node_exporter &
# 验证
代码语言:javascript复制[root@smartops50 soft]# ./node-install.sh
>>>>>>>>>>>>>开始安装node_exporter<<<<<<<<<<<<<
node_exporter-1.0.1.linux-amd64/
node_exporter-1.0.1.linux-amd64/NOTICE
node_exporter-1.0.1.linux-amd64/node_exporter
node_exporter-1.0.1.linux-amd64/LICENSE
>>>>>>>>>>>>>安装完毕开始启动<<<<<<<<<<<<<
[root@smartops50 soft]# nohup: appending output to ‘nohup.out’
[root@smartops50 soft]# ss -anplt | grep 9100
LISTEN 0 10240 :::9100 :::* users:(("node_exporter",pid=25161,fd=3))
[root@smartops50 soft]#
- 访问:http://IP:9100/metrics