Tool

jmeldrum's picture
tool
Reads:

5149

Score:
3.4
3.4
5
 
Comments:

1

eDirectory Notification Script

license: 
GPLv2

The eDirectory notification script will allow you to identify when eDirectory goes down on a server. It will notify you either by text message or email. The script will also attempt to restart eDirectory to get it operational.

Installation Instructions:

Note: This script assumes a single instance of a root-based installation of eDirectory so multi-instance and non-root instance functionality will not work. The eDirectory notification script works with both OES2 and OES11.

  1. Download edirnotify.tgz.
  2. Open a Terminal window and type “su”.
  3. Enter root’s password.
  4. Extract the script from the tarball.
    #tar –xzvf edirnotify.tgz
  5. Make the script executable.
    #chmod 755 eDirNotify.sh
  6. Edit one or more of the following variable at the top of the eDirNotify.sh script.
  7. Example: EMAIL_ADDRESS="joe@mycompany.com"
    EMAIL_ADDRESS=""
    	
    Example: TEXT_ADDRESS="8011231234@txt.att.net"
    TEXT_ADDRESS=""
  8. Run the eDir Notify Script now or setup a cronjob to run the script.
    #./eDirNotify.sh -c

Setup Instructions for crontab:

  1. SSH or telnet into the root account.
  2. At the prompt, type in 'crontab -e'. This will open up your crontab file, or create a new one if it doesn't exist.
    When this file opens, you will see other cron jobs listed in here, or if you haven't any - you'll see a bunch of lines with '~' on them.
  3. Use the cursor to go down until you can't move the cursor down any more. This is where you start your new line. Press 'o' to insert a new line.
  4. Press 'o' to insert a new line. If you want to edit a line, press 'i'.
  5. Create a crontab entry that fits your needs and enter at this time.
  6.  Here are some examples:	
    	
    	Set to run every minute of every hour of every day
    	* * * * * /[Location of Script]/eDirNotify.sh > /dev/null
    	
    	Set to run every five minutes of every hour of every day
    	*/5 * * * * /[Location of Script]/eDirNotify.sh > /dev/null
    	
    	Set to run every 30 minutes of every hour of every day
    	*/30 * * * * /[Location of Script]/eDirNotify.sh > /dev/null
  7. Press the 'esc' key to exit out of edit mode.
  8. To save the changes and exit, type the following in: :wq
    If you want to exit without saving changes, type in: :q!
  9. Once you have exited, to view the new entry in your crontab file, type crontab -l in at the prompt. This will list the contents of your crontab file.
AttachmentSize
edirnotify.tgz698 bytes




User Comments

fpatterson's picture

large environment...

Submitted by fpatterson on 5 December 2011 - 7:20am.

If you are running this in a large environment, you will probably only want to run the script once a day on each box. You will want to note the time of day that the cron job is set to start at as you do not want it to start ndsd if it is currently down for maintenance reasons.

So if you run it at 4am, don't have a maintenance window that would have 4am in the time slot. If you want to run it more often, such as every minute or every 5 minutes, remember to disable the cron job when you do maintenance on the box.

Also, you may want to script the code to look to see why ndsd may have stopped. If you do a search in /var/log/messages within the last 24hrs, for ndsd, you would possibly see why it stopped, such as for a segfault. You could also look to see if ndsd generated a core file in the /var/opt/novell/eDirectory/data/dib directory and e-mail that information to the recipient as well.

Great article!

© 2013 Novell