#Shell script to Netezza System status (NPS) IBM Netezza
#Manish Jaiswal
#!/bin/sh
# =============================================================================
# Netezza NPS Status
# =============================================================================
# Script configuration - Static values only.
# =============================================================================
cd /export/home/nz
. ~/.bashrc
export PATH=/nz/kit/bin:/nz/kit/sbin:/nz/kit/bin/adm:/bin:/usr/bin:/usr/local/bin:.:/nz/support/bin
NPS_STATE=`nzstate | awk '{print $4}' | tr -d "[.']" | tr "[a-z]" "[A-Z]"`
# ------------------------------------------------------------------------
# Make sure the system is online.
# ------------------------------------------------------------------------
if [ "${NPS_STATE}" = "ONLINE" ]
then
echo "${NPS_STATE}"
SYSTEMSTATE=0
else
echo "NPS ${NPS_STATE} OFFLINE During Hostbackup!"
echo " NPS is Offline on $HOST in Current state: [${NPS_STATE}]"|mailx -s "CRITICAL:NZHOSTBACKUP on $HOST " $email_list
exit;
fi
#Manish Jaiswal
#!/bin/sh
# =============================================================================
# Netezza NPS Status
# =============================================================================
# Script configuration - Static values only.
# =============================================================================
cd /export/home/nz
. ~/.bashrc
export PATH=/nz/kit/bin:/nz/kit/sbin:/nz/kit/bin/adm:/bin:/usr/bin:/usr/local/bin:.:/nz/support/bin
NPS_STATE=`nzstate | awk '{print $4}' | tr -d "[.']" | tr "[a-z]" "[A-Z]"`
# ------------------------------------------------------------------------
# Make sure the system is online.
# ------------------------------------------------------------------------
if [ "${NPS_STATE}" = "ONLINE" ]
then
echo "${NPS_STATE}"
SYSTEMSTATE=0
else
echo "NPS ${NPS_STATE} OFFLINE During Hostbackup!"
echo " NPS is Offline on $HOST in Current state: [${NPS_STATE}]"|mailx -s "CRITICAL:NZHOSTBACKUP on $HOST " $email_list
exit;
fi
No comments:
Post a Comment