Telegraf addon for hassio (glances alternative)

Tags: #<Tag:0x00007f7399535200>

First post and first addon so go easy on me.

I have created an add on to implement telegraf (similar to glances but made by influxDB team) into the hassio eco-system. If you add https://github.com/Sabuto/hassio-repo to your hassio addon’s it will appear in the addon store.

I would love feedback and/or PR’s to help improve it.

One problem at the moment is that i can’t get it to interact with the docker.sock but i will be looking into this a bit more it just means that it doesn’t report any data on the docker containers.

3 Likes

Hi, appreciate it. Just few questions, are you sure that you are monitoring host filesystem and not just your addon container filesystem ? I mean did you mount the /proc of the host ?
For the docker containers same thing, you need to mount the docker.sock from the host in the container.

That is a good point, I will look into this tonight or tomorrow more. It seems to monitor the host file system but that could be because of the bi-directional drive as my free space is the same. Also the load cpu and ram usage are the same as if I was running g outside but will do some more testing :slight_smile:

1 Like

I have pushed an update to the repo, you can now monitor docker and it definately monitors system proc @SNoof85 thanks for the questions gave me things to think about. I am going to look into a few more options and being able to configue the outputs more if anyone would like to see something specific please let me know.

2 Likes

Hey guys, so i have updated the repo a bit in order that if i wanted to create more addons i can easily add them this means that i have had to move the main telegraf repo over. Please make a pull request on: https://github.com/Sabuto/hassio-telegraf if you would like to add anything. I have also implemented proper tagged releases. There is no schedule for releases, maybe one will come in the future if needed.

1 Like

Really interested in using this addon to pull temperature data and fan speeds from my Dell server through iDRAC and IPMI. I have been looking at the below (Still trying to get my head around it as I have not used Telegraf before). Any advice on how to use your plugin for this would be appreciated.

I haven’t done much with IDRAC or IPMI or ever had the need too but I’ll look into it :slight_smile:

@cdk222 I have added ipmi to the config, please update and it should work :slight_smile:

Thank you for that - im away with work but will get stuck into it on the weekend and let you know how i go

Hi Robert

Could you please give me an example of the code to go into the config section in order to enable the IPMI_Sensor. I have been trying various things to get it to work but no luck. Too be honest looking at the log I am not sure it is even seeing the sensor at startup. I get the below error message with or without the sensor in the config. Thanks

[22:54:12] INFO: Updating config
[22:54:12] INFO: Updating config for Kernel
[22:54:12] INFO: Updaing config for Swap
[22:54:12] INFO: Finished updating config, Starting Telegraf
2019-11-18T14:54:12Z I! Starting Telegraf 1.12.4
2019-11-18T14:54:12Z I! Using config file: /etc/telegraf/telegraf.conf
2019-11-18T14:54:12Z I! Loaded inputs: mem internal nstat sensors kernel cpu swap swap system interrupts net disk processes diskio linux_sysctl_fs netstat
2019-11-18T14:54:12Z I! Loaded aggregators:
2019-11-18T14:54:12Z I! Loaded processors:
2019-11-18T14:54:12Z I! Loaded outputs: influxdb
2019-11-18T14:54:12Z I! Tags enabled: host=f9b96d0f-hassio-telegraf
2019-11-18T14:54:12Z I! [agent] Config: Interval:10s, Quiet:false, Hostname:“f9b96d0f-hassio-telegraf”, Flush Interval:10s
2019-11-18T14:54:20Z E! [inputs.sensors] Error in plugin: failed to run command /usr/bin/sensors -A -u: exit status 1 - No sensors found!
Make sure you loaded all the kernel drivers you need.
Try sensors-detect to find out which these are.

I’ll look into it properly tonight or tomorrow, could you post your config too please? I have a feeling this will need to disable protection mode for everything

Thanks

Config is as follows. This does not have any of the ipmi credentials, server details as I am just trying to get it to see the sensor initially. I have tried all the credentials in the config but received the same message. Also the only way I could get the Retension policy to work was to leave it blank (i did change it both in influxDB and the telegraf config

{
“influxDB”: “http://a0d7b954-influxdb:8086”,
“influx_db”: “telegraf”,
“influx_user”: “*****”,
“influx_pw”: “****”,
“retention_policy”: “”,
“kernel”: {
“enabled”: true
},
“swap”: {
“enabled”: true
},
“docker”: {
“enabled”: false,
“timeout”: “5s”
},
“smart_monitor”: {
“enabled”: false,
“timeout”: “30s”
},
“ipmi_sensor”: {
“enabled”: true,
“interval”: “30s”,
“timeout”: “20s”
}
}

Thanks for this just to double check are you running in protection mode? If so can you try it with that disabled please? Also what are you running on?

I have tried running with protection disabled but still get the following:

2019-11-19T13:07:50Z E! [inputs.sensors] Error in plugin: failed to run command /usr/bin/sensors -A -u: exit status 1 - No sensors found!

My Hassio is running inside a Proxmox VM (Debian Buster) on a Dell PowerEdge server.

Hmm ok I’ll take a proper look when I get chance it may have something to do with proxmox but we’ll see :slight_smile:

not sure its the Proxmox…the Hassio is in its own Docker container. It seems to not like something in the ipmi sensor as the logs indicate that everything else is fine up until this point.

Ahh ok so if the impi sensors are not active everything works?

Yep. When i enable Smart Monitor, Docker, Swap, Kernal they all update fine and I can see then at the bottom of the telegraf.conf file when i edit it in the container…i looked at your ipmi_sensor code but I cant see any obvious error in there. Are you able to enable it in your plugin? Even if it has nothing to authenticate to it would be interesting to see if it loads as a sensor

[22:08:31] INFO: Updating config
[22:08:31] INFO: Updating config for Kernel
[22:08:31] INFO: Updaing config for Swap
[22:08:31] INFO: Updating config for Smart Monitor

[22:08:31] INFO: Finished updating config, Starting Telegraf
2019-11-19T14:08:31Z I! Starting Telegraf 1.12.4
2019-11-19T14:08:31Z I! Using config file: /etc/telegraf/telegraf.conf
2019-11-19T14:08:31Z I! Loaded inputs: internal linux_sysctl_fs system smart interrupts mem processes swap swap netstat sensors diskio disk net nstat kernel cpu

I will check and see tonight :slight_smile:

Ok I realised I hadn’t updated in the repo properly, this is now done you’ll need to uninstall the addon refresh the addon store and reinstall and it should work. Or if you can wait I am planning on a new release within the next few days so you’ll just be able to update.