[英]Nagios Core Influxdb not showing nagios data
我已遵循本指南:
已經在服務器(Debian 9)上運行 pnp4nagios。 但我無法再進一步,忙了幾個星期試圖解決這個問題。
我被困在這一點上:
驗證 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 數據源,但是當我嘗試 select 從字段“FROM”時,我不能 select 任何數據。
它只顯示:
所以我很好奇我做錯了什么,通常 Nagios 支持的文檔效果很好。
非常感謝您閱讀我的問題:)。
由於您已經安裝了 PNP4Nagios, 因此 https://support.nagios.com/kb/article/nagios-core-using-grafana-with-pnp4nagios-803.html將是更適合您的解決方案。
/usr/local/nagios/etc/nagios.cfg 當您嘗試填充 influxdb(使用 nagflux)而不是使用帶有 PNP4Nagios 的 Grafana 時,有不同的 host_perfdata_file_processing_command。
您不需要另一台服務器。 我有 Nagios Core、InfluxDB、Nagflux、Histou 和 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
的格式。
然后在 commands.cfg 中定義process-host-perfdata-file-nagflux
& process-service-perfdata-file-nagflux
commands.cfg
。
如果您確實按照上面描述的方式進行操作,那么幾分鍾后您應該會看到 nagflux 數據庫中的更改。 安裝 influxdb-client,然后:
influx
use nagflux
SELECT * FROM METRICS
您應該看到您的數據庫正在加載:)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.