IDM Driver Status Script



By: robwillcox318

August 31, 2011 5:36 pm

Reads: 431

License:
None

I am working towards implementing IDM 4 into my environment. I found that on one of my servers, the driver had stopped without my knowledge. So I decided to write a bash script to check the status of the driver, restart it if needed, and email whenever the status of the driver changes.

Create the folder /var/opt/novell/scripts Copy the chkdriver.sh script into the directory, edit the variables as indicated in the script (#edit me comment) and set the permissions so it can be executed.

On line 7, that is a reminder note to add the ip address of your SMTP server to the /etc/mail.rc file so the script can send notifications…

#!/bin/bash

admin="admin.tree"    #edit me
password="secret"   #edit me
dxml_driver="driver-name.context.tree"   #edit me

#add "set smtp=smtp.ip.add.ress" to /etc/mail.rc file so the script can send email

email_to="network.admin@mydomain.com"    #edit me
email_body="/var/opt/novell/scripts/idm_driver_status.msg"    #edit me

dxcmd_output=`/opt/novell/eDirectory/bin/dxcmd -user $admin -password $password -getstate $dxml_driver`
dxml_drvstate=$?
case $dxml_drvstate in
	0) #stopped
		echo -n "Driver state 0 - Stopped"
		email_subj="IDM Driver $dxml_driver has STOPPED"
		echo `! date` " - IDM Driver $dxml_driver status: Stopped...  Attempting to restart driver $dxml_driver" >$email_body
		dxcmd_output=`/opt/novell/eDirectory/bin/dxcmd -user $admin -password $password -start $dxml_driver`
		/bin/mail -s "$email_subj" "$email_to" < $email_body
		;;
	1) #starting
		echo -n "Driver state 1 - Starting"
		email_subj="IDM Driver $dxml_driver is STARTING"
		echo `! date` " - IDM Driver $dxml_driver status: Starting...  Please check the server" >$email_body
		/bin/mail -s "$email_subj" "$email_to" < $email_body
		;;
	2) #running
		if grep -q -i running /var/opt/novell/scripts/idm_driver_status.msg
		then
			echo -n "No Change in Driver state 2 - Running"
			echo ""
		else
			echo -n "Driver state 2 - Running"
			email_subj="IDM Driver $dxml_driver is RUNNING"
			echo `! date` " - IDM Driver $dxml_driver status: Running" >$email_body
			/bin/mail -s "$email_subj" "$email_to" < $email_body
		fi
		;;
	3) #stopping
		echo -n "Driver state 3 - Stopping"
		email_subj="IDM Driver $dxml_driver is STOPPING"
		echo `! date` " - IDM Driver $dxml_driver status: Stopping...  Please check the server" >$email_body
		/bin/mail -s "$email_subj" "$email_to" < $email_body
		;;
esac
VN:F [1.9.22_1171]
Rating: 0.0/5 (0 votes cast)

Tags: ,
Categories: Cool Tools, Identity Manager

Disclaimer: As with everything else at NetIQ Cool Solutions, this content is definitely not supported by NetIQ, so Customer Support will not be able to help you if it has any adverse effect on your environment.  It just worked for at least one person, and perhaps it will be useful for you too.  Be sure to test in a non-production environment.

3 Comments

  1. By:geoffc

    LNyiri asks, why not just use the Health Monitoring Job?

    Well for one thing, the Job runs inside the IDM process space. If the IDM process goes down, the Job is down. The IDM process runs inside the ndsd process space. If ndsd goes done, you lose IDM and you lose Jobs.

    I would recommend both. Health job can do more things, and have more insight into the driver health.

    The script is useful to catch driver stoppage from outside the IDM system.

    You should do both.

Comment