I want to monitor the voting validator (main server) from the non-voting validator (spare server running with an unfunded identity). I already use solana-watchtower from that server (as a service) to monitor the health of the voting validator and this info is used to send alert on telegram/discord and so on but, i would like to have the health info to trigger a bash script (for example delinquency status to trigger some commands) and no other output channels are apparently available with this tool. I thought to gethealth RPC command but it seems that i cannot pass parameters to specify which validator to monitor. What else could be used?
1 Answer
The getHealth
endpoint gives the health information of the running validator, so you could send getHealth
to your voting validator if it's running RPC, as long as you're sure to keep its RPC service private.
But even easier might be to modify solana-watchtower
yourself. The source code exists at https://github.com/solana-labs/solana/tree/master/watchtower, and you can add a line after notifier.send
to shell out to your bash script at https://github.com/solana-labs/solana/blob/e9a6bb35e2636275137fc47837f5afce4dbcf630/watchtower/src/main.rs#L391 by doing something like:
use std::process::Command;
Command::new("bash my_script.sh")
.spawn()
.expect("command failed to start");