Novell Cool Solutions

ncpopen.sh – Bash Menu driven utility to deal with open file problems on OES servers.



By:

September 4, 2013 11:58 am

Reads:1,471

Comments:1

Score:3.5

Print/PDF

License:
Free

Download ncpopen.tar.gz

Have you ever had troubles tracking down who has an open file on an OES server? Here’s a simple menu driven solution which can help you track down and fix open file problems.

ncpopen.sh utility

Overview:

Bash Menu driven utility to deal with open file problems on OES servers.

Symptom:

Have you ever had troubles tracking down who has an open file on an OES server? Here’s a simple menu driven solution which can help you track down and fix open file problems.

Details:

  • This utility allows you to search all mounted NCP volumes for a specific file or partial name.
  • Display open files by “username”
  • Display all open files on a mounted NCP Volume.
  • Clear all “Not logged in” NLI connections.
  • Search for open files using Linux “lsof” commands.

Install:

  • Copy this ncpopen.sh script to the server and make it executable. I like to copy it to the /root/bin/ directory so when I login as root the utility is available to me no matter what my current working directory is.
  • Once copied to server make sure to change permissions. “chmod 755 ncpopen.sh”
  • Depending on the desired behavior, you may modify the global controls. By default we will prompt to close open files which it finds from the menu driven search results.

USAGE:

## GLOBAL CONTROLS ##
SHOWSTATS=1  ## Whether to show NCP Statistics before Menu. Option: 0=Disable 1=Enable
MOFL=200     ## Maximum Open File List per connection.
CLOSE=1      ## Prompt to Close Open files.  Option: 0=Disable 1=Enable


<< MENU for ncpopen.sh >>

  1) Search for open files via Filename
  2) Open files by Username
  3) Display all open files on a Volume
  4) Clear all Not Logged in NLI connections
  5) Search for open files using Linux lsof
  0) Exit
  
2 votes, average: 3.50 out of 52 votes, average: 3.50 out of 52 votes, average: 3.50 out of 52 votes, average: 3.50 out of 52 votes, average: 3.50 out of 5 (2 votes, average: 3.50 out of 5)
You need to be a registered member to rate this post.
Loading...Loading...

Tags:
Categories: Cool Tools, Open Enterprise Server, Technical

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.

1 Comment

  1. By:gabedoss

    The script would split file names with spaces in the name at the space, so I added the following in the GLOBAL CONTROLS section:
    SAVEIFS=$IFS
    IFS=$(echo -en “\n\b”)

    This changes the default for separator in for loops from space to new line.

    Thanks for the script!

Comment

RSS