psadmin-io / psadmin-plus

A psadmin helper script
MIT License
17 stars 4 forks source link

psadmin-plus

psadmin_plus is a RubyGem helper tool for psadmin. By passing parameters via command line, you can run psadmin actions like start, stop, status, etc. All domains should be contained in a single PS_CFG_HOME. If you use multiple PS_CFG_HOME homes, see the Multi Config Homes section on how to enable support.

Example Usage

Task Command
help psa help
list domains psa list
start all domains psa start
start all web domains psa start web
start hdev web domain psa start web hdev
clear hrdev cache and restart psa bounce app hrdev
check status with PS_CFG_HOME override psa status all all PS_CFG_HOME=/opt/psft/cfg

Setup

gem install

gem install psadmin_plus

Hey, I don't have ruby installed!

git clone

If you don't want to use the gem install, do a git clone install of this repo instead. Then add psadmin-plus/bin to your PATH. This can be helpful when doing development or adjusting psadmin-plus to better fit your needs.

cd ~
git clone https://github.com/psadmin-io/psadmin-plus.git
cd psadmin-plus
export PATH=$PATH:~/psadmin-plus/bin
psa help

Environment Variables

Environment variables are used to control psadmin-plus and psadmin functionality. You can set environment variables in your shell before calling psadmin-plus. You can also set variables in your .psa.conf file. Lastly, you can pass in key value pairs in the trailing arguments you send to psadmin-plus and they will be exported. To pass variables in your arguments, they need to be listed last and you need to provide command, type and domain arguments as well. Example: psa status all all PS_CFG_HOME=/opt/psft/cfg OTHER=value.

Configuration File

You can store the psadmin-plus configuration in a file instead of environment variables.

  1. Create the file ~/.psa.conf
  2. Add your configuration as envVar=value pairs on each line
PS_POOL_MGMT=on
PS_MULTI_HOMES=/opt/oracle/psft/cfg
PS_HEALTH_FILE=host.html

Profile Suggestions

Here are some suggested additions to your bash profile.

Or set PS_PSA_CONF if you want to use a configuration file in a custom location

export PS_PSA_CONF=/u01/app/psa.conf

Features

General

Multi Config Homes

Hooks

Hooks give you the ability to execute custom scripts in the psadmin-plus execution stream. Hook behavior is controlled by PS_HOOKS_* variables, see Environment Variables. You can select what type of scripts will be executed - examples: ruby, bash, powershell. You have the option to run scripts pre or post commands, as well as when using start or stop.

Troubleshooting