Target release17.1.1
Epic

Document status
Forum Discussion/Reviewhttp://community.pbspro.org/t/pp-758-add-pbs-snapshot-tool-to-capture-state-logs-from-pbs/520/22
Document owner
Designer
Developers
QA


Introduction:

This tool is meant to replace the 'pbs_diag' script which is currently the means to capture data from PBS for diagnostics.

"pbs_snapshot" will be written in Python and will make use of PTL libraries to interact with the PBS system that it is capturing. This will mean that any major changes to PBS will need very minor (if any) refactoring of pbs_snapshot as PTL gets updated in tandem with PBS now, so pbs_snapshot will automatically work with the latest version of PBSPro. 

Also, a new set of utilities (PBSSnapUtils) will be added to PTL itself for this tool, which will be directly available for PTL test writers and developers to write PTL tests/debugging tools which may need the ability to take snapshots of PBS.

The first version of the tool will also come with the ability to anonymize/obfuscate PBS data to enable users with sensitive data to obfuscate and share snapshots for bug reporting and debugging.

Shape and Form of a 'snapshot':

A 'snapshot', which will be the output produced by the pbs_snapshot tool, will be a tarball (.tgz file) containing the following directory structure & files:

Interface Documentation:

The interface for pbs_snapshot will be as follows:

sudo pbs_snapshot [OPTION]

-d <pbs_diag>: diag directory to use as input
-H <hostname>: hostname to operate on. Defaults to the value of PBS_SERVER
-L <num days>: number of days of pbs logs to collect
-l <loglevel>: set log level to one of INFO, INFOCLI, INFOCLI2, DEBUG, DEBUG2,
                      WARNING, ERROR, FATAL
-o <dir>: output directory
--additional_hosts=<hostname>: Also capture logs from additional hosts
                                                        'hostname' is a comma separated list of hostnames to take logs from
--map=<file>: Optional path to filename to store the mapping of obfuscated data
--obfuscate: Obfuscates euser, egroup, project, account_name, hostnames,
                     IP Addressses, PBS dataservice username
                     Deletes mail endpoints, owner, managers, operators, variable_list
                     ACLs, group_list, job name, jobdir
--version: print version number and exit


sudo - Currently pbs_snapshot will need to be run as a user with sudo privileges because it needs to access protected PBS information (e.g - information inside the PBS_HOME/ _priv directories)


Interface: Option -d <pbs_diag>

Interface: Option -H <hostname>

Interface: Option -L <num days>

Interface: Option -l <loglevel>

Interface: Option -o <dir>

Interface: Option --additional_hosts=<hostname>

Interface: Option --map=<file>

Interface: Option --obfuscate

Interface: Option --version

Sample Usage: