Cool Solutions

Domain Services for Windows Health Check Tool



By:

September 9, 2009 10:12 am

Reads:4,992

Comments:0

Score:Unrated

This tool will check the status of the services that should be running and report accordingly.

#!/bin/bash

. /opt/novell/eDirectory/bin/ndspath > /dev/null 2>&1
export LDAPCONF=/etc/opt/novell/xad/openldap/ldap.conf
clear
echo -e "################################################################################################################################## \n"
echo -e  "********************* DSfW Domain Controller Sanity Check ********************* \n"
echo -e "################################################################################################################################## \n"
LDAPCONF=/etc/opt/novell/xad/openldap/ldap.conf /usr/bin/ldapsearch -Y EXTERNAL -b '' -s base dn -LLL > /dev/null 2>&1
if [ $? == "0" ]
then
	echo -e  "1. LDAPI interface working \n"
else
	echo -e "1. LDAPI interface *NOT* working \n"
	exit 1;
fi

host=`/bin/hostname`
domain=`perl -e '$dom = \`/bin/dnsdomainname\`; print uc($dom);'`

provision --locate-dc $domain > /dev/null 2>&1
if [ $? == "0" ]
then
        echo -e "2. Domain Controller is located and working \n"
else
        echo -e "Domain Controller is *NOT* located \n"
        exit 1;
fi


echo novell | /opt/novell/xad/bin/kinit Administrator@$domain > /dev/null 2>&1
if [ $? == "0" ]
then
	echo -e "3. kinit working \n"
else
	echo -e "3. kinit *NOT* working \n"
	exit 1;
fi

SASL_PATH=/opt/novell/xad/lib/sasl2 /usr/bin/ldapsearch -H ldap://$host.$domain -Y GSSAPI -b '' -s base dn -LLL > /dev/null 2>&1
if [ $? == "0" ]
then
	echo -e "4. LDAP SASL-GSSAPI bind working \n"
else
	echo -e "4. LDAP SASL-GSSAPI bind *NOT* working \n"
	exit 1;
fi

/usr/bin/rpcclient -k localhost -c dsroledominfo > /dev/null 2>&1
if [ $? == "0" ]
then
	echo -e "5. rpcclient working \n"
else
	echo -e "5. rpcclient *NOT* working \n"
	exit 1;
fi

adminSID=`wbinfo -n administrator | cut -f 1 -d ' '`
if [ "$adminSID" == "" ]
then
	echo -e  "6. wbinfo: name to SID conversion *NOT* working \n"
	exit 1;
else
	echo -e "6. wbinfo: name to SID conversion working \n"
fi

adminuid=`wbinfo -S $adminSID`
if [ "$adminuid" == "" ]
then
	echo -e  "7. wbinfo: SID to uid conversion *NOT* working \n"
	exit 1;
else
	echo -e  "7. wbinfo: SID to uid conversion working \n"
fi

wbinfo -s $adminSID > /dev/null 2>&1
if [ $? == "0" ]
then
	echo -e  "8. wbinfo: SID to name conversion working \n"
else
	echo -e  "8. wbinfo: SID to name conversion *NOT* working \n"
	exit 1;
fi

tmp=`wbinfo -U $adminuid | grep S-1-5-21`
if [ "$tmp" == "" ]
then
	echo -e "9. wbinfo: UID to name conversion *NOT* working \n"
	exit 1;
else
	echo -e "9. wbinfo: UID to name conversion working \n"
fi


smbclient -k -L $host.$domain > /dev/null 2>&1
if [ $? == "0" ]
then
	echo -e "10. smbclient working \n"
else
	echo -e "10. smbclient *NOT* working \n"
	exit 1;
fi

echo -e "##################################################################################################################################"
#If any of these doesn't work run "dcmake nds_restart_services"

0 votes, average: 0.00 out of 50 votes, average: 0.00 out of 50 votes, average: 0.00 out of 50 votes, average: 0.00 out of 50 votes, average: 0.00 out of 5 (0 votes, average: 0.00 out of 5)
You need to be a registered member to rate this post.
Loading ... Loading ...

Tags:
Categories: Uncategorized

Disclaimer: This content is not supported by Novell. It was contributed by a community member and is published "as is." It seems to have worked for at least one person, and might work for you. But please be sure to test it thoroughly before using it in a production environment.

Comment

RSS