Skip to content
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

[Bug]/system/health doesn't exist #392

Open
Lieta2 opened this issue Dec 19, 2024 · 27 comments
Open

[Bug]/system/health doesn't exist #392

Lieta2 opened this issue Dec 19, 2024 · 27 comments
Labels
bug Something isn't working

Comments

@Lieta2
Copy link

Lieta2 commented Dec 19, 2024

Describe the issue

Router doesn't have a /system/health entry. Integration continuously prints messages "2024-12-19 18:13:16.066 ERROR (SyncWorker_4) [custom_components.mikrotik_router.mikrotikapi] Mikrotik 10.1.1.2 error while building list for path /system/health : no such command or directory (health), no such command prefix" to the log.

How to reproduce the issue

Configure any Mikrotik router without /system/health (for example Audience).

Expected behavior

No error

Software versions

All fields in this sections are required.

  • Home Assistant version: HA 2024.12.4
  • Mikrotik Router integration version: master branch commit de1ca6a
  • Mikrotik Hardware: RBD25G-5HPacQD2HPnD
  • RouterOS version: 7.17rc3

Traceback/Error logs

2024-12-19 12:52:21.025 WARNING (SyncWorker_3) [custom_components.mikrotik_router.mikrotikapi] Mikrotik Reconnected to 10.1.1.2
2024-12-19 12:52:21.042 ERROR (SyncWorker_1) [custom_components.mikrotik_router.mikrotikapi] Mikrotik 10.1.1.2 error while building list for path /system/health : no such command or directory (health), no such command prefix
2024-12-19 12:52:51.018 WARNING (SyncWorker_6) [custom_components.mikrotik_router.mikrotikapi] Mikrotik Reconnected to 10.1.1.2
2024-12-19 12:52:52.073 ERROR (SyncWorker_5) [custom_components.mikrotik_router.mikrotikapi] Mikrotik 10.1.1.2 error while building list for path /system/health : no such command or directory (health), no such command prefix
2024-12-19 12:53:22.018 WARNING (SyncWorker_2) [custom_components.mikrotik_router.mikrotikapi] Mikrotik Reconnected to 10.1.1.2
2024-12-19 12:53:23.050 ERROR (SyncWorker_0) [custom_components.mikrotik_router.mikrotikapi] Mikrotik 10.1.1.2 error while building list for path /system/health : no such command or directory (health), no such command prefix

@Lieta2 Lieta2 added the bug Something isn't working label Dec 19, 2024
Copy link
Owner

tomaae commented Dec 20, 2024

7.17 is not supported. tho I'm not sure how can you be missing /system/health

@Lieta2
Copy link
Author

Lieta2 commented Dec 20, 2024

/system/health seems to be removed in 7.17rc3. It is present in 7.16.2.

[admin@hAPac^3|arm|172.2] > /system/package/print 
Columns: NAME, VERSION, BUILD-TIME, SIZE
# NAME          VERSION  BUILD-TIME           SIZE     
0 wifi-qcom-ac  7.17rc3  2024-12-10 07:40:32  2680.1KiB
1 routeros      7.17rc3  2024-12-10 07:40:32  11.3MiB  
[admin@hAPac^3|arm|172.2] > /system/health        
bad command name health (line 1 column 9)
[admin@hAPac^3|arm|172.2] > /system/package/print 
Columns: NAME, VERSION, BUILD-TIME, SIZE
# NAME          VERSION  BUILD-TIME           SIZE     
0 wifi-qcom-ac  7.16.2   2024-11-26 12:09:40  2676.1KiB
1 routeros      7.16.2   2024-11-26 12:09:40  11.1MiB  
[admin@hAPac^3|arm|172.2] > /system/health
[admin@hAPac^3|arm|172.2] /system/health> 

@Lieta2
Copy link
Author

Lieta2 commented Dec 20, 2024

Yes, check it out:
Changelog
*) health - hide settings in CLI if there is nothing to show;

Copy link

github-actions bot commented Jan 4, 2025

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@github-actions github-actions bot added the stale label Jan 4, 2025
@Lieta2
Copy link
Author

Lieta2 commented Jan 4, 2025

Not stale.

@github-actions github-actions bot removed the stale label Jan 5, 2025
@tomaae
Copy link
Owner

tomaae commented Jan 8, 2025

Yes, check it out: Changelog *) health - hide settings in CLI if there is nothing to show;

Is your device missing any sensors? Not even temp and voltage?
If this endpoint is just simply missing instead of empty when there are no sensors, this may be tricky to work around.

@Lieta2
Copy link
Author

Lieta2 commented Jan 8, 2025

There are no sensors on the device. As you see they changed it in 7.17rc3 - if there are no sensors, there is no "/system/health". There are many devices that have no sensors, for example, Audience, hap ac2.

Copy link
Owner

tomaae commented Jan 8, 2025

I just find it weird, but ok. We will need a way to figure out that there are no sensors without api failure on query.

@EvgveneSV
Copy link

EvgveneSV commented Jan 17, 2025

I have same problem after upgrade to 7.17 on microtik ac3 .
`This error originated from a custom integration.

Logger: custom_components.mikrotik_router.mikrotikapi
Source: custom_components/mikrotik_router/mikrotikapi.py:95
integration: Mikrotik Router (documentation, issues)
First occurred: January 16, 2025 at 10:17:44 PM (1404 occurrences)
Last logged: 2:05:46 PM

Mikrotik 192.168.2.11 error while building list for path /system/health : no such command or directory (health), no such command prefix
Mikrotik 192.168.2.12 error while building list for path /system/health : no such command or directory (health), no such command prefix`

Microtik ax3, wAP ac with 7.17 - no issues ( maybe ax3 and wAP ac have /system/health sensor )

@Lieta2
Copy link
Author

Lieta2 commented Jan 17, 2025

hap ax3 has CPU temperature sensor:

> /system/health/print 
Columns: NAME, VALUE, TYPE
#  NAME             VALUE  TYPE
0  cpu-temperature     60  C   

@ilwalti
Copy link

ilwalti commented Jan 17, 2025

Model RBcAPGi-5acD2nD doesn't have health sensors, so the integration fails...
Any workaround? Thanks

@alexeyklots
Copy link

For all struggling with the issue, just downgrade your router os to previous version. In my case 7.17 ->7.16. After this integration started working normally

Copy link
Owner

tomaae commented Jan 18, 2025

Not sure how to deal with this right now. This is not documented outside of changelog.
We need a way to detect that there are no sensors, other then listing all models without sensors of course.

@Lieta2
Copy link
Author

Lieta2 commented Jan 21, 2025

7.17 stable was released on 2025-Jan-16.

@zvldz
Copy link

zvldz commented Jan 21, 2025

works for me
coordinator.py

-        elif 0 < self.major_fw_version >= 7:
+        elif (0 < self.major_fw_version >= 7 and self.minor_fw_version < 17):
             self.ds["health7"] = parse_api(
                 data=self.ds["health7"],
                 source=self.api.query("/system/health"),

@jmartinr64
Copy link

for device cAP ac (https://mikrotik.com/product/cap_ac) there are no health sensors so they are hiding on 7.17 stable version
Is not working zvldz workaround for me :(

@zvldz
Copy link

zvldz commented Jan 21, 2025

Is not working zvldz workaround for me :(

Did you try it?

@ilwalti
Copy link

ilwalti commented Jan 21, 2025

Is not working zvldz workaround for me :(

Wrong. I'm using a cAP ac (the round one) and the workaround works fine...

@DrX001CZ
Copy link

On hAP ac^2 with this patch I get the message "'MikrotikCoordinator' object has no attribute 'minor_fw_version'". So I fixed it temporarily by changing it to:

elif (0 < self.major_fw_version >= 8):

Not ideal, but it works.

@jmartinr64
Copy link

Is not working zvldz workaround for me :(

Wrong. I'm using a cAP ac (the round one) and the workaround works fine...

I guess is related with syntax issue can you please share coordinator.py file? :)

@Lieta2
Copy link
Author

Lieta2 commented Jan 21, 2025

works for me coordinator.py

-        elif 0 < self.major_fw_version >= 7:
+        elif (0 < self.major_fw_version >= 7 and self.minor_fw_version < 17):
             self.ds["health7"] = parse_api(
                 data=self.ds["health7"],
                 source=self.api.query("/system/health"),

There is an issue with this fix. /system/health sensors won't show up on the routers that have them (if the integration manages several routers).

@mefodi
Copy link

mefodi commented Jan 23, 2025

I have the same problem with some of my Mikrotiks, so I can't use the workaround.

@zvldz
Copy link

zvldz commented Jan 24, 2025

We need to collect statistics, but it seems to me that 'health' is only on ARM and ARM64 (maybe on x86), but not on MIPS. And then it will be possible to add more checks by CPU.

@Lieta2
Copy link
Author

Lieta2 commented Jan 24, 2025

Also on tile:

> /system/health/print 
Columns: NAME, VALUE, TYPE
#  NAME                VALUE  TYPE
0  cpu-temperature     57     C   
1  fan-state           ok         
2  fan1-speed          3810   RPM 
3  fan2-speed          3645   RPM 
4  board-temperature1  27     C   
5  psu1-state          ok         
6  psu2-state          fail       
> /system/resource/print 
...
        architecture-name: tile
               board-name: CCR1036-12G-4S
                 platform: MikroTik

@Lieta2
Copy link
Author

Lieta2 commented Jan 24, 2025

...and also on MIPS.

> /system/health/print 
Columns: NAME, VALUE, TYPE
#  NAME     VALUE  TYPE
0  voltage  24.2   V   
> /system/resource/print 
...
        architecture-name: mipsbe             
               board-name: CRS112-8G-4S       
                 platform: MikroTik           

@EvgveneSV
Copy link

Powerbox Pro also mipsbe with voltage and temperature sensors ...

@zvldz
Copy link

zvldz commented Jan 24, 2025

Alternatively, 'check_path' function can be added to mikrotikapi.py and check for the existence of '/system/health' in the 'get_system_health' function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

9 participants