Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 8013

Networking and servers • Re: Pi5 Networt & Port connectivity

$
0
0
Maybe run a script (chkping) on each Pi that checks a ping to the server, something like:

Code:

#!/bin/bashdt=$(date +%Y%m%d_%H%M%S)ip=$(hostname -I)# ip address of serversrvr=192.168.1.146# no. of ping to trytries=4if ping -c $tries $srvr | grep -q "Unreachable" ; then   echo $dt ERROR - Network DOWN, cannot ping $srvrelse   echo $dt Network to $srvr is OK, local ip=$ipfi
Maybe use crontab -e to run it very 5 minutes

Code:

*/5 * * * * /home/pi/scripts/chkping >> /home/pi/chk.log 2>&1

Statistics: Posted by neilgl — Thu Jul 17, 2025 1:39 pm



Viewing all articles
Browse latest Browse all 8013

Trending Articles