I am building an application to control more than 20 raspberry pis where each of which controls 32 relays connected to electrical locks. having a big system like this would require self-diagnoses mechanisim to know when and where the problem in the system exists e.g. relay, lock, raspberry, etc.
Is there a mechanism to build such a system to diagnose the raspberry pi's connected components every now and then or especially on boot-up to check all relays' and locks' health and functionality e.g. if a lock is released successfully or not?