Skip to content

Instantly share code, notes, and snippets.

View Marnek's full-sized avatar

Marcel Marnek

  • Timisoara, Romania
View GitHub Profile
@Marnek
Marnek / Heartbeat.sh
Created June 14, 2019 16:19
A simple bash script that pingfloods an array of IPs/hostnames and outputs a JSON of the status of each item in the array, as well as the last date and time of the execution.
#!/bin/bash
SERVERS=( 192.168.12.5 192.168.12.10 192.168.12.15 192.168.19.1 192.168.20.1 )
STATUS=()
ArrayID=0
Entries=${#SERVERS[@]}
Counter=0
LastDate=`date +"%Y-%m-%d"`
LastTime=`date +"%H:%M"`