Skip to main content
Matrix42 Self-Service Help Center

Running the scripts on Unix/Linux

Running the scripts as a root user

To execute the data collection scripts on Unix/Linux systems:

  1. Place the M42DataCollectionUnix directory including all its files in any folder on the target systems.
  2. Ensure that the owner of the directory is root.
  3. Ensure that the access rights for the directory, incl. subdirectories is set to 700 (rwx------).
  4. Run the following command as user root:
# cd <path>/M42DataCollectionUnix/bin
# ./M42DataCollection.sh

Running the script will generate files and put them in the M42DataCollectionUnix/results directory. In addition, a compressed <hostname>. tar file with contents of the output directory will be created.  This resulting <hostname>. tar file must be collected for each server system.

Running the scripts as a standard user using sudo

For security reasons it is not recommended to use the root account. A safer approach is to run the scripts and commands as a regular user and then use sudo to run commands with elevated privileges. This feature is supported for Linux and Solaris systems.

To enable the execution with sudo as a non-root user, do the following:

  1. Set the UseSudo variable in the M42DataCollection.env (or the M42DataCollection_SunOS.env file for Solaris) file to 1:
UseSudo=1
  1. Create a text file under /etc/sudoers.d/ (e.g. /etc/sudoers.d/matrix) with the following content:
matrix ALL = (oracle) NOPASSWD: ALL 
matrix ALL = NOPASSWD: /usr/bin/ls, /usr/bin/pwdx, /usr/bin/strings, /usr/sbin/dmidecode, /sbin/dmidecode

For Solaris use the following instead:

matrix ALL = (oracle) NOPASSWD: ALL 
matrix ALL = NOPASSWD: /usr/bin/ls, /usr/bin/pwdx, /usr/bin/pargs, /usr/sbin/ldm, /usr/sbin/virtinfo, /usr/sbin/prtdiag

"matrix" is in this case the user who executes the DataCollection and "oracle" is the (linux) user who runs the database (also known as the process owner of the pmon process).

  1. Execute the script:
# cd <path>/M42DataCollectionUnix/bin
# ./M42DataCollection.sh

Using sudo alternatives

If you don't want to use the standard "sudo" binary, you can define an alternative in the M42DataCollection.env file (or the M42DataCollection_SunOS.env file for Solaris):

SudoAlternative=dzdo

You can either define a binary represented by the absolute path or you can specify the variable as a binary which is available through the defined $PATH variable.     

  • Was this article helpful?