I am trying to add some hosts (UPSs) for monitoring battery charge, invertor status, input voltage, etc. I've been trying to get this working for hours. So, the Nagios scripts seem to work ok and at least some data is logged in influxdb. However, when trying to view the data from the Data Explorer on influx web page, it doesn't appear to keep the details of the individual hosts. I have also separate configs same as below but with just one host in each config file, but it does not appear to make a difference. All config files are storing data in the same bucket. Took a screenshot of the query and the returned data as I could not copy/paste and still be legible.
This is my config:
[[inputs.exec]]
timeout = "5s"
commands = [
"/usr/local/nagios/libexec/custom-plugins/check_ups_temperature -H 192.168.x.x -o 1.3.6.1.2.1.33.1.2.7.0 -v1 -C public -w 28 -c 31",
"/usr/local/nagios/libexec/custom-plugins/check_ups_temperature -H 192.168.x.x -o 1.3.6.1.2.1.33.1.2.7.0 -v1 -C public -w 28 -c 31",
"/usr/local/nagios/libexec/custom-plugins/check_ups_temperature -H 192.168.x.x -o 1.3.6.1.2.1.33.1.2.7.0 -v1 -C public -w 28 -c 31",
"/usr/local/nagios/libexec/custom-plugins/check_ups_temperature -H 192.168.x.x -o 1.3.6.1.2.1.33.1.2.7.0 -v1 -C public -w 28 -c 31"
]
name_suffix = "_ups_temp"
data_format = "nagios"
[[outputs.influxdb_v2]]
urls = ["http://192.168.x.x:8086"]
token = "--token--"
organization = "--org--"
bucket = "UPS"
Any pointers would be greatly appreciated.
I would try making multiple [[inputs.exec]] configuration with different name_suffix = "_ups_tempXX" where XX something what could identify source device. It will put data in different measurement. Another way to go is to add tag keys in your telegraf exec configuration. List of tag names to extract from top-level of JSON server response: tag_keys = [ "my_tag_1", "my_tag_2" ]
But in this case you will need to update your exec response by sending also values of tag keys. As a tag key you may use device IP or something what will let you easily filter data from all sources. I found some old docs, It may be helpful for you: https://archive.docs.influxdata.com/telegraf/v1.3/concepts/data_formats_input/