Wednesday, July 18, 2018

Validate firewall connectivity using nc

Buy Moto series phones: Moto E, Moto G, Moto X or Other phones
Buy eBooks from Flipkart

In absence of telnet we can use nc (which version??) to validate connectivity.

nc -w 2 -v < /dev/null; exitCode=$?; echo "Exit code = $exitCode"; if [ $exitCode -ge 1 ]; then echo "No connectivity"; else echo 'SUCCESS!!!'; fi; >> fw_validation.txt

Friday, July 13, 2018

To setup a simple log monitoring script


#! /bin/bash
echo "monitoring log files"
if grep SQLSTATE application-cronjob-*-`date +"%Y-%m-%d"`.log ;
    echo "sending mail"
    grep -10 SQLSTATE application-cronjob-*-`date +"%Y-%m-%d"`.log | mail -s "errors found in  logs for `date +"%Y-%m-%d"`

Latest Posts