Scroll to navigation

pat(1) Supportconfig Analysis Manual pat(1)

NAME

pat - Pattern Tester for Supportconfig Analysis Patterns

SYNOPSIS

pat pattern_filename [pattern options]

DESCRIPTION

A tool used to test and maintain SCA patterns. Generally you change to the directory where the pattern being tested resides. Run pat followed by the pattern filename you are testing. pat will test the pattern file contents as well as run the pattern against the archives extracted in the /var/log/archives directory. You can change the default /var/log/archives location by setting the ARCHDIR environment variable. pat will report the pattern's severity level for each of the archives tested.

OPTIONS

-h for help is the only startup option pat has. All other startup options are for the pattern file itself, and follow the pattern filename being tested.

ERRORS

Patterns will be rejected for check in if there are any fatal errors.

Patterns should not return an exit status. Any non-zero exit status returned by pat is assumed to be from the pattern. If you get a non-zero exit status when running pat, you have a scripting or configuration error in your pattern.
Each pattern file should be marked executable so the shell and the SCA Appliance can run it. Run chmod 755 /path/to/pattern/file to change the permissions.
The output string must follow the convention:

META_CLASS=<string>|META_CATEGORY=<string>|META_COMPONENT=<string>|PATTERN_ID=<pattern_filename>|PRIMARY_LINK=META_LINK_<TAG>|OVERALL=[0-5]|OVERALL_INFO=<message string>|META_LINK_<TAG>=<URL>[|META_LINK_<TAG>=<URL>]

The output string is case sensitive and order dependent.

Each pattern must have a valid hash pling on the first line of the file. There can be no space preceeding the hash and it must be on the first line. For example, #!/bin/python.

ENVIRONMENT

Set ARCHDIR in your environment to overide the default archive directory. The ARCHDIR directory should contain all of the extracted supportconfig tar balls you wish to test against.

The default ARCHDIR location is /var/log/archives.

EXAMPLES

1. Copy and extract supportconfig archives with which you will test into /var/log/archives

2. pat net-check.py

3. All extracted archives in /var/log/archives will be used when testing your pattern

ARCHDIR=/var/log pat mpio-00001.py
export ARCHDIR=/tmp

pat mpio-00001.py

export ARCHDIR=/mnt/spr/scc_sles15_sp3_x86_64_default_any

pat net-00002.pl

AUTHOR

Jason Record <jason.record@suse.com>

COPYRIGHT

Copyright (C) 2014-2021 SUSE LLC

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, see <http://www.gnu.org/licenses/>.

2014 Jan 03 pat