Skip to content

Instantly share code, notes, and snippets.

@briantissue
briantissue / monitor-website-systemdaemon.sh
Last active January 3, 2019 14:11
Monitor a web server as a system daemon; Send notification on Down and when the site comes up
#!/bin/bash
[email protected]
[email protected]
SERVER=https://servertomonitor.domain.com
PAUSE=300 # Checks this server every 5 minutes
FAILED=0
DEBUG=0
while true
do
@briantissue
briantissue / monitor-server-icmp.sh
Created January 3, 2019 14:15
Monitor Server Availability that doesn't run a webserver; ICMP Checks.
#!/bin/bash
[email protected]
[email protected]
SERVER=fqdnoripaddress
PAUSE=300
FAILED=0
DEBUG=0
while true
do
@briantissue
briantissue / gist:d0243549e58f6cd01660128f1f955dc4
Created May 27, 2021 20:07
NMAP Scans For Firewalls Check
#!/bin/bash
# Written by Brian Tissue May 2021
> nmapresults.txt
for HOST in `cat hosts_scan|grep -v ^#`; do echo ${HOST}; nmap -v ${HOST} | grep -i ${HOST} | grep -i open ; done >> /home/scanner/nmapresults.txt
/usr/sbin/sendmail [email protected] < /home/scanner/nmapresults.txt
/usr/sbin/sendmail [email protected] < /home/scanner/nmapresults.txt