2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2024-12-25 12:41:45 +00:00
20 xcatprobe_framework
Weihua Hu edited this page 2016-06-21 16:16:36 +08:00

xCAT Probe Framework

The Directory Structure of xCAT Probe

After installation, xCAT probe is going to work like below:

/opt/xcat/bin/xcatprobe
         |
         /probe/subcmds/xcatmn
               |      |/discover
               |      |/.....
               |
               /lib/perl/xx.pm
                   |   |/xx.pm
                   |   |/.....
                   |/c/xx.c
                   | |/xx.c
                   | |...
                   |/shell/xx.sh
                   |     |/xx.sh
                   |     |/....
                   |/....

How to Maintain xCAT probe in github

In github, All code of xCAT probe are going to maintain like below:

<xCAT_home>/xCAT-probe/xcatprobe
                     |/subcmds/xcatmn
                     |       |/discover
                     |       |/.....
                     |lib/perl/xx.pm
                        |    |/xx.pm
                        |    |/....
                        |/c/xx.c
                        | |/xx.c
                        | |...
                        |/shell/xx.sh
                        |     |/xx.sh
                        |     |/....
                        |/....

The Main Script (xcatporbe)

Responsibility

  • xcatprobe will manage all checking tools uniformly, Loads and triggers checking tools by one way

  • xcatprobe will reformat the output of checking tool to uniform style

  • xcatprobe will connect some solution database, offers solution for failed checking point (a future feature)

Usage

The usage of xcatprobe like below:

Usage:
    xcatprobe -h
    xcatprobe -l
    xcatprobe [-V] <subcommand>  <attrbute_to_subcommand>

Options:
    -h : get usage information of xcatprobe
    -l : list all valid sub commands
    -V : print verbose information of xcatprobe itself
  • The first argument without starting by - in command line will be treated as checking tool name
  • The arguments between xcatprobe and checking tool are treated as arguments of xcatprobe itself
  • The arguments behind checking tool are treated as arguments of checking tool

The Rules Checking Tools Need to Follow

Checking tools can be developed by any language and any contributor. As long as these checking tools follow below rules, they can be loaded and triggered by xcatprobe.

  • The output of checking tool must follow below format:

    [flag] : one line message

    • The valid flag are ok, warning, failed, info and debug.
  • Checking tool must reserve and support one option (-T) for working with xcatprobe.

    • -T: xcatprobe will call checktool -T then it tries to load this checking tool, the output of checktool -T will result in whether xcatprobe loads it or not. The output must follow [flag]:one line message format. The flag is ok. The message will describe what the checking tool is used for, limitation and prerequisite and so on. These message will be display when xcatporbe -l run.