OPNsense Forum

Archive => 24.1, 24.4 Legacy Series => Topic started by: zyghom on April 11, 2024, 09:10:56 AM

Title: temperature sensors - get the data from OPNsense on regular basis - CLI or API
Post by: zyghom on April 11, 2024, 09:10:56 AM
hi there,

I am trying to figure out if I need a fan or not but one thing that does not help me is: the cpu temperatures shown in the report on GUI are not showing trends - only the status at this particular moment:

(https://papio.uk/others/1.png)

Is there any way to have it exported on regular basis?
I tried Monit and Telegraf but it seems this information is not there.
Any other way?

thx
Title: Re: temperature sensors - get the data from OPNsense on regular basis - CLI or API
Post by: cookiemonster on April 11, 2024, 11:34:50 AM
No, the UI is only point in time.
Best way is with telegraf which you seem to have. What you're missing is the right sensor setup. You might need to use inputs.exec https://github.com/influxdata/telegraf/blob/master/plugins/inputs/exec/README.md (https://github.com/influxdata/telegraf/blob/master/plugins/inputs/exec/README.md)
Title: Re: temperature sensors - get the data from OPNsense on regular basis - CLI or API
Post by: zyghom on April 11, 2024, 11:40:30 AM
thank you @cookiemonster, I shall try, I think I know how to ;-)
Title: Re: temperature sensors - get the data from OPNsense on regular basis - CLI or API
Post by: zyghom on April 11, 2024, 03:27:55 PM
it looks like I succeeded - thank you again
with small caviat: to get disks temperature I, the command:
smartctl -a /dev/ada1 | grep Temperat | awk '{ print $10 }'
requires root priviledges so I did not get it yet how to. But for CPU/ACPI the user telegraf is enough to get the data (without and with fan installed):
(https://papio.uk/others/opnsense-temps.png)
Title: Re: temperature sensors - get the data from OPNsense on regular basis - CLI or API
Post by: cookiemonster on April 11, 2024, 04:22:44 PM
Nice!