Using DXCMD in a Script



On a recent project we were using a driver that required a lot of eDirectory restarts. This became a bit of a pain, as the server had 15 or so drivers on it.

Whenever we needed to deploy a new build to test, it was a pain to go to the server, restart eDirectory, and then in iManager or Designer restart all the drivers. (Though in Designer, if you pick the DriverSet icon - the box inside the eDirectory instance box that all the drivers fan off from - you could restart all drivers with a single click.)


dxcmd comes with all IDM installs. It is a Java-based app that talks to IDM. Being Java, it runs on pretty much any platform, and you could probably get it to work on your local workstation as well.

There are some scripts on Cool Solutions (Cool Tools) that wrap dxcmd so that it is ready to be used by a Network Monitoring tool like Nagios to check if drivers are running as well. For example:

Below is a sample dxcmd script for eDirectory on SLES. It restarts eDirectory, then starts a bunch of drivers. You can modify it to fit your environment:

cd /opt/novell/eDirectory/bin
./dxcmd -host -user -password PASSWORD -s
-start "" -start
"" -start "Active" -start "eDirectory" -start
"" -start "VPN" -start
"" -start

First get to the eDirectory tools directory. If you have exported your path, navigating to the directory is not necessary - but it helps it work, regardless.

-host is great. You can run it on one box to talk to drivers on another box. Thus, you could have a stack of these scripts, customized for each server with drivers you need to work on.

-user is obvious - dot notation is used, with no CN= or OU= needed.

-s sends output to the console so you get error messages back. If you have made a typo in the -user or in a driver name, you will usually get a -601 (Object not found) error. 0 is for success, 1 for errors, and so on.

-start "DriverName.In.Dot.Notation" one per driver. Add as few or as many as you need.

To get the rest of the commands, try dxcmd --help to see the rest of the possible options you can script.



How To-Best Practice
Comment List