Skip to content

Instantly share code, notes, and snippets.

@imv7
Created June 1, 2017 23:19
Show Gist options
  • Save imv7/092cbf69cb85c91406ec7c9dd13e4423 to your computer and use it in GitHub Desktop.
Save imv7/092cbf69cb85c91406ec7c9dd13e4423 to your computer and use it in GitHub Desktop.
WebServer Monitor (HTTP and HTTPS)
#!/bin/ksh
#
#=======================================================================
#
# Script: mon_oiws
#
# Purpose: Verify the OiWS is active.
# If inactive, acivate.
# If still inactive, generate page.
## Parms: None.
#
#
usage="$0"
#
#=======================================================================
#
OiWSrtida10180=`echo "\iv963m" |telnet 32.84.115.205 80`
OiWSrtida101443=`echo "\iv963m" |telnet 32.84.115.205 443`
OiWSrcipa10280=`echo "\iv963m" |telnet 32.84.58.40 80` OiWSrcipa10380=`echo "\iv963m" |telnet rcipa103.ims.att.com 80`
OiWSrcipa103443=`echo "\iv963m" |telnet rcipa103.ims.att.com 443`
OiWSrcipa20380=`echo "\iv963m" |telnet rcipa203.ims.att.com 80`
OiWSrcipa203443=`echo "\iv963m" |telnet rcipa203.ims.att.com 443`
rc=0
oiwsdate=`date +'%d/%m/%Y %T'`
#rtida101
if [ -n `echo $OiWSrtida10180 |grep "Connection closed"` ];
then echo "Connected 32.84.115.205:80"
else
echo OiWSan attempted connect operation 32.84.115.205:80 | mail -s "$(hostname) OiWS is not running" [email protected]
echo $oiwsdate $(hostname) SNA is NOT working properly. > /tmp/sna.log
fi
if [ -n `echo $OiWSrtida101443 |grep "Connection closed"` ];
then
echo "Connected 32.84.115.205:443"
else
echo Could not connect 32.84.115.205:443 | mail -s "$(hostname) OiWS is not running" [email protected]
echo $oiwsdate $(hostname) SNA is NOT working properly. > /tmp/sna.log
fi
#rcipa102
if [ -n `echo $OiWSrcipa10280 |grep "Connection closed"` ];
then
echo "Connected 32.84.58.40:80"
else
echo Could not connect 32.84.58.40:80 | mail -s "$(hostname) OiWS is not running" [email protected]
echo $oiwsdate $(hostname) SNA is NOT working properly. > /tmp/sna.log
fi
#rcipa103
if [ -n `echo $OiWSrcipa10380 |grep "Connection closed"` ];
then
echo "Connected rcipa103.ims.att.com:80"
else
echo Could not connect rcipa103.ims.att.com:80 | mail -s "$(hostname) OiWS is not running" [email protected]
echo $oiwsdate $(hostname) SNA is NOT working properly. > /tmp/sna.log
fi
if [ -n `echo $OiWSrcipa103443 |grep "Connection closed"` ];
then
echo "Connected rcipa103.ims.att.com:443"
else
echo Could not connect rcipa103.ims.att.com:443 | mail -s "$(hostname) OiWS is not running" [email protected]
echo $oiwsdate $(hostname) SNA is NOT working properly. > /tmp/sna.log
fi
#rcipa203
if [ -n `echo $OiWSrcipa20380 |grep "Connection closed"` ];
then
echo "Connected rcipa203.ims.att.com:80"
else
echo Could not connect 32.84.115.205:80 | mail -s "$(hostname) OiWS is not running" [email protected]
echo $oiwsdate $(hostname) SNA is NOT working properly. > /tmp/sna.log
fi
if [ -n `echo $OiWSrcipa203443 |grep "Connection closed"` ];
then
echo "Connected rcipa203.ims.att.com:443"
else
echo Could not connect 32.84.115.205:443 | mail -s "$(hostname) OiWS is not running" [email protected]
echo $oiwsdate $(hostname) SNA is NOT working properly. > /tmp/sna.log
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment