Nagios Core Influxdb未显示Nagios数据



我遵循了以下指南:

https://support.nagios.com/kb/article/nagios-core-performance-graphs-using-influxdb-nagflux-grafana-histou-802.html#Nagflux_Config

已经有pnp4nagios在服务器上运行(Debian 9)。但我再也不能继续了,忙了好几个星期才设法解决这个问题。

我陷入了这一点:

验证Nagflux是否工作

执行以下查询以验证InfluxDB是否已填充Nagios性能数据:

curl -G "http://localhost:8086/query?db=nagflux&pretty=true" --data-urlencode "q=show series"

当我执行该命令时,我得到的是:

{
"results": [
{}
]
}

已经在另一个发行版(CentOS 8)上完成了这项操作,仍然没有结果。

但是当我执行这个命令时(在文档的前面)

curl -G "http://localhost:8086/query?pretty=true" --data-urlencode "q=show databases"

这项工作:


{
"results": [
{
"series": [
{
"name": "databases",
"columns": [
"name"
],
"values": [
[
"_internal"
],
[
"nagflux"
]
]
}
]
}
]
}

我可以在Grafana中成功添加InfluxDB数据源,但当我尝试时,我无法选择任何数据,因此从字段"中选择它;FROM";。

它只显示:

  • 默认
  • Autogen

所以我很好奇我做错了什么,通常Nagios支持的文档工作得很好。

非常感谢您阅读我的文章:)。

由于您已经安装了PNP4Nagios,https://support.nagios.com/kb/article/nagios-core-using-grafana-with-pnp4nagios-803.html会是更适合你的解决方案。

/当您尝试填充influxdb(使用nagflux)而不是将Grafana与PNP4Nagios一起使用时,/usr/local/nagios/etc/nagios.cfg具有不同的host_perfdata_file_processing_command。

您不需要其他服务器。我让Nagios Core、InfluxDB、Nagflux、Histu和Grafana在同一台机器上工作。你不必取消PNP4Nagios,只需停止&在启动时禁用服务:systemctl stop npcd.service && systemctl disable npcd.service

之后,您必须根据以下内容编辑nagios.cfg:https://support.nagios.com/kb/article/nagios-core-performance-graphs-using-influxdb-nagflux-grafana-histou-802.html#Nagios_Command_Config以改变host_perfdata_file_processing_command value和改变*_perfdata_file_template的格式。

然后定义process-host-perfdata-file-nagflux&CCD_ 7中的CCD_ 6命令。

如果您像上面描述的那样,那么一分钟后您应该会看到nagflux数据库中的更改。安装influxdb客户端,然后:

influx
use nagflux
SELECT * FROM METRICS

你应该看到你的数据库加载:)

最新更新