#! /bin/ksh
#
#pragma ident       "@(#)nshttp_status.shi 1.4     00/08/25 SMI"
#
# Copyright (c) 1999 by Sun Microsystems, Inc.
# All rights reserved.
#
#
# Usage: nshttp_status LogicalHosts
#
# Called from hastat to get status of NSHTTP

nodeloghosts="$1"

#read the configuration parameters
source_env NSHTTP

# source in ha-services common utilities
. ds_utilities

SYSLOG_PREFIX="SUNWcluster.ha.nshttp"

for i in $_INST_LIST; do
    
	# Check Logical Host
	instloghost=`get_config_param $i LOGICAL_HOST`

	is_member "${instloghost}" "${nodeloghosts}"
	if [ $? -ne 0 ]; then
		# The NSHTTP loghost is not mastered here
		lmsg1=`gettext "       NSHTTP Instance %s is not being managed on this system"`
		printf "${lmsg1}\n" "${i}"
		continue
	fi

	ha_svc_not_running "${i}.probe"
	if [ $? -eq 0 ]; then
		lmsg1=`gettext "       NSHTTP Instance %s is not monitored"`
		printf "${lmsg1}\n" "${i}"
	else
		lmsg1=`gettext "       NSHTTP Instance %s is monitored"`
		printf "${lmsg1}\n" "${i}"
	fi

done

exit 0
