Cover V04, I06
Article
Figure 1
Figure 2
Figure 3
Listing 1
Listing 10
Listing 2
Listing 3
Listing 4
Listing 5
Listing 6
Listing 7
Listing 8
Listing 9

nov95.tar


Listing 8: check_in_master_list.ksh--Checks if server should be monitored

#!/bin/ksh
#==================================================
# check_in_master_list.ksh :
#     Used for checking whether a host is present
#     in the master list.
#
# Parameters :
#	arg1  	hostname
#	arg2	Filename of master list
#
# Return value :
#	0 	host is present in the master list
#	1 	host not present or commented out
#	2	invalid parameters
#====================================================
if [ $# -ne 2 ] ; then
echo "Usage: $0  <hostname>  <master_list>"
exit 2
fi

awk '		   { exit_value = 1 ;  }
$1 == HOST { exit_value = 0 ; exit ; }
END	   { exit (exit_value) ; }
' HOST=$1 $2