| 
									
										
										
										
											2020-03-27 21:41:40 +01:00
										 |  |  |  | Notify about health state | 
					
						
							|  |  |  |  | ========================= | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-01-10 14:45:27 +01:00
										 |  |  |  | [⬅️ Go back to main README](../README.md) | 
					
						
							| 
									
										
										
										
											2020-03-27 21:41:40 +01:00
										 |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-02-12 13:05:56 +01:00
										 |  |  |  | > ℹ️ **Info**: This script can not be used on its own but requires the base
 | 
					
						
							| 
									
										
										
										
											2022-02-11 23:34:39 +01:00
										 |  |  |  | > installation. See [main README](../README.md) for details.
 | 
					
						
							| 
									
										
										
										
											2021-05-03 15:07:50 +02:00
										 |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-03-27 21:41:40 +01:00
										 |  |  |  | Description | 
					
						
							|  |  |  |  | ----------- | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | This script is run from scheduler periodically, sending notification on | 
					
						
							|  |  |  |  | health related events: | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-02-14 20:09:41 +01:00
										 |  |  |  | * high CPU utilization | 
					
						
							| 
									
										
										
										
											2023-01-20 14:34:18 +01:00
										 |  |  |  | * low available free RAM | 
					
						
							| 
									
										
										
										
											2023-02-13 11:15:06 +01:00
										 |  |  |  | * voltage jumps up or down more than configured threshold | 
					
						
							|  |  |  |  | * voltage drops below hard lower limit | 
					
						
							| 
									
										
										
										
											2020-03-27 21:41:40 +01:00
										 |  |  |  | * power supply failed or recovered | 
					
						
							|  |  |  |  | * temperature is above or below threshold | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | Note that bad initial state will not trigger an event. | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-02-14 20:09:41 +01:00
										 |  |  |  | Monitoring CPU utilization and available free RAM works on all devices. | 
					
						
							|  |  |  |  | Other than that only sensors available in hardware can be checked. See what | 
					
						
							|  |  |  |  | your hardware supports: | 
					
						
							| 
									
										
										
										
											2020-03-27 21:41:40 +01:00
										 |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-05-11 09:57:09 +02:00
										 |  |  |  |     /system/health/print; | 
					
						
							| 
									
										
										
										
											2020-03-27 21:41:40 +01:00
										 |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-06-17 15:23:51 +02:00
										 |  |  |  | ### Sample notifications
 | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-02-14 20:09:41 +01:00
										 |  |  |  | #### CPU utilization
 | 
					
						
							| 
									
										
										
										
											2023-01-20 14:24:20 +01:00
										 |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-02-14 20:09:41 +01:00
										 |  |  |  |    | 
					
						
							|  |  |  |  |  | 
					
						
							| 
									
										
										
										
											2023-01-20 14:24:20 +01:00
										 |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-01-20 14:34:18 +01:00
										 |  |  |  | #### Available free RAM
 | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-02-13 11:12:44 +01:00
										 |  |  |  |    | 
					
						
							| 
									
										
										
										
											2023-01-20 14:34:18 +01:00
										 |  |  |  |  | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-06-17 15:23:51 +02:00
										 |  |  |  | #### Voltage
 | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-01-20 14:34:18 +01:00
										 |  |  |  |  | 
					
						
							| 
									
										
										
										
											2021-06-17 15:23:51 +02:00
										 |  |  |  | 
 | 
					
						
							|  |  |  |  | #### Temperature
 | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-01-20 14:34:18 +01:00
										 |  |  |  |    | 
					
						
							|  |  |  |  |  | 
					
						
							| 
									
										
										
										
											2021-06-17 15:23:51 +02:00
										 |  |  |  | 
 | 
					
						
							|  |  |  |  | #### PSU state
 | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-01-20 14:34:18 +01:00
										 |  |  |  |    | 
					
						
							|  |  |  |  |  | 
					
						
							| 
									
										
										
										
											2021-06-17 15:23:51 +02:00
										 |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-03-27 21:41:40 +01:00
										 |  |  |  | Requirements and installation | 
					
						
							|  |  |  |  | ----------------------------- | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | Just install the script and create a scheduler: | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |     $ScriptInstallUpdate check-health; | 
					
						
							| 
									
										
										
										
											2022-05-11 09:57:09 +02:00
										 |  |  |  |     /system/scheduler/add interval=1m name=check-health on-event="/system/script/run check-health;" start-time=startup; | 
					
						
							| 
									
										
										
										
											2020-03-27 21:41:40 +01:00
										 |  |  |  | 
 | 
					
						
							|  |  |  |  | Configuration | 
					
						
							|  |  |  |  | ------------- | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-06-18 10:24:33 +02:00
										 |  |  |  | The configuration goes to `global-config-overlay`, these are the parameters: | 
					
						
							| 
									
										
										
										
											2020-03-27 21:41:40 +01:00
										 |  |  |  | 
 | 
					
						
							|  |  |  |  | * `CheckHealthTemperature`: an array specifying temperature thresholds for sensors | 
					
						
							| 
									
										
										
										
											2021-11-13 21:29:33 +01:00
										 |  |  |  | * `CheckHealthVoltageLow`: value (in volt*10) giving a hard lower limit | 
					
						
							| 
									
										
										
										
											2020-03-27 21:41:40 +01:00
										 |  |  |  | * `CheckHealthVoltagePercent`: percentage value to trigger voltage jumps | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-09-23 15:07:30 +02:00
										 |  |  |  | Also notification settings are required for | 
					
						
							|  |  |  |  | [e-mail](mod/notification-email.md), | 
					
						
							| 
									
										
										
										
											2021-11-16 16:03:25 +01:00
										 |  |  |  | [matrix](mod/notification-matrix.md) and/or | 
					
						
							| 
									
										
										
										
											2021-11-16 16:03:43 +01:00
										 |  |  |  | [telegram](mod/notification-telegram.md). | 
					
						
							| 
									
										
										
										
											2020-03-27 21:41:40 +01:00
										 |  |  |  | 
 | 
					
						
							|  |  |  |  | --- | 
					
						
							| 
									
										
										
										
											2023-01-10 14:45:27 +01:00
										 |  |  |  | [⬅️ Go back to main README](../README.md)   | 
					
						
							|  |  |  |  | [⬆️ Go back to top](#top) |