xStats 通用 CSV 适配器快速入门指南
关于
本文档描述了使用 SevOne 网络管理系统(NMS)安装 xStats 通用 CSV 适配器的过程。 同样的程序应适用于以前的版本,但尚未进行测试。 本文件讨论了以下主题。
- 为通用 CSV 适配器安装 xStats 软件包
- 启动/停止每个适配器的模拟器
- 为每个适配器配置采集器
先决条件
在安装 xStats 适配器之前,您需要准备以下材料。
| 要求 | 描述 |
|---|---|
| vPAS 的快照 | 如果使用虚拟化设备,请在开始之前创建 vPAS 的快照。 如果您需要从头开始,这将非常有用。 |
| PAS 的 IP 地址或主机名 | 确保有 PAS 的 IP 地址或主机名,以便通过 SSH 连接到它。 |
| 热备用设备 (HSA) 对的 IP 地址 | 只有当您有一对 HSA 时才适用。 |
| 支持使用考绩制度 | 您需要为 SSH 会话输入支持用户名和密码。 重要: NMS 容器
要运行本指南中的命令,您必须在 NMS 容器中。 要进入 NMS 容器,请执行以下命令。
|
| SSH 客户端 | 要通过 SSH 进入 PAS,您需要使用 SSH 客户端,例如 PuTTY 。 |
| PAS 版本 | 最好了解 PAS 上安装的 SevOne NMS 版本。 |
| GenericCSVTransform-<version>.phar.spk | 适用于 xStats 通用 CSV 适配器的安装包,即 IBM -SevOne-NPM-Solution-xStats-GenericCSVTransform-v <最新可用版本>。例如 IBM-SevOne-NPM-Solution-xStats-GenericCSVTransform-v7.0.0.phar.spk : 可下载最新的. phar.spk 文件 IBM Passport Advantage ( https://www.ibm.com/software/passportadvantage/pao_download_software.html ) 通过 Passport Advantage Online 下载。 但是,如果您持有传统/灵活的 SevOne 合同,并且无法访问 IBM Passport Advantage 但持有 active 支持合同、请联系 SevOne 支持团队 以获取文件。 下载软件包后,请解压修复/升级包,获取所需文件。 |
| 键 xStats 术语 | 描述 |
|---|---|
| 收款人 | 负责从远程或国外主机收集数据文件的脚本。 |
| 文件收集器聚合器守护进程 (fcad) | 一个守护进程,负责收集数据文件并将其处理为可将数据插入 SevOne数据数据库的格式。 |
| 打包 | 安装在客户 PAS 上的组件,包含 xStats 适配器和 xStats 配置信息,包括解析器源代码和所有 对象和 指标的 设备-对象-指标设置。 |
下载通用 CSV 适配器
本节说明如何下载通用 CSV 适配器,该适配器可通过以下途径获取: - 访问 IBM Passport Advantage - 联系 Passport Advantage 在线支持团队- 或联系 SevOne 技术支持团队
- 使用 ssh 以 support 的身份登录 SevOne NMS 设备。
ssh support@<NMS appliance>重要:从 NMS 容器运行以下命令。 - 您需要安装最新的通用 CSV 适配器软件包(. phar.spk )。 下载最新版本的. phar.spk 文件 IBMPassport Advantage 通过 Passport Advantage 在线获取或直接联系 SevOne 支持团队使用 wget 将文件下载至您的 SevOne NMS 设备 /var/support 目标目录:
wget <location to download .phar.spk files from> -P /var/support例如 IBM-SevOne-NPM-Solution-xStats-GenericCSVTransform-v7.0.0.phar.spk 文件。
- 确保已成功下载. phar.spk 文件,且无任何错误。
cd /var/support ls -al
通用 CSV 适配器
使用 ssh 以 support 的身份登录 SevOne NMS 设备。
ssh support@<NMS appliance>
PHPRC=/config/php.d/php-cli.ini
HOME=/
安装通用 CSV 适配器
- 解压 CSV 软件包。
示例
cd /var/supportphp IBM-SevOne-NPM-Solution-xStats-GenericCSVTransform-v7.0.0.phar.spk#!/usr/bin/php 更新了 ADK 共享库! 软件包源移至 /opt/sevone-xstats/GenericCSVTransform 同步 ADK 共享目录。[ 确定 ] 同步适配器目录。[ 确定 ]
- 将目录更改为适配器提取文件的位置。
示例
cd /opt/sevone-xstats/GenericCSVTransform - 检查以确保可以安装分析程序源。 选项 -c 只执行检查。
示例
php bin/console.php install -c适配器版本要求与 NMS 版本兼容 可将适配器源插入数据库。 可将对象类型插入数据库。
- 安装解析器存根
示例
php bin/console.php install适配器版本要求与 NMS 版本兼容 可将适配器源插入数据库。 可将对象类型插入数据库。 适配器源已成功安装。 对象已插入数据库。
注意:要查看 console.php 脚本的可用命令,请输入以下命令。 代码块 outputclass="language-bourne">php bin/console.php - (仅供参考) - 目前, SevOne NMS 中尚未创建 CSV 适配器的 xStats 收集源。 然而,在添加/编辑源的弹出窗口中, GenericCSVTransform 源类型是可用的。 执行以下操作即可查看。
- 从您选择的网络浏览器登录 SevOne NMS。
- 转到管理工具 > 监控配置 > xStats 源管理器。 您会注意到, CSV 适配器没有 xStats 集合源。

- 单击添加来源按钮,弹出添加来源窗口。

- 单击 源类型下拉菜单,查看可用的源类型。 您应该只看到一种源类型 GenericCSVTransform.

- 单击 Cancel 关闭。
- 如果使用 跳转 框,则此步骤适用于 只是 框。 您已为本地文件系统安装了 GenericCSVTransform 源类型,该类型显示为 GenericCSVTransform 显示在上面的弹出截图中。 如果计划使用本地文件系统而不是 SFTP,则可以跳过此步骤。 不过,如果您打算使用 SFTP 源类型,也需要安装它。
输入以下命令安装 SFTP 源类型。
php /opt/sevone-xstats/GenericCSVTransform/bin/console.php install-sftp已插入解析器源代码 对象类型已插入/更新
执行该命令后,单击 " 源类型 "下拉菜单时,SFTP 源类型 GenericCSVTransform SFTP 将出现在弹出窗口中。 您可能需要点击右上角的
,才能从下拉列表中看到 GenericCSVTransform SFTP。
运行模拟器并添加源代码
对于计划用于适配器的每种源类型,都需要三个 .json 文件,其中包含以下信息。
- 源的采集器配置设置
- 源的解析器配置设置
- 源的对象类型和 指标类型信息
请参阅准备.json 配置文件了解如何准备.json 文件。
启动模拟器
php /opt/sevone-xstats/GenericCSVTransform/bin/console.php start-simulator
设置模拟器配置! 添加模拟器 cron 作业! 为 localhost 添加 ssh 密钥! 模拟器已配置并启动! 要配置新的模拟器数据源,可以使用以下命令: ----------------------------- 用于轮廓l: php bin/console.php configure --sourceName GenericCSVSimulator. 简介l --file simulator/config/simulator.collector.sample.lfs.profilel.json--parserConfigs imulator/config/output-dir-1.config.parser.json --objectIndicatorTypes simulator/config/output-dir-1.object_indicator_type_info.json ----------------------------- 对于 Profile2: php bin/console.php configure --sourceName GenericCSVSimulator Profile2 --file simulator/config/simulator.collector.sample.lfs.profile2.json --parserConfig s imulator/config/output-dir-2.config.parser.json --objectIndicatorTypes simulator/config/output-dir-2.object _indicator。 _type_info.json ----------------------------- 对于 Profile3: php bin/console.php configure --sourceName GenericCSVSimulator_Profile3 --file simulator/config/simulator.collector.sample.lfs.profile3.json --parserConfig s imulator/config/output-dir-3.config-parser.json --objectIndicatorTypes simulator/config/output-dir-3.object 指示器 type_info.json
添加来源
要添加数据源,请执行以下操作。
- 添加第一个信息源。
php /opt/sevone-xstats/GenericCSVTransform/bin/console.php \ configure --sourceName GenericCSVSimulator_Profile1 \ --file /opt/sevone-xstats/GenericCSVTransform/simulator/config/simulator.collector.sample.lfs.profile1.json \ --parserConfig /opt/sevone-xstats/GenericCSVTransform/simulator/config/output-dir-1.config.parser.json \ --objectIndicatorTypes /opt/sevone-xstats/GenericCSVTransform/simulator/config/output-dir-1.object_indicator_type_info.jsonobjectIndicatorTypes 已验证 parserConfig 是一个有效的解析器配置!!! 可以创建源名称。 配置文件似乎没问题。 可以创建 Cron 条目。 可创建日志和轮换。 将数据源添加到数据库。 数据源已插入数据库。 收集器配置保存到 /opt/sevone-xstats/GenericCSVTransform/sources/source_1/config/collector.json. 已配置收集器。 已配置日志目录和轮换。 配置成功。 objectIndicatorTypes 已安装 parserConfig 已安装
注: 命令解释:- php /opt/sevone-xstats/GenericCSVTransform/bin/console.php configure - 这是添加源代码的命令,然后再添加必要的参数。
- --sourceName GenericCSVSimulator_Profile1 - --sourceName 是第一个参数(也可以使用 -s) 指定源名称。 在本例中,源文件被命名为 GenericCSVSimulator_Profile1 。
- -file /opt/sevone-xstats/GenericCSVTransform/simulator/config/simulator.collector.sample.lfs.profile1.json - 这是第二个参数。 参数 --file(也可以使用 -f),指向用于为该源配置收集器的 .json 文件。 参数后面是文件路径和文件名:/opt/sevone-xstats/GenericCSVTransform/simulator/config/simulator.collector.sample.lfs.profile1.json 。 您必须将路径替换为包含所添加源的采集器配置的 .json 文件的路径。
- --parserConfig /opt/sevone-xstats/GenericCSVTransform/simulator/config/output-dir-1.config.parser.json - 这是第三个参数。 参数,--parserConfig,指向用于为该源码配置解析器的 .json 文件。 参数后面是文件路径和文件名:/opt/sevone-xstats/GenericCSVTransform/simulator/config/output-dir-1.config.parser.json 。 您必须将路径替换为包含所添加源的解析器配置的 .json 文件的路径。
- --objectIndicatorTypes /opt/sevone-xstats/GenericCSVTransform/simulator/config/output-dir-1.object_indicator_type_info.json - 这是第四个参数。 参数 --objectIndicatorTypes, 指向 .json 文件,该文件包含此源代码的对象类型和指示器类型信息。 参数后面是文件路径和文件名:/opt/sevone-xstats/GenericCSVTransform/simulator/config/output-dir-1.object_indicator_type_info.json 。 您必须替换包含所添加源的对象类型和指示符类型信息的 .json 文件的路径。
- 添加第二个来源。
php /opt/sevone-xstats/GenericCSVTransform/bin/console.php \ configure --sourceName GenericCSVSimulator_Profile2 \ --file /opt/sevone-xstats/GenericCSVTransform/simulator/config/simulator.collector.sample.lfs.profile2.json \ --parserConfig /opt/sevone-xstats/GenericCSVTransform/simulator/config/output-dir-2.config.parser.json \ --objectIndicatorTypes /opt/sevone-xstats/GenericCSVTransform/simulator/config/output-dir-2.object_indicator_type_info.json - 添加第三个来源。
php /opt/sevone-xstats/GenericCSVTransform/bin/console.php \ configure --sourceName GenericCSVSimulator_Profile3 \ --file /opt/sevone-xstats/GenericCSVTransform/simulator/config/simulator.collector.sample.lfs.profile3.json \ --parserConfig /opt/sevone-xstats/GenericCSVTransform/simulator/config/output-dir-3.config.parser.json \ --objectIndicatorTypes /opt/sevone-xstats/GenericCSVTransform/simulator/config/output-dir-3.object_indicator_type_info.json
返回已添加源的 SevOne NMS 设备。 从管理工具 > 监控配置 > xStats 源管理器 ,您将看到已为通过 ssh 客户端添加的每个源创建了 xStats 收集源。

查看 Cron 文件、手动运行采集器及amp; 检查数据
- 在您的SSH客户端中,输入以下命令以确认 CSV 适配器的cron文件已创建:
ls -al /etc/cron.dtotal 8 drwxr-xr-x. 2 root sevone 113 Aug 19 19:14. drwxr-xr-x. 80 root root 30 Aug 19 18:49. lrwxrwxrwx. 1 根 sevone 29 Aug 19 14:19 模式 -> /config/cron-available.d/mode lrwxrwxrwx. 1 根 sevone 35 Aug 19 14:19 sevone-nms -> /config/cron-available.d/sevone-nms -rw-r--r--. 1 root root 1045 Aug 19 19:14 xstats-GenericCSVTransform -rw-r--r--. 1 root root 436 Aug 19 19:12 xstats-GenericCSVTransformSimulator
- 要查看 cron 文件的内容,请输入以下命令。
cat /etc/cron.d/xstats-GenericCSVTransform# SevOne xstats 适配卡 crontab 文件。 # 全局变量 外壳= /bin/bash PATH= /sbin : /bin : /usr/sbin:/usr/bin:/usr/local/bin MAILTO="" 主页=/ # crontab 格式: # <分钟> <小时> <月日> <星期> <用户> <要做什么 */5 * * * 接收 php /opt/sevone-xstats/GenericCSVTransform/bin/console.php acquire-data --source 1 &>> /var/log/xstats/GenericCSVTransform/adapter.log #------------------------------------------- 0 0 * * * 接收 php /opt/sevone-xstats/GenericCSVTransform/bin/console.php 清理 --source 1 &>> /var/log/xstats/GenericCSVTransform/adapter.log #------------------------------------------- */5 * * * 接收 php /opt/sevone-xstats/GenericCSVTransform/bin/console.php acquire-data --source 2 &>> /var/log/xstats/GenericCSVTransform/adapter.log #------------------------------------------- 0 0 * * * 接收 php /opt/sevone-xstats/GenericCSVTransform/bin/console.php 清理 --source 2 &>> /var/log/xstats/GenericCSVTransform/adapter.log #------------------------------------------- */5 * * * 接收 php /opt/sevone-xstats/GenericCSVTransform/bin/console.php acquire-data --source 3 &>> /var/log/xstats/GenericCSVTransform/adapter.log #------------------------------------------- 0 0 * * * 接收 php /opt/sevone-xstats/GenericCSVTransform/bin/console.php 清理 --source 3 &>> /var/log/xstats/GenericCSVTransform/adapter.log #-------------------------------------------
每个源的 cron 作业计划每 5 分钟运行一次。 您将开始看到 /opt/sevone-xstats/GenericCSVTransform/sources/source_<id>/data/. 如果不想等待 cron 作业运行,可以通过输入以下命令手动运行每个源的收集器。
示例:来源 1php /opt/sevone-xstats/GenericCSVTransform/bin/console.php acquire-data --source 1运行以下命令检查源 1 的数据目录中是否有文件。ls -la /opt/sevone-xstats/GenericCSVTransform/sources/source_1/data/示例:来源 2php /opt/sevone-xstats/GenericCSVTransform/bin/console.php acquire-data --source 2运行以下命令检查源 2 的数据目录中是否有文件。ls -la /opt/sevone-xstats/GenericCSVTransform/sources/source_2/data/示例:来源 3php /opt/sevone-xstats/GenericCSVTransform/bin/console.php acquire-data --source 3运行以下命令检查源 3 的数据目录中是否有文件。ls -la /opt/sevone-xstats/GenericCSVTransform/sources/source_3/data/ - 使用您选择的网络浏览器登录 SevOne NMS。
- 对于添加的三个源,您将看到 Administration > Monitoring Configuration > xStats 源管理器中的设备。
- 要查看 CSV 适配器的对象,请从" 设备 "菜单中选择 "对象管理器 "。
- 在 Filter Options 弹出窗口中,单击 Plugin 下拉菜单并选择 xStats 。
- 点击 “对象类型 ”下拉菜单,选择所有 CSV 对象类型,或仅选择您要查看的特定源的对象类型。

- 点击 “应用 ”以查看 CSV 对象列表。

cat /etc/cron.d/xstats-GenericCSVTransformSimulator
# Sevone xstats 适配卡 crontab 文件。 # 全局变量 外壳= /bin/bash PATH= /sbin : /bin : /usr/sbin:/usr/bin:/usr/local/bin MAILTO="" 主页=/ # crontab 格式: # <分钟> <小时> <月日> <星期> <用户> <要做什么 */5 * * * * root php /opt/sevone-xstats/GenericCSVTransform/simulator/simulator.php >> /var/10g/xstats/GenericCSVTransform/simulator.109 2>&1 # end of simulator cron[ root@quality532blank:/ ]
停止/删除模拟器数据
rm /etc/cron.d/xstats-GenericCSVTransformSimulator
要删除每个源的.json 配置文件和数据文件,请运行以下命令。 这包括添加每个源时创建的 .json 文件。
rm -r /opt/sevone-xstats/GenericCSVTransform/sources/source_1/
rm -r /opt/sevone-xstats/GenericCSVTransform/sources/source_2/
rm -r /opt/sevone-xstats/GenericCSVTransform/sources/source_3/
输入以下命令删除模拟器数据输出文件。 这适用于为模拟器添加的所有三个信号源。
rm -r /opt/sevone-xstats/GenericCSVTransform/simulator/simulatorData/
在 SevOne NMS 中执行以下操作以删除 设备。
- 从导航栏 Administration > Monitoring Configuration > 选择 xStats Source Manager,您将看到与使用 xStats Source Manager 添加的每个源相关联的设备列表。 找到每个数据源的 xStats 采集源,然后单击 Devices 列下的链接。
- 从导航栏中,Devices > 选择 Device Manager。
- 为与要删除的信号源相关联的每个设备选择复选框。
- 在页面顶部,单击 “将选定内容移至删除队列” 以将设备移动到删除队列。

准备.json 配置文件
cd /opt/sevone-xstats/GenericCsvTransform
mkdir prepared_json_files
cd prepared_json_files
mkdir source_1
cd source_1
您现在位于 /opt/sevone-xstats/GenericCsvTransform/prepared_json_files/source_1 目录中- 准备 采集器配置文件。
- 复制 /opt/sevone-xstats/GenericCSVTransform/config/collector.sample.json 文件到目录 /opt/sevone-xstats/GenericCsvTransform/prepared_json_files/source_1.
例如,cp /opt/sevone-xstats/GenericCSVTransform/config/collector.sample.json \ /opt/sevone-xstats/GenericCsvTransform/prepared_json_files/source_1/<filename>.jsoncp /opt/sevone-xstats/GenericCSVTransform/config/collector.sample.json \ /opt/sevone-xstats/GenericCSVTransform/prepared_json_files/source_1/collector_source1.json
- 复制 /opt/sevone-xstats/GenericCSVTransform/config/collector.sample.json 文件到目录 /opt/sevone-xstats/GenericCsvTransform/prepared_json_files/source_1.
- 准备 解析器配置文件。
- 复制 /opt/sevone-xstats/GenericCSVTransform/config/parser.sample.json 文件到目录 /opt/sevone-xstats/GenericCsvTransform/prepared_json_files/source_1.
例如,cp /opt/sevone-xstats/GenericCSVTransform/config/parser.sample.json \ /opt/sevone-xstats/GenericCsvTransform/prepared_json_files/source_1/<filename>.jsoncp /opt/sevone-xstats/GenericCSVTransform/config/parser.sample.json \ /opt/sevone-xstats/GenericCSVTransform/prepared_json_files/source_1/parser_source1.json
- 复制 /opt/sevone-xstats/GenericCSVTransform/config/parser.sample.json 文件到目录 /opt/sevone-xstats/GenericCsvTransform/prepared_json_files/source_1.
- 准备对象类型和指示器类型配置文件。
- 复制 /opt/sevone-xstats/GenericCSVTransform/config/object_types.sample.json 文件到目录 /opt/sevone-xstats/GenericCsvTransform/prepared_json_files/source_1.
例如,cp /opt/sevone-xstats/GenericCSVTransform/config/object_types.sample.json \ /opt/sevone-xstats/GenericCsvTransform/prepared_json_files/source_1/<filename>.jsoncp /opt/sevone-xstats/GenericCSVTransform/config/object_types.sample.json \ /opt/sevone-xstats/GenericCSVTransform/prepared_json_files/source_1/object_types_source1.json
- 复制 /opt/sevone-xstats/GenericCSVTransform/config/object_types.sample.json 文件到目录 /opt/sevone-xstats/GenericCsvTransform/prepared_json_files/source_1.
- 准备 metadata 配置文件。
- 复制 /opt/sevone-xstats/GenericCSVTransform/config/metadata.sample.json 文件到目录 /opt/sevone-xstats/GenericCsvTransform/prepared_json_files/source_1.
例如,cp /opt/sevone-xstats/GenericCSVTransform/config/parser.sample.json \ /opt/sevone-xstats/GenericCsvTransform/prepared_json_files/source_1/<filename>.jsoncp /opt/sevone-xstats/GenericCSVTransform/config/metadata.sample.json \ /opt/sevone-xstats/GenericCSVTransform/prepared_json_files/source_1/metadata_source1.json
- 复制 /opt/sevone-xstats/GenericCSVTransform/config/metadata.sample.json 文件到目录 /opt/sevone-xstats/GenericCsvTransform/prepared_json_files/source_1.
- 收集器 - 收集器.json 文件
- 解析器 - 解析.json 文件
- 对象类型和指标类型 - 对象类型和指标类型.json 文件
- 元数据 - 元数据配置.json 文件
使用准备好的 .json 配置文件添加源代码
- 来源的名称。
- 一个 .json 文件,包含用于配置采集器的设置。
- 一个 .json 文件,包含用于配置解析器的设置。
- .json 文件,其中包含用于配置对象类型和指标类型的设置。
php /opt/sevone-xstats/GenericCSVTransform/bin/console.php configure \
--sourceName GenericCSV_Source1 \
--file /opt/sevone-xstats/GenericCSVTransform/prepared_json_files/source_1/collector_source1.json \
--parserConfig /opt/sevone-xstats/GenericCSVTransform/prepared_json_files/source_1/parser_source1.json \
--objectIndicatorTypes \
/opt/sevone-xstats/GenericCSVTransform/prepared_json_files/source_1/object_types_source1.json
objectIndicatorTypes 已验证 parserConfig 是一个有效的解析器配置!!! 可以创建源名称。 配置文件似乎没问题。 可创建用于收集的 Crontab。 可创建日志和轮换。 将数据源添加到数据库。 数据源已插入数据库。 收集器配置保存到 /opt/sevone-xstats/GenericCSVTransform/sources/source_1/config/collector.json. 已配置收集器。 已配置日志目录和轮换。 配置成功。 objectIndicatorTypes 已安装 parserConfig 已安装从 Administration > Monitoring Configuration > xStats Source Manager 中,您将看到新源已成功添加。
CSV 适配器安装指南
本节将详细介绍如何使用模拟器和不使用模拟器安装适配器。
带模拟器
若计划在生产环境中使用 CSV 适配器前运行模拟器,请遵循以下步骤。
- 将 .spk 软件包上传到 PAS。
- 从 .spk 软件包中提取文件。
- 安装适配器。
- (可选) 添加 SFTP 源类型。 这仅适用于计划使用 SFTP(而非本地文件系统)的情况。
- 启动模拟器
- 为模拟器添加源代码。
- 在 SevOne NMS 中,从 Administration > Monitoring Configuration > xStats Source Manager 确认已添加源。
- 验证适配器的 cron 文件是否已创建,并查看 cron 文件的内容。
- (可选) 为每个源手动运行收集器。 如果不想等待 cron 作业自行运行,这将非常有用。
- 在 SevOne NMS 中,从 Administration > Monitoring Configuration > xStats 源管理器,确认设备显示为您添加的源。
- 在 SevOne NMS 中,从 Devices > Object Manager 确认对象存在。
- 停止模拟器并删除模拟器数据。
- 添加一个或多个源,供生产环境使用。 您需要为添加的每个源(即收集器、分析器和对象/指示器类型)准备三个预配置 .json 文件。
- 在 SevOne NMS 中,从 Administration > Monitoring Configuration > xStats Source Manager 确认已添加源。
- 为添加的每个源配置 metadata.json 文件,并将其复制到 /sources/source_<id>/ 中。
- (可选) 手动运行源的收集器。 如果您不想等待cron任务自行运行,这将非常有用。
- 在 SevOne NMS 中,从 Administration > Monitoring Configuration > xStats 源管理器,确认设备显示为您添加的源。
- 在 SevOne NMS 中,从 Devices > Object Manager 确认对象是否存在。
无模拟器
如果您计划在 生产环境 中使用适配器,而无需先运行模拟器,请按照以下步骤操作。
- 将 .spk 软件包上传到 PAS。
- 从 .spk 软件包中提取文件。
- 安装适配器。
- (可选) 添加 SFTP 源类型。 这仅适用于计划使用 SFTP(而非本地文件系统)的情况。
- 添加一个或多个源,供生产环境使用。 您需要为添加的每个源(即收集器、分析器和对象/指示器类型)准备三个预配置 .json 文件。
- 在 SevOne NMS 中,从 Administration > Monitoring Configuration > xStats Source Manager 确认已添加源。
- 为添加的每个源配置 metadata.json 文件,并将其复制到 /sources/source_<id>/ 中。
- 验证是否已创建适配器的 cron 文件,并查看 cron 文件的内容。
- (可选) 手动运行源的收集器。 如果不想等待 cron 作业自行运行,这将非常有用。
- 在 SevOne NMS 中,从 Administration > Monitoring Configuration > xStats 源管理器,确认设备显示为您添加的源。
- 在 SevOne NMS 中,从 Devices > Object Manager 确认对象存在。
常见问题
如何停止模拟器?
使用 ssh 以 support 的身份登录 SevOne NMS 设备。
ssh support@<NMS appliance>
- 获取模拟器的进程 ID (PID)。
ps -ef | grep simulatorroot 5993 4748 0 06:29 pts/5 00:00:00 grep --color =auto simulator root 19058 1 0 Aug20? 00:00:00 SCREEN -dm php -S 0.0.0.0:8100 simulator.php root 19059 19058 0 Aug20 pts/0 00:00:43 php -S 0.0.0.0:8100 simulator.php root 24890 1 0 Aug20? 00:00:00 SCREEN -dm php -S 127.0.0.1:8081 /opt/sevone-xstats/GenericCSVTransform/simulator/simulator.php root 24891 24890 0 Aug20 pts/2 00:00:13 php -S 127.0.0.1:8081 /opt/sevone-xstats/GenericCSVTransform/simulator/simulator.php
- 选择要使用的 PID。 在上述命令的输出中,/opt/sevone-xstats/GenericCSVTransform/simulator/simulator.php 有两个列表。 您可以使用任一 PID。
- 输入以下命令停止模拟器。
kill <PID>示例杀死 PID
kill 24891 - 再次执行 grep 命令,确认模拟器已停止运行。 GenericCSVTransform simulator.php 的两个条目。
ps -ef | grep simulatorroot 5993 4748 0 06:29 pts/5 00:00:00 grep --color =auto simulator root 19058 1 0 Sep30? 00:00:00 SCREEN -dm php -S 0.0.0.0:8100 simulator.php root 19059 19058 0 Sep30 pts/0 00:00:43 php -S 0.0.0.0:8100 simulator.php
如何删除 xStats 收集源?
执行以下步骤,从 SevOne 网络管理系统中删除通用 CSV 适配器 xStats 收集源。 请确保按以下 上市 的顺序执行步骤。
- 删除通用 CSV 适配器的cron文件。
rm -r /config/cron.d/xstats-GenericCSVTransform - 删除 SevOne NMS 中的 xStats 收集源。 从导航栏,转到管理工具 > 监控配置 > xStats 源管理器。 选择要删除的源,然后单击
将其删除。
您将看到以下弹出窗口。

如果要删除多个来源,可以选择要删除的来源的复选框。 单击
并选择 " 删除所选 ",删除所有要删除的选定来源。您将看到以下弹出窗口。
请注意: 您需要为此 xStats 采集源 删除 设备。 要在删除 xStats 集合源之前查看 devices 、在 xStats 源管理器中找到 GenericCSVTransform 并单击 Devices 下的链接。 这将显示需要删除的 设备列表。 - 删除日志文件。
rm -r /config/cron.d/xstats-GenericCSVTransform - 删除 SevOne NMS 中的 对象类型。
- 从导航栏进入 Administration > Monitoring Configuration > Object Types。
- 要删除通用适配器( CSV )的对象类型 ,请将光标置于左侧面板中的通用适配器( CSV )对象类型上,然后单击
以删除它。注: 要显示与 xStats 收集源相关的所有对象类型 (和指标类型 )列表,请通过 SSH 登录 PAS 并输入以下命令。more /opt/sevone-xstats/GenericCSVTransform/config/object_types.json
- 删除 SevOne NMS 中的 devices 。 请参阅 " 如何删除通用 xStats 适配器添加的设备 " 部分。
- 从导航栏进入 Devices > Device Manager。
- 要删除通用 CSV 适配器的设备 ,请选择一个或多个设备,然后单击 “将选定项移至删除队列 ”。
- 删除 /opt/sevone-xstats/GenericCSVTransform 目录。
rm -r /opt/sevone-xstats/GenericCSVTransform/
如何删除通用 xStats 适配器添加的设备?
在 SevOne NMS 中执行以下操作以删除 设备。
- 您可以使用 xStats 源管理器查看与模拟器关联的 设备列表。 从导航栏进入 管理,选择 监控配置 > xStats 源管理器。 选择要删除设备的 xStats 源,然后单击
。 或者,单击要删除设备的 xStats 源的 Devices 下的链接。 这将显示需要删除的设备的列表。 - 您将弹出一个包含设备列表的窗口。 您可以选择要删除的设备。
. - 从导航栏进入 设备,然后选择 设备管理器。
- 选中与要删除的模拟器关联的每个设备的复选框,然后单击 “将选定内容移至删除队列”。
注意:除了停止模拟器之外,您还需要删除 /opt/sevone-xstats/GenericCSVTransform/config 中的模拟器收集器配置文件。
如何检查 xStats 适配器版本?
执行以下命令以验证通用 CSV 适配器的版本。
示例
php /opt/sevone-xstats/GenericCSVTransform/bin/console.php show-version --gitHash
版本: 8.1.0 Git 哈希 2a6fb977f4c783f5be51e3df0363426ebdca6304
如何检查采集器和解析器的状态?
您可以通过查看与之相关的心跳文件来了解收集器或分析器的状态。
- 要检查收集器状态,请输入以下命令查看收集器心跳文件。
cat /var/log/xstats/GenericCSVTransform/collector_heartbeat.csv状态、时间戳、收集器、收集源、传输时间、数据量 200,2024-08-20T14:15:15+0000,GenericCSVTransform,2::1270.0.1,1470,16440 200,2024-08-20T14:15:15+0000,GenericCSVTransform,3::1270.0.1,1847,36324 200,2024-08-20T14:15:16+0000,GenericCSVTransform,1::1270.0.1,1249,11352 200,2024-08-20T14:20:16+0000,GenericCSVTransform,1::1270.0.1,704,0 200,2024-08-20T14:20:16+0000,GenericCSVTransform,2::1270.0.1,486,0 200,2024-08-20T14:20:16+0000,GenericCSVTransform,3::1270.0.1,534,0 200,2024-08-20T14:25:14+0000,GenericCSVTransform,3::1270.0.1,1422,3026 200,2024-08-20T14:25:14+0000,GenericCSVTransform,2::1270.0.1,957,1368 200,2024-08-20T14:25:14+0000,GenericCSVTransform,1::1270.0.1,630,944 200,2024-08-20T14:30:15+0000,GenericCSVTransform,2::1270.0.1,2736,2736 200,2024-08-20T14:30:17+0000,GenericCSVTransform,1::1270.0.1,1861,1888 200,2024-08-20T14:30:19+0000,GenericCSVTransform,3::1270.0.1,982,6052 200,2024-08-20T14:35:13+0000,GenericCSVTransform,2::1270.0.1,730,0 200,2024-08-20T14:35:13+0000,GenericCSVTransform,1::1270.0.1,664,0 200,2024-08-20T14:35:13+0000,GenericCSVTransform,3::1270.0.1,599,0 200,2024-08-20T14:40:20+0000,GenericCSVTransform,2::1270.0.1,1249,1372 200,2024-08-20T14:40:20+0000,GenericCSVTransform,1::1270.0.1,1627,948 ... ...
每个适配器的采集器心跳文件提供以下信息。
- 状态 HTTP状态代码。 200 表示请求成功,而 500 表示错误。
- timestamp - 标记上次调用收集器的时间戳。
- package - 采集器名称。
- collection_source - xStats 集合源的名称。
- 转账时间 - 从 xStats 采集源 中检索文件或 物件 所需的时间。
- data_volume - 传输的数据量。
- 要检查分析程序状态,请输入以下命令查看分析程序心跳文件。
cat /var/log/xstats/GenericCSVTransform/parser_heartbeat.csv状态、时间戳、软件包、解析器、解析时间、已解析条目总数、已解析文件 200,2024-08-20T14:15:18+0000,GenericCSVTransform,GenericCSVSimulator_Profile3,14,192,Device_30__1724163187.csv 200,2024-08-20T14:15:18+0000,GenericCSVTransform,GenericCSVSimulator_Profile2,11,240,Device2_0__1724163187.csv 200,2024-08-20T14:15:18+0000,GenericCSVTransform,GenericCSVSimulator_Profile1,13,336,Device1_0__1724163187.csv 200,2024-08-20T14:15:19+0000,GenericCSVTransform,GenericCSVSimulator_Profile3,13,192,Device_31__1724163187.csv 200,2024-08-20T14:15:19+0000,GenericCSVTransform,GenericCSVSimulator_Profile1,10,336,Device1_1__1724163187.csv 200,2024-08-20T14:15:19+0000,GenericCSVTransform,GenericCSVSimulator_Profile2,11,240,Device2_1__1724163187.csv 200,2024-08-20T14:25:16+0000,GenericCSVTransform,GenericCSVSimulator_Profile3,19,16,Device_30__1724163785.csv 200,2024-08-20T14:25:16+0000,GenericCSVTransform,GenericCSVSimulator_Profile1,7,28,Device1_0__1724163785.csv 200,2024-08-20T14:25:16+0000,GenericCSVTransform,GenericCSVSimulator_Profile2,8,20,Device2_0__1724163785.csv 200,2024-08-20T14:25:17+0000,GenericCSVTransform,GenericCSVSimulator_Profile2,6,20,Device2_1__1724163785.csv 200,2024-08-20T14:25:17+0000,GenericCSVTransform,GenericCSVSimulator_Profile1,7,28,Device1_1__1724163785.csv 200,2024-08-20T14:25:17+0000,GenericCSVTransform,GenericCSVSimulator_Profile3,7,16,Device_31__1724163785.csv 200,2024-08-20T14:30:20+0000,GenericCSVTransform,GenericCSVSimulator_Profile1,5,56,Device1_0__1724164087.csv 200,2024-08-20T14:30:21+0000,GenericCSVTransform,GenericCSVSimulator_Profile2,7,40,Device2_0__1724164087.csv 200,2024-08-20T14:30:21+0000,GenericCSVTransform,GenericCSVSimulator_Profile2,10,40,Device2_1__1724164087.csv 200,2024-08-20T14:30:21+0000,GenericCSVTransform,GenericCSVSimulator_Profile3,8,32,Device_30__1724164087.csv 200,2024-08-20T14:30:22+0000,GenericCSVTransform,GenericCSVSimulator_Profile1,5,56,Device1_1__1724164087.csv 200,2024-08-20T14:30:22+0000,GenericCSVTransform,GenericCSVSimulator_Profile3,9,32,Device_31__1724164087.csv 200,2024-08-20T14:40:23+0000,GenericCSVTransform,GenericCSVSimulator_Profile2,6,20,Device2_0__1724164686.csv ... ...
每个适配器的解析器心跳文件提供以下信息
- 状态 HTTP状态代码。 200 表示请求成功,而 500 表示错误。
- timestamp - 调用解析器时的时间戳。
- package - xStats 适配器的名称。
- parser - 解析器的名称。
- parse_time - 解析所需的时间。
- total_parsed_entries - 指标值被翻译并发送摄取的次数。 这不包括忽略值和未知值。
- parsed_file - 已解析文件的名称。
如果使用跳箱怎么办?
如果使用跳线盒,则需要在跳线盒上手动安装采集器,并通过 SFTP 连接到 SevOne 设备。
如果我的群集有 HSA 对和多个对等体怎么办?
详情请参阅通用 CSV 适配器章节。
HSA 安装
请按照以下步骤在 HSA 配对上安装通用适配器。
- 将每个适配器的安装包(.phar.spk)复制到主动和被动设备上。
- 使用 ssh,以 support 的身份登录主动和被动设备。
- 在两个设备上执行以下命令。
php IBM-SevOne-NPM-Solution-xStats-GenericCSVTransform-<version>.phar.spk示例php IBM-SevOne-NPM-Solution-xStats-GenericCSVTransform-v7.0.0.phar.spk - 适配器必须仅安装在活动设备上。 如果尝试在被动设备上安装适配器,则会收到一条错误信息,说明设备未激活,因此无法继续此过程。注意: 尽管您不会在被动设备上安装适配器、xStats收集源将出现在 xStats源管理器中。(Administration > Monitoring Configuration > xStats Source Manager) 中、就像它们在主动设备上一样,这是数据库复制的结果。
- 为主动和被动设备上的每个适配器配置收集器。 此外,确保在两个设备上配置完全相同的收集器。注意: 对于通用 CSV 适配器,使用收集器是可选的。
- 对于通用 CSV 适配器,您需要配置一项服务( 如SFTP 或SCP ),将文件推送到HSA对中的活动设备。注意: IP 地址必须是 HSA 对的 IP 地址,而不是单个 PAS 的 IP 地址。
使用 HSA 对的 IP 地址将 .csv 文件从远程服务器复制到活动设备上的 /data 目录的 SCP 命令
scp /<full_path_to_Generic_CSV_files>/*.csv \ <user_name>@<IP_address_of_HSA_pair>:/opt/sevone-xstats/GenericCSVTransform/sources/source_<##>/data示例SCP 命令scp /Generic/CSV-files/*.csv \ root@192.168.136.224:/opt/sevone-xstats/GenericCSVTransform/sources/source_1/data
多对等安装
在集群中的多个对等机上安装通用适配器不需要任何特殊要求。 您将以同样的方式在每个相关对等设备上安装适配器。
适配器可识别 Peer ID,该 ID 用于命名 xStats 采集源。 例如,
- 若在ID为1的对等节点上安装通用 CSV 适配器包,则通用 CSV 适配器的 xStats 集合源将命名为 GenericCSVTransform_1。
- 若在同一集群的另一对等节点上安装通用 CSV 适配器,且该节点 ID 为5,则通用 CSV 适配器的 xStats 集合源将为 GenericCSVTransform_5。
示例:在多个对等设备上安装通用适配器
在本例中,Generic 适配器安装在集群中的两个对等设备上,每个对等设备都设置了 HSA。 执行以下步骤。
关于同行 1
对于适配器,通用 CSV ,在'活动'设备上
- 对每个适配器执行以下命令。
php IBM-SevOne-NPM-Solution-xStats-GenericCSVTransform-<version>.phar.spk - 安装每个适配器。
- 为每个适配器配置收集器。注: 通用 CSV 适配器可选配收集器。
对于适配器,通用 CSV ,在"被动"设备上
- 对每个适配器执行以下命令。
php IBM-SevOne-NPM-Solution-xStats-GenericCSVTransform-<version>.phar.spk - 为每个适配器配置收集器。注意:
- 通用 CSV 适配器可选配收集器。
- 在主动设备上配置收集器(每个适配器)所使用的规格必须与被动设备上的完全相同。
关于同行 2
对于适配器,通用 CSV ,在'活动'设备上
- 对每个适配器执行以下命令。
php IBM-SevOne-NPM-Solution-xStats-GenericCSVTransform-<version>.phar.spk - 安装每个适配器。
- 为每个适配器配置收集器。注: 通用 CSV 适配器可选配收集器。
对于适配器,通用 CSV ,在"被动"设备上
- 对每个适配器执行以下命令。
php IBM-SevOne-NPM-Solution-xStats-GenericCSVTransform-<version>.phar.spk - 为每个适配器配置收集器。注意:
- 通用 CSV 适配器可选配收集器。
- 在主动设备上配置收集器(每个适配器)所使用的规格必须与被动设备上的完全相同。
故障诊断
收藏家问题
无法连接到远程设备 - SFTP 问题
大多数采集器要求启用 SFTP。 如果您在连接到正在收集数据文件的 远程 设备时遇到问题,则可能需要在该设备上启用 SFTP。 测试方法之一是尝试使用 SFTP 连接 远程 设备。 如果您无法通过 SFTP 连接,这可能意味着 SFTP 服务器没有在 远程 设备上运行。 在这种情况下,您需要启用 SFTP 服务器。 如果采集器要求在远程设备上启用 SFTP,这很可能会解决问题。
无法连接到远程设备 - 身份验证问题
收集器需要成功验证 远程设备,然后才能收集数据文件。 如果您在验证时遇到困难,可能是以下问题之一造成的。
- 用户名/密码组合不正确。
- 远程 设备上的密码已过期。
xStats 问题
软件包无法正确安装
如果在软件包安装过程中遇到错误,请向 Expert Labs 报告。
xStats 收集源已创建,但未显示任何设备
设备只有在收集器将新文件传输到检索目录后才会显示。 例如,如果您的收集器每三十分钟运行一次,您就需要等待一段时间。 如果本地目录中已有文件,fcad可能无法立即获取它们。 在这种情况下,您可以使用 touch 命令来 trick 使 fcad 认为这些文件刚刚到达。
前往通用 CSV 适配器的/data目录 , 输入touch [文件名],然后按下回车键。 之后,请刷新 xStats 源管理器页面。 这时应该会出现一个或多个 设备。
- CSV 适配器:/opt/sevone-xstats/GenericCSVTransform/sources/source_<##>/data
即使触摸了文件,设备仍然不显示
从 xStats 源管理器,为没有显示 devices 的适配器编辑 xStats 集合源,并确保检索目录正确。 通用 xStats 适配卡的默认检索目录是:
- CSV 适配器:/opt/sevone-xstats/GenericCSVTransform/sources/source_<##>/data
如果一切正常,可能是您安装的软件包有问题。 请联系专家实验室以解决问题。
设备显示出来,但没有对象出现
对象无法显示时,通常与发现过程有关。 以下步骤将指导您完成 SevOne NMS 的发现过程。
- 转到设备 > 设备管理器。

- 选择有关设备。 做出选择后,单击
并选择 " 发现"。 然后选择 发现。 给 "发现 "号一个机会,让它顺其自然。 单击
刷新页面。 对象应开始显示。
显示设备的对象和指示器,但图表中未显示数据
这很可能是回填问题,首次运行适配器时如果有大量数据文件,就会出现这种问题。 数据应该很快就会显示出来。 在这种情况下,有时可能需要一个小时。
模拟器问题
SevOne-act check xstats-permissions
此命令将检查本地对等设备上 xStats 的各种权限问题。 如果遇到任何权限问题,请联系 IBM SevOne 支持。附錄
使用自己选择的文本编辑器,编辑每个 .json 文件,根据配置修改设置,然后保存 .json 文件。
收集器.json 文件
举例说明:收集器 .json 文件
cat /opt/sevone-xstats/GenericCSVTransform/prepared_json_files/source_1/collector_source1.json
{
"adapterName": "GenericCSVTransform",
"logFile": ""/var/log/xstats/GenericCSVTransform/collector.log"、
"heartbeatFile": ""/var/log/xstats/GenericCSVTransform/collector_heartbeat.csv"、
"lastPollRepository": "本地文件系统"、
"操作系统":"ubuntu"、
"sourceType": "真实"、
"debug": true、
"用户名":"root"、
"密码":"",
"publicKey": ""/opt/sevone-xstats/GenericCSVTransform/simulator/id_rsa.pub"、
"privateKey": "/opt/sevone-xstats/GenericCSVTransform/simulator/id_rsa",
"密码":"",
"remoteHostname": "127.0.0.1",
"remoteDir": "/opt/sevone-xstats/GenericCSVTransform/simulator/simulatorData/output-dir-1",
"端口":22,
"thresholdDays": 2,
"serviceType": "scp"、
"截止": "2015-01-01T00:00:00",
"regex":"/\\.*/",
"dateStringFormat": "Ymd"、
"dateTimezone": "协调世界时"、
"dateRegex": "",
"运行": true、
"fullScan": 真
}
| 变量 | 描述 |
|---|---|
| lastPollRepository | 请指定以下选项之一。
|
| sourceType | 请指定以下选项之一。
|
| 调试 | 设置为 true 会在日志文件中存储所有调试信息。 否则,请将此字段设置为 false。 |
| 操作系统 | 指定远程服务器的操作系统。
|
| thresholdDays | 文件可下载的最长天数。 不能下载超过该字段中指定天数的文件。 |
| 中断 | 下载文件的截止日期。 超过此日期的文件将无法下载。 请使用 yyyy-mm-ddThh:mm:ss 格式。 |
| remoteDir | 远程设备上用于收集文件的目录。 |
| remoteHostname | 远程设备的主机名或 IP 地址。 |
| serviceType | 用于从服务器下载文件的服务。 即 scp、sftp 或 ftp。 |
| 端口 | 远程 设备上要连接的端口。 |
| 用户名 | 用于验证远程 设备的用户名。 |
| 密码 | 用于验证远程 设备的密码。 |
| publicKey | 用于验证远程 设备的公钥。 如果密码字段为空,就会使用此功能。 |
| privateKey | 用于验证远程 设备的私人密钥。 如果密码字段为空,就会使用此功能。 |
| 口令 | 私人密钥的口令(如果已设置解析)。 |
| regex | 文件下载时需要匹配的正则表达式。 格式应为 /regex/。 例如,/.csv/ 指定下载 .csv 文件。 |
| 全扫描 | 请指定以下选项之一。
|
| dateStringFormat | 文件名中时间戳的格式。 |
| dataTimezone | 适用于文件名时间戳的时区。 |
| dateRegex | 文件时间戳的正则表达式。 |
| 运行 | 输入 true 可收集数据,否则输入 false 。 如果输入 false,就可以停止为源收集文件,而无需移除源配置。 将 run 设置为 false 会禁用源。 |
| (可选) adapterName | 适配器的名称。 建议使用默认设置。 请联系 Expert Labs 更改设置。 |
| (可选) logFile | 适配器日志文件的名称,包括文件的完整路径。 建议使用默认设置。 请联系 Expert Labs 更改设置。 |
| (可选) heartbeatFile | 采集器心跳文件的名称,包括文件的完整路径。 建议使用默认设置。 请联系 Expert Labs 更改设置。 |
如有需要,请使用您选择的文本编辑器编辑并保存 /opt/sevone-xstats/GenericCSVTransform/prepared_json_files/source_1/collector_source1.json 文件。
cp /opt/sevone-xstats/GenericCSVTransform/prepared_json_files/source_1/collector_source1.json /opt/sevone-xstats/GenericCSVTransform/sources/source_1/config/
解析器.json 文件
示例解析器 .json 文件
cat /opt/sevone-xstats/GeneicCSVTransform/prepared_json_files/source_1/parser_source1.json
{
"分隔符":",",
"additionalDelimiter": "",
"maxColumns": 60,
"maxCharsOnLine": 2048,
"stringEnclosure": "\"",
"typeMatchString": "%对象类型%"、
"列":{
"日期":3,
"设备名称":0,
"对象类型":2,
"对象名称":1
},
"fileNameRegex": "",
"timestampRound": 0,
"设备":{
"名称":"设备名称%"、
"类型": "GenericCSVDevice_Test"
},
"对象":{
"名称":"%对象名称%"、
"类型":"%Object Type%"、
"类": "GenericCSV_Test"
},
"时间戳":"%日期%"、
"timestampFormat": "Y-m-d H:i:s"、
"时区":"UTC"、
"timestampRound": 300,
"metadata": {
"设备":{
" attr1 ":"%0%",
" attr2 ":"%1%"
},
"对象":{
" attr3 ":"%2%",
" attr4 ":"%3%"
},
},
"rowTypes": {
"Profile1ObjectType_11": {
"指标":{
"IndicatorEpoch1": 4,
"IndicatorSecondOfMinute1": 5,
"IndicatorMinuteOfHour1": 6,
"IndicatorHourOfDay1": 7,
"IndicatorUnitA1": 8,
"IndicatorUnitB1": 9,
"IndicatorUnitC1": 10,
"IndicatorRoundedSine1": 11
}
},
"Profile1ObjectType_12": {
"指标":{
"IndicatorEpoch1": 4,
"IndicatorSecondOfMinute1": 5,
"IndicatorMinuteOfHour1": 6,
"IndicatorHourOfDay1": 7
}
}
}
}
| 变量 | 描述 |
|---|---|
| 分隔符 | 用于分隔列的分隔符。 默认值为 , 。 |
| additionalDelimiter | 附加分隔符(如果有的话)。 只支持一个附加分隔符。 |
| maxColumns | 一行中的最大列数。 列数超过指定最大值的行将不会被解析。 缺省值是 60。 |
| maxCharsOnLine | 一行中的最大字符数。 字符数超过指定最大值的行将不会被解析。 默认值为 2048 个字符。 |
| typeMatchString | 用于匹配行类型的模板。 |
| stringEnclosure | 将从列中删除的字符。 默认值为 "。 |
| fileNameRegex | 用于解析文件名的正则表达式。 如果没有 regex,就无法在模板中使用文件名。 |
| 报头 | 文件头的数量。 缺省值为 0。 如果设置为 2,文件的前两行将作为页眉读取。 标题中的数据使用 %headers[<headerIndex>][<columnIndex>] %。 |
| 列 | 可在模板中使用的带索引的列列表。 |
| devicePrefix | 与您要添加的源相关联的设备名称的前缀。 如果不在此处输入,设备名称中将不包含前缀。
|
| 时间戳记 | 时间戳的模板。 |
| timestampFormat | 时间戳的格式。 如果缺少此项,将使用 unix 时间戳格式。 |
| 时区 | 数据所在的时区。 如果没有输入,该设置将默认为 UTC。 http://php.net/manual/en/timezones.php 提供了时区列表。 |
| (可选) timestampRound | 此设置用于对齐文件中的时间戳。 当时间戳差异不大时,这种方法很有用;它允许忽略微小的差异。 不过,使用该选项可能会导致数值被覆盖。 如果需要 SevOne NMS 中的所有时间戳,请勿使用此设置。 |
| 元数据 | 这是元数据信息,包括设备和对象的属性。 通过该设置,您可以从.csv 文件中指定哪些数据要作为 SevOne NMS 元数据被注入。 此处添加的任何元数据信息都必须与元数据配置文件中添加的元数据信息相对应、 metadata.json. 请参阅元数据配置.json 文件 .
|
| rowTypes | 为要支持的每一行指定解析配置。 如果所有行的类型相同,则可以使用 * 为所有行类型设置配置。 对于每种行类型,您都可以指定以下变量。
|
如有需要,请使用您选择的文本编辑器编辑并保存 /opt/sevone-xstats/GenericCSVTransform/prepared_json_files/source_1/parser_source1.json 文件。
cp /opt/sevone-xstats/GenericCSVTransform/prepared_json_files/source_1/parser_source1.json /opt/sevone-xstats/GenericCSVTransform/sources/source_1/config/
对象类型和指标类型.json 文件
示例:对象/指标类型 .json 文件
cat /opt/sevone-xstats/GeneicCSVTransform/prepared_json_files/source_1/object_types_source1.json
{
"Profile1ObjectType_11": {
"field_identifiers"(字段标识符): "Profile1ObjectType_11",
"is_ignore"(忽略):0,
"指标":[
{
"指标": "IndicatorEpoch1",
"描述": "IndicatorEpoch1",
"类型":"GAUGE"、
"可百分比":"0",
"单位":"数字"、
"data_units"(数据单位):"数字"、
"is_default"(默认):"1",
"is_ignore"(忽略):"0",
"default_value"(默认值):"",
"index_in_file": -1
},
{
"指标": "IndicatorSecondOfMinute1",
"描述": "IndicatorSecondOfMinute1",
"类型":"GAUGE"、
"可百分比":"0",
"单位":"数字"、
"data_units"(数据单位):"数字"、
"is_default"(默认):"1",
"is_ignore"(忽略):"0",
"default_value"(默认值):"",
"index_in_file": -1
},
{
"指标": "IndicatorMinuteOfHour1",
"描述": "IndicatorMinuteOfHour1",
"类型":"GAUGE"、
"可百分比":"0",
"单位":"数字"、
"data_units"(数据单位):"数字"、
"is_default"(默认):"1",
"is_ignore"(忽略):"0",
"default_value"(默认值):"",
"index_in_file": -1
},
{
"指标": "IndicatorHourOfDay1",
"描述": "IndicatorHourOfDay1",
"类型":"GAUGE"、
"可百分比":"0",
"单位":"数字"、
"data_units"(数据单位):"数字"、
"is_default"(默认):"1",
"is_ignore"(忽略):"0",
"default_value"(默认值):"",
"index_in_file": -1
},
{
"指标": "IndicatorUnitA1",
"描述": "IndicatorUnitA1",
"类型":"GAUGE"、
"可百分比":"0",
"单位":"数字"、
"data_units"(数据单位):"数字"、
"is_default"(默认):"1",
"is_ignore"(忽略):"0",
"default_value"(默认值):"",
"index_in_file": -1
},
{
"指标": "IndicatorUnitB1",
"描述": "IndicatorUnitB1",
"类型":"GAUGE"、
"可百分比":"0",
"单位":"数字"、
"data_units"(数据单位):"数字"、
"is_default"(默认):"1",
"is_ignore"(忽略):"0",
"default_value"(默认值):"",
"index_in_file": -1
},
{
"指标": "IndicatorUnitC1",
"描述": "IndicatorUnitC1",
"类型":"GAUGE"、
"可百分比":"0",
"单位":"数字"、
"data_units"(数据单位):"数字"、
"is_default"(默认):"1",
"is_ignore"(忽略):"0",
"default_value"(默认值):"",
"index_in_file": -1
},
{
"指标": "IndicatorRoundedSine1",
"描述": "IndicatorRoundedSine1",
"类型":"GAUGE"、
"可百分比":"0",
"单位":"数字"、
"data_units"(数据单位):"数字"、
"is_default"(默认):"1",
"is_ignore"(忽略):"0",
"default_value"(默认值):"",
"index_in_file": -1
}
]
},
"Profile1ObjectType_12": {
"field_identifiers"(字段标识符): "Profile1ObjectType_12",
"is_ignore"(忽略):0,
"指标":[
{
"指标": "IndicatorEpoch1",
"描述": "IndicatorEpoch1",
"类型":"GAUGE"、
"可百分比":"0",
"单位":"数字"、
"data_units"(数据单位):"数字"、
"is_default"(默认):"1",
"is_ignore"(忽略):"0",
"default_value"(默认值):"",
"index_in_file": -1
},
{
"指标": "IndicatorSecondOfMinute1",
"描述": "IndicatorSecondOfMinute1",
"类型":"GAUGE"、
"可百分比":"0",
"单位":"数字"、
"data_units"(数据单位):"数字"、
"is_default"(默认):"1",
"is_ignore"(忽略):"0",
"default_value"(默认值):"",
"index_in_file": -1
},
{
"指标": "IndicatorMinuteOfHour1",
"描述": "IndicatorMinuteOfHour1",
"类型":"GAUGE"、
"可百分比":"0",
"单位":"数字"、
"data_units"(数据单位):"数字"、
"is_default"(默认):"1",
"is_ignore"(忽略):"0",
"default_value"(默认值):"",
"index_in_file": -1
},
{
"指标": "IndicatorHourOfDay1",
"描述": "IndicatorHourOfDay1",
"类型":"GAUGE"、
"可百分比":"0",
"单位":"数字"、
"data_units"(数据单位):"数字"、
"is_default"(默认):"1",
"is_ignore"(忽略):"0",
"default_value"(默认值):"",
"index_in_file": -1
}
]
}
}
| 变量 | 描述 |
|---|---|
| 字段指示符 | 对象类型。 |
| 是否忽略 | 在 SevOne NMS 中指定是否忽略(隐藏)对象类型的设置。 |
| 威胁 |
|
如有需要,请使用您选择的文本编辑器编辑并保存 /opt/sevone-xstats/GenericCSVTransform/prepared_json_files/source_1/object_types_source1.json 文件。
cp /opt/sevone-xstats/GenericCSVTransform/prepared_json_files/source_1/object_types_source1.json /opt/sevone-xstats/GenericCSVTransform/sources/source_1/config/
元数据配置.json 文件
cat /opt/sevone-xstats/GeneicCSVTransform/prepared_json_files/source_1/metadata_source1.json
{
"路径": "/opt/sevone-xstats/GenericCSVTransform/sources/",
"命名空间": "GenericCSVTransform",
"设备":{
"文件名": ""deviceMetadata.json"、
"前缀":"",
"attributes": {
}
},
"对象":{
"文件名": ""objectMetadata.json"、
"前缀":"",
"attributes": {
}
}
}
| 变量 | 描述 |
|---|---|
| 台设备 | 对于在解析器配置 .json 文件中添加的每个 device 属性,都需要在本节中添加相应的属性类型。 可能的属性类型包括 string, ip, integer, mac、dateTime, regex, url, latLong.
|
| 对象 | 对于在解析器配置 .json 文件中添加的每个 对象属性,都需要在本节中添加相应的属性类型。 可能的属性类型包括 string, ip, integer, mac、dateTime, regex, url, latLong.
|
- 路径
- 名称空间
- 文件名
如有需要,请使用您选择的文本编辑器编辑并保存 /opt/sevone-xstats/GenericCSVTransform/prepared_json_files/source_1/metadata_source1.json 文件。
cp /opt/sevone-xstats/GenericCSVTransform/prepared_json_files/source_1/metadata_source1.json /opt/sevone-xstats/GenericCSVTransform/sources/source_1/config/