Cool Solutions

cleanup_zos.sh

coolguys

By:

July 10, 2008 11:12 am

Reads: 4527

Comments:0

License:
Free

Download cleanup_zos

By Rusty Howell

cleanup_zos.sh is an automated script to uninstall, clean, delete any remains of the ZOS server used for testing purposes. cleanup.sh works with ZOS 1.2 and 1.3. This allows the tester or engineer to quickly clean and remove any trace of the ZOS server package or related packages. It also allows the user to restore keys from an old server.

It is designed to work on Linux systems and is written in bash. cleanup_zos.sh uses Novell Zenworks Linux Management tool (zmd). SLES 10, SLED, and OES have zmd installed on their systems. For other distro’s, manually removing ZOS components is necessary.

Options:

# ./cleanup_zos.sh
Usage: cleanup_zos.sh [OPTIONS]
     -a Deletes All ZOS packages, CIM instances, directories. same as -scypbd
     -b Delete audit database (you must edit cleanup_zos.sh to edit database attributes)
     -c Deletes CIM instances
     -d Deletes all Directories
     -h This help message
     -i [pattern] Installs a YaST pattern
     -p Removes rpms
     -r Restore TLS certificates
     -s Save TLS certificates (default)
     -x Shutdown, Destroy and Delete all XEN instances
     -y Removes YaST patterns

Delete audit database: ( -b option)

In ZOS 1.2, the MySQL DB is the database used for the Audit DB.
In ZOS 1.3, the default DB used for the Audit DB is Postgres.
cleanup.sh can work with either of these databases, but you have to edit cleanup_zos.sh to give the correct values of the audit database.

In case MySQL/Postgres cannot cleanup automatically when the cleanup_zos.sh is called it will ask for the database data interactively to the user and try again.

Fields that need to be edited:

database=POSTGRESQL # Possible values: MYSQL, POSTGRESQL
adminuser=postgres # MySQL Admin: root, PostgreSQL Admin: postgres
adminpasswd=
zosdb=zos_db # Default to database name given by the ZOS installer
zosuser=zos_user # audit database user
host=localhost # host of the database

Delete CIM instances ( -c option)

Used to delete CIM instances (mainly used for XEN virtual hosts) not totally tested

Classes to clean:

OMC_VMBuilderJob
OMC_VMBuilderDispatchJob
OMC_VMBuilderLocalJob
OMC_VMBuilderVirtualSystemCreationData
Novell_VMWHJob

Delete all Directories: ( -d option)

Used to delete all directories used by ZOS.

Directories to delete:

/opt/novell/zenworks
/opt/novell/zenworks
/novell/zenworks
/.novell/zos
/.novell/zoc
/.novell/zos
/apache2/conf.d/zos.conf
/apache2/conf.d/ganglia-auth.conf”

Help message: ( -h option)

Show help

Install a YaST pattern: ( -i option)

Help to install a pattern related to ZOS automatically:

Patterns that can be installed:

zw_mon_server
zw_mon_agent
zw_zos_clients
zw_vm_warehouse
zw_vm_builder
zw_zos_server
zw_zos_agent
zw_orch_config

Remove rpms: ( -p option )

Help to remove all rpms related to zos.

rpms that will be removed using this option:

novell-zenworks-monitor-gmond
novell-zenworks-zos-agent
novell-zenworks-zos-server-data-clients
novell-zenworks-vmbuilder-cli
novell-zenworks-vmbuilder-zosjob
novell-zenworks-monitor-web
novell-zenworks-zos-server-data-jre
novell-zenworks-orch-config-gui
novell-zenworks-vmwarehouse-cimproviders
novell-zenworks-monitor-gmetad
novell-zenworks-orch-config
novell-zenworks-zos-clients
novell-zenworks-vmbuilder-cimproviders
novell-zenworks-zos-server-data-agent
novell-zenworks-vmwarehouse-base
novell-zenworks-zos-java-1.5.0_sun_update11
novell-zenworks-zos-server

Restore TLS certificates: ( -r option)

Restores old TLS certificates generated by old installation of zos server, and backed up using this script when zos cleanup was performed.

Save TLS certificates: ( -s option)

Some times it is desirable to cleanup and reinstall only the ZOS server while leaving the agents running on other machines in the grid. The agents rely on the certificates to communicate with the ZOS server. If the ZOS server’s TLS certificates are changed, the agents will be unable to communicate with ZOS properly. Reinstalling the ZOS server will create a new TLS certificate on the ZOS server.

Backing up and restoring the TLS certificates of the original ZOS server is a good way to keep the zos server and agents communicated happy and running.

This options is enabled by default with the -a flag (when removing all details of zos server). Certificates are saved in /tmp/zos-certs.

Shutdown, Destroy and Delete XEN instances: ( -x option)

Useful for virtual machine host machines where they may have zos templates/clones in running mode.

This will shutdown all virtual machines machines that XEN list with xm li, and then it will destroy and deletes from xm list.

Then it will remove physically the directory/vm from /var/lib/xen/images/

Remove a YaST pattern: ( -y option)

Help to remove a YaST pattern:

Patterns that can be removed using this script:

zw_mon_server
zw_mon_agent
zw_zos_clients
zw_vm_warehouse
zw_vm_builder
zw_zos_server
zw_zos_agent
zw_orch_config

Deletes All ZOS packages, CIM Instances, directories: ( -a option or -scypbd )

This option will go for all the options that this script has to clean zos related stuff ( except -x flag for XEN instances cleanup)

VN:F [1.9.22_1171]
Rating: 0.0/5 (0 votes cast)


Categories: Uncategorized

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.

Comment

RSS