-
-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature] Add network throughput #11
Comments
Nice work. |
Anyway, you did a GREAT job. I will remove all my snmp stuff except de NIC
transfer rate and SSH logins! I will keep an eye on the updates!
Thank you all!
Enric
Missatge de Tomaae ***@***.***> del dia dl., 11 d’abr. 2022 a
les 8:39:
… Nice work.
I'm using API, so information I get is limited to that of course.
I will look into network, not sure why I didnt added that, could have been
some issue. HACS approval took a month, so I dont really remember.
Uptime is available in HA standard, if you need something special, you can
transform it into any format using HA templating system.
SSH related is OS stuff, its not NAS related. I dont think I would even
find that in API.
Not sure about other stuff, its mostly static information which is
available. But as a sensor would not make much sense for HA.
—
Reply to this email directly, view it on GitHub
<#11 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AMI2DA4COLL4EIPZ2LPYFZTVEPCJJANCNFSM5TB6V3OA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
--
Enric
|
Yea, SSH is not something usually required, but if you need that, you still need to use SNMP. PS: you mention something about SMB in title. what are you missing? |
Cool, thanks! Keep in touch for if you need something.
I created the snmp throughput sensor with the derivative integration. You
have the commend on the github post!
Regards!
Missatge de Tomaae ***@***.***> del dia dt., 12 d’abr. 2022 a
les 1:59:
… Yea, SSH is not something usually required, but if you need that, you
still need to use SNMP.
I will look into adding network throughput. It should be possible.
—
Reply to this email directly, view it on GitHub
<#11 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AMI2DAY34T2PJG43MDT4FETVES4HZANCNFSM5TB6V3OA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
--
Enric
|
yes, there would be one unrelated thing. I see you are using ZRAID. is there anything that needs to be monitored on ZRAID and is available in TrueNAS? |
There is a couple of important things that can be important to monitor from
HA. In first place the critical errors from disk drives. I have a 8 TB
RAIDZ2 (its similar than RAID5). Yo can lose up to 50 percent of hdds.
Having a critical error sensor on HA for each drive, or each pool you can
act replacing it (or both sensors!).
There's some drive that can be set up as "spare". They are on standby
waiting for a RAIDZ disk to fail, and they perform an "auto replace".
Anyway, informing about the disk status can be a big deal (Storage -> Pools
-> Pool Status)
About each pool, there's the scrub status and completed %, and the number
of errors. Can be good information to have (scrubbing is to find some data
integrity problems and solve it). Same thing with Resilvering (resilvering
is to perform the data copy to replacement disks).
Can it be possible to perform an "zpool clear name_of_the_pool" from ha? it
would be great!
In my snmp sensors I have detailed information that is nice to know about
the system: RAM and SWAP memory (Yes, I understand that is system
information, non trunas one). Same with NIC throughput. I'm have some
troubles to write a template to create a valid "human readable" uptime from
Uptime sensor. Maybe can appear both sensors.
Also you can have warning and critical messages informing at the UI (on the
ssh o web iu failed logins, or disk errors, for example).
I will attach you an screenshot.
[image: Captura de pantalla 2022-04-12 a les 17.28.56.png]
Regards!
Missatge de Tomaae ***@***.***> del dia dt., 12 d’abr. 2022 a
les 12:54:
… yes, there would be one unrelated thing. I see you are using ZRAID. is
there anything that needs to be monitored on ZRAID and is available in
TrueNAS?
I never touched ZRAID since I build my NAS for best performance (stripped
mirror ssd drives), so I have no idea what is important there.
—
Reply to this email directly, view it on GitHub
<#11 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AMI2DA3DAPDKIB4LIM6OAN3VEVI6XANCNFSM5TB6V3OA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
--
Enric
|
With RAIDZ2 you can lose only 1 drive tho. |
Hi friend! Im trying to fix the timestamp issue and covert it to readable text, and I cannot the right performance of any example. Can you helpme? I've been seeing all the attributes on HA truenas sensors. Awesome! |
If it is not in UI, its unlikely to be accessible using API. Not sure what you need to do with uptime sensor. Got these 2 types from HA forums:
You can find many more there. |
The seccond one worked! Thank you friend!
Im getting the "Scrub secs left" attribute from truenas_raidz2_free sensor,
to build my own sensor about remaining scrub time. How I work with
attributes with spaces between attribute words name?
Thank you friend!!
enric
Missatge de Tomaae ***@***.***> del dia dt., 12 d’abr. 2022 a
les 23:42:
… If it is not in UI, its unlikely to be accessible using API.
Not sure what you need to do with uptime sensor. Got these 2 types from HA
forums:
{{ as_timestamp(states.sensor.truenas_uptime.state) | timestamp_custom(' %Y-%m-%d %I:%M:%S %p ') }}
{%- set time = (as_timestamp(now()) - as_timestamp(states.sensor.truenas_uptime.state)) | int %}
{%- set minutes = ((time % 3600) // 60) %}
{%- set minutes = '{}minutes'.format(minutes) if minutes > 0 else '' %}
{%- set hours = ((time % 86400) // 3600) %}
{%- set hours = '{}hours '.format(hours) if hours > 0 else '' %}
{%- set days = (time // 86400) %}
{%- set days = '{}days '.format(days) if days > 0 else '' %}
{{ 'Less than 1 minute' if time < 60 else days + hours + minutes }} ago
You can find many more there.
—
Reply to this email directly, view it on GitHub
<#11 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AMI2DA2NXQQGSQFCE4WTUIDVEXU4BANCNFSM5TB6V3OA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
--
Enric
|
If I understood it right, this is what you are looking for:
|
Hi friends, I got it.
I paste it here to you the HA sensor template code for sharing it at de
description of the integration (uptime and scub time). Maybe can be useful
to other users. Thank you all!
*- platform: template sensors: truenas_uptime_readable:
value_template: >- {%- set time = (as_timestamp(now()) -
as_timestamp(states.sensor.truenas_uptime.state)) | int %} {%- set
minutes = ((time % 3600) // 60) %} {%- set minutes = '{}
minuts'.format(minutes) if minutes > 0 else '' %} {%- set hours =
((time % 86400) // 3600) %} {%- set hours = '{} hores
'.format(hours) if hours > 0 else '' %} {%- set days = (time //
86400) %} {%- set days = '{} dies '.format(days) if days > 0 else ''
%} {{ 'Less than 1 minute' if time < 60 else days + hours + minutes
}} icon_template: mdi:clock-outline - platform: template
sensors: raidz_scrub_left: value_template: >- {%- set
time = state_attr('binary_sensor.truenas_raidz2_healthy', 'Scrub secs
left') | int %} {%- set minutes = ((time % 3600) // 60) %} {%-
set minutes = '{} minuts'.format(minutes) if minutes > 0 else '' %}
{%- set hours = ((time % 86400) // 3600) %} {%- set hours = '{}
hores '.format(hours) if hours > 0 else '' %} {%- set days = (time //
86400) %} {%- set days = '{} dies '.format(days) if days > 0 else ''
%} {{ 'Less than 1 minute' if time < 60 else days + hours + minutes
}} icon_template: mdi:clock-outline*
Enric
Missatge de Enric Aragó ***@***.***> del dia dc., 13 d’abr. 2022 a
les 18:33:
… Yes, that's it. I finally get it. What I cannot perform is to translate
seconds to "human readable time" (Remember my uptime issue, same thing).
I'm fighting on it!
Oh, what a crap. It returns me "unknown". When I test the template on
HA->developer->template it works!
Its the rest of the code, maybe.
value_template: >-
{% set time = state_attr('binary_sensor.truenas_raidz2_healthy',
'Scrub secs left') | int %}
{%- set minutes = ((time % 3600) // 60) %}
{%- set minutes = '{} minuts'.format(minutes) if minutes > 0 else
'' %}
{%- set hours = ((time % 86400) // 3600) %}
{%- set hours = '{} hores '.format(hours) if hours > 0 else '' %}
{%- set days = (time // 86400) %}
{%- set days = '{} dies '.format(days) if days > 0 else '' %}
Missatge de Tomaae ***@***.***> del dia dc., 13 d’abr. 2022
a les 14:23:
> If I understood it right, this is what you are looking for:
>
> {{ state_attr('binary_sensor.truenas_boot_pool_healthy', 'Scrub secs left') }}
>
> —
> Reply to this email directly, view it on GitHub
> <#11 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AMI2DA5DRTAXIE4POV6SENTVE24EJANCNFSM5TB6V3OA>
> .
> You are receiving this because you authored the thread.Message ID:
> ***@***.***>
>
--
Enric
--
Enric
|
mailing this is not a good idea. that does not take to formatting nicely :) |
Hi friends!
I use trueNas since it was named freenas. I build my own interface based on SNMP to keep it clear at my HA. Yours is Great!!
Mine just report some basic information, but please check it out cause its different and gives additional information, and can be useful for more friends like us.
Thank you all for your job! I add today your integration at my HA, and will keep both methods working for some time.
My interface gives me some valid information, than yours still does not do. I list it here to give you some Ideas!
HOSTNAME
name: "Temido Name"
host: !secret temido_ip
baseoid: 1.3.6.1.2.1.1.5.0
community: !secret snmpcom
version: "2c"
scan_interval: 86400
DESCRIPTION
name: "Temido Descript"
host: !secret temido_ip
baseoid: 1.3.6.1.2.1.1.1.0
community: !secret snmpcom
version: "2c"
scan_interval: 86400
CONTACT
name: "Temido Contact"
host: !secret temido_ip
baseoid: 1.3.6.1.2.1.1.4.0
community: !secret snmpcom
version: "2c"
scan_interval: 86400
LOCATION
name: "Temido Location"
host: !secret temido_ip
baseoid: 1.3.6.1.2.1.1.6.0
community: !secret snmpcom
version: "2c"
scan_interval: 86400
USERS
name: "Temido concurrent users"
host: !secret temido_ip
baseoid: .1.3.6.1.2.1.25.1.5.0
community: !secret snmpcom
version: "2c"
scan_interval: 150
SSH LOGINS
name: "Temido W"
host: !secret temido_ip
community: !secret snmpcom
version: "2c"
baseoid: .1.3.6.1.2.1.25.1.21
scan_interval: 300
Number of process
name: "Temido CPU process"
host: !secret temido_ip
baseoid: .1.3.6.1.2.1.25.1.6.0
value_template: "{{(value)}}"
community: !secret snmpcom
version: "2c"
scan_interval: 30
DETAILED UPTIME
host: !secret temido_ip
community: !secret snmpcom
version: "2c"
baseoid: .1.3.6.1.2.1.25.1.1.0
name: TEMIDO Uptime
scan_interval: 60
value_template: >-
{% set timetick = value | int %}
{% set minutes = ((timetick % 360000) / 6000) | int%}
{% set hours = ((timetick % 8640000) / 360000) | int %}
{% set days = (timetick / 8640000) | int %}
{%- if timetick < 6000 -%}
Less than a minute
{%- else -%}
{%- if days > 0 -%}
{%- if days == 1 -%}
1 day
{%- else -%}
{{ days }} days
{%- endif -%}
{%- endif -%}
{%- if hours > 0 -%}
{%- if days > 0 -%}
{{ ', ' }}
{%- endif -%}
{%- if hours == 1 -%}
1 hr
{%- else -%}
{{ hours }} hrs
{%- endif -%}
{%- endif -%}
{%- if minutes > 0 -%}
{%- if days > 0 or hours > 0 -%}
{{ ', ' }}
{%- endif -%}
{%- if minutes == 1 -%}
1 min
{%- else -%}
{{ minutes }} min
{%- endif -%}
{%- endif -%}
{%- endif -%}
ETH IN and OUT NETWORK SPEED
platform: snmp
name: 'Temido Eth In'
host: !secret temido_ip
baseoid: 1.3.6.1.2.1.31.1.1.1.6.1
#baseoid: 1.3.6.1.2.1.2.2.1.10.1
community: !secret snmpcom
version: '2c'
platform: snmp
name: 'Temido Eth Out'
host: !secret temido_ip
baseoid: 1.3.6.1.2.1.31.1.1.1.10.1
community: !secret snmpcom
version: '2c'
platform: derivative
name: 'Temido Eth In Stats'
source: sensor.temido_eth_in
unit_time: s
unit: B
platform: derivative
name: 'Temido Eth Out Stats'
source: sensor.temido_eth_out
unit_time: s
unit: B
platform: template
sensors:
temido_eth_in_mbps:
value_template: "{{ [((states('sensor.temido_eth_in_stats')|float(none))/1000000)|round(2, default=none),0]|max }}"
unit_of_measurement: 'MBps'
temido_eth_out_mbps:
value_template: "{{ [((states('sensor.temido_eth_out_stats')|float(none))/1000000)|round(2, default=none),0]|max }}"
unit_of_measurement: 'MBps'_
I let you here some screenshoots!
Best regards, and thank you all!
Is your feature request related to a problem? Please describe.
Describe the solution you'd like
Describe alternatives you've considered
Additional context
The text was updated successfully, but these errors were encountered: