系统相关
首页 > 系统相关> > 5. Centos7 下部署使用 nmon2influxdb

5. Centos7 下部署使用 nmon2influxdb

作者:互联网

This application take a nmon file and upload it in a InfluxDB database. It generates also a dashboard to allow data visualization in Grafana. It's working on linux only for now.

相关地址

Github地址:https://github.com/adejoux/nmon2influxdb入门文档地址:http://nmon2influxdb.org/

rpm方式安装相关组件

InfluxDB 1.7.6 installation:

wget https://dl.influxdata.com/influxdb/releases/influxdb-1.7.6.x86_64.rpm
sudo yum localinstall influxdb-1.7.6.x86_64.rpm -y

Grafana 5.4.2 installation:

wget https://dl.grafana.com/oss/release/grafana-5.4.2-1.x86_64.rpm
sudo yum localinstall grafana-5.4.2-1.x86_64.rpm -y

nmon2influxdb installation:

wget https://github.com/adejoux/nmon2influxdb/releases/download/v2.1.6/nmon2influxdb_2.1.6_linux_64-bit.tar.gz
tar -zxvf nmon2influxdb_2.1.6_linux_64-bit.tar.gz
./nmon2influxdb -h

使用示例

启动 influxdb 服务:

# start influxdb
service influxdb start
service influxdb status

进入influxdb的CLI界面:

[root@centos7 ~]# influx
Connected to http://localhost:8086 version 1.7.6
InfluxDB shell version: 1.7.6
Enter an InfluxQL query
>

InfluxDB administration interface will be available at : http://localhost:8086

启动 Grafana 服务:

# start grafana
service grafana-server start
service grafana-server status

Grafana will be available at url : http://localhost:3000

watermark,size_16,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_90,type_ZmFuZ3poZW5naGVpdGk=

默认的用户名和密码 admin/admin

导入nmon的文件数据至influxdb

Loading a nmon file:nmon2influxdb import server.nmon

[root@centos7 install_nmon2influxdb]# ./nmon2influxdb import linux_150818_1024.nmon
2019/05/20 14:48:57 Using configuration file /root/.nmon2influxdb.cfg
2019/05/20 14:48:57 Creating InfluxDB database nmon_reports
2019/05/20 14:48:57 NMON file separator: ,
#
File linux_150818_1024.nmon imported : 8695 points !

在influxdb查询已导入的nmon数据

[root@centos7 ~]# influx
Connected to http://localhost:8086 version 1.7.6
InfluxDB shell version: 1.7.6
Enter an InfluxQL query
# 查看有哪些数据库
> show databases
name: databases
name
----
_internal
nmon_reports
nmon2influxdb_log
# 使用nmon_reports数据库 以及 查询表
> use nmon_reports
Using database nmon_reports

> show measurements
name: measurements
name
----
CPU_ALL
DGBUSY
DGREAD
DGSIZE
DGWRITE
DGXFER
DISKBSIZE
DISKBUSY
DISKREAD
DISKWRITE
DISKXFER
JFSFILE
MEM
NET
PROC
VM

> select * from CPU_ALL
name: CPU_ALL
time host name value
---- ---- ---- -----
1439886266000000000 linux CPUs 4
1439886266000000000 linux Idle% 79.6
1439886266000000000 linux Steal% 0
1439886266000000000 linux Sys% 5.5
1439886266000000000 linux User% 14.5
1439886266000000000 linux Wait% 0.4
1439886296000000000 linux CPUs 4
1439886296000000000 linux Idle% 69.6
1439886296000000000 linux Steal% 0
1439886296000000000 linux Sys% 4
1439886296000000000 linux User% 19.2

在Grafanafa创建面板

Creating a dashboard:nmon2influxdb dashboard server.nmon

[root@centos7 install_nmon2influxdb]# ./nmon2influxdb dashboard linux_150818_1024.nmon
2019/05/20 14:56:43 Using configuration file /root/.nmon2influxdb.cfg
2019/05/20 14:56:43 Grafana nmon2influxdb DataSource created.
2019/05/20 14:56:43 Dashboard uploaded to grafana
[root@centos7 install_nmon2influxdb]#

创建会直接在Grafana做好面板,跳过了前面修改密码等步骤,访问如下:

watermark,size_16,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_90,type_ZmFuZ3poZW5naGVpdGk=watermark,size_16,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_90,type_ZmFuZ3poZW5naGVpdGk=watermark,size_16,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_90,type_ZmFuZ3poZW5naGVpdGk=

配置好数据源之后,查看已经配置好的图表:

watermark,size_16,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_90,type_ZmFuZ3poZW5naGVpdGk=

简单的示例nmon报告下载

Sample nmon reports are available here.

 

标签:nmon2influxdb,1.7,nmon,部署,influxdb,Centos7,linux,root
来源: https://blog.51cto.com/u_11239407/2921571