Video Screencast Help
Backup and Recovery Community Blog

Use The Java Administration Console (GUI) To Learn What Linux/Unix Commands Are Being Run Under The Covers

Created: 14 Feb 2013 • Updated: 14 Feb 2013 • 1 comment
Ryan McCain's picture
+3 3 Votes
Login to vote

When I began learning AIX, I relied heavily on the AIX system administration tool called SMIT (GUI) or SMITTY (menu based). One of the great things about SMIT is when you "point and clicked" to create a user account, configure NFS, etc., SMIT displays the actual Unix commands being executed on the bottom of the SMIT window. This is how I learned the basics of the Unix command line. Over time I was able to do all of my administration from the command line interface (CLI) and not have to rely on SMIT. Understanding what commands were actually being run opened the door for me to write scripts that automated routine tasks, tweaked system performance, etc. etc.

Fortunately, there is a similar feature in NetBackup 7.x.

In order to see the command line operations being run by the Java Admin GUI, perform the following actions:

1. On the system where you are running the Java Admin GUI (likely the master server) go to the java directory.
# cd /usr/openv/java

2. Edit the "Debug.properties" file.
# vi Debug.properties

3. Uncomment "printcmds=true" line.
printcmds=true

Uncommenting printcmds=true will log the command line operations being run to the java log file, /usr/openv/netbackup/logs/bpjava-susvc/log.MMDDYY.

4. Save your changes.

5. Use the tail -f command to view the log file in realtime.
# tail -f /usr/openv/netbackup/logs/bpjava-susvc/log.MMDDYY

As an example, below is the log output of me using the GUI to bring down the /dev/nst20 path on drive HP.ULTRIUM4-SCSI.002:

19:29:03.945 [13278] <2> command_EXEC: currentObj.UserName = ryan.mccain
19:29:05.415 [13278] <2> sanitary_mb_str: String ""/usr/openv/volmgr/bin/vmoprcmd" -h media2 -downbyname HP.ULTRIUM4-SCSI.002 -path /dev/nst20" is considered sanitary.

Next, I'll bring it back up:

19:29:56.635 [13278] <2> command_EXEC: currentObj.UserName = ryan.mccain
19:29:56.635 [13278] <2> sanitary_mb_str: String ""/usr/openv/volmgr/bin/vmoprcmd" -h media2 -upbyname HP.ULTRIUM4-SCSI.002 -path /dev/nst20" is considered sanitary.

Now that you know the command being run, you now have the option of using the command line to bring down and bring up drive paths.

The real beauty of knowing the commands is the ability to script routine tasks. Staying with this example, if you routinely have to bring down drive paths you can create a simple bash script to do it all for you rather than having to point and click over and over again in the Java Admin GUI.

Comments 1 CommentJump to latest comment

TuxanForLife's picture

Great idea, Ryan. I'd done this too. Here is a similar tweak for windows folks: 
  I normally run my java client with as little logging as possible to increase speed and save diskspace. 
 But I sometimes want to find the commands to run manually. 
 So I created two batch files to launch the Java Console - one verbose, one quiet. 

Here's how: 
   1.  Open windows explorer browser to where your Java console lives. For me it is in "C:\Program Files\NetBackup\Java"
   2. copy the file "Debug.properties" to "Debug.properties.verbose"   (and optionally  another copy to "Debug.properties.quiet" 

   3a. In the file "Debug.properties.verbose" 
        Edit / Verify the line "printCmdLines=true"
   3b. In the file "Debug.properties.quiet" 
        Edit / Verify the line "printCmdLines=false" 

   4 Copy nbjava.bat  to   "nbjava_Verbose.bat"   and "nbjava_quiet.bat" 
     4a.  In nbjava_verbose.bat edit the phrase to be 
         -Dvrts.common.utilities.DEBUG_PROPERTIES=Debug.properties.verbose
     4b   In nbjava_quiet.bat, edit the phrase to show 
         -Dvrts.common.utilities.DEBUG_PROPERTIES=Debug.properties.quiet
         

   5. Look for logFile in  setconf.bat 
    I have 
       set nbjLogFileName=jbp.%dyyyy%%dmm%%ddd%%thh%%tmm%%tss%%ths%.log
       set logFile=%NB_INSTALL_PATH%\logs\user_ops\nbjlogs\%nbjLogFileName%
    which puts logs in c:\program files\NetBackup\logs\user_ops\nbjlogs, one per invocation. 
 

 ---
Note: I also changed [  setconf.bat : MAX_MEMORY=   to 2040M ] to let the Java run with more memory since I have 8G on my desktop. I still only allocates 36M initially. 

-1
Login to vote