Name

pshealthcheck — ParaStation Healthchecker

Synopsis

pshealthcheck [-c config_path] [-p testsets_path] [-t timeout] [-l ] [-n ] [ -v [-v ]] [ -x [-x ]] [--no-update ] [ --help | -h ] testset

DESCRIPTION

pshealthcheck is a program for running some tests to check the health state of the local node. With each call it runs a configured testset specifying which tests to do.

The configuration of the tests in a testset can be done in to ways:

  • As sections in one of the test configurations files, mostly using one of the prepared check scripts coming with the pshealtcheck distribution.

  • As stand alone test configuration script in one of the testset's configuration scripts directory.

OPTIONS

-c config_path

The path to look for test configurations files (override global configfile)

-p testsets_path

The path to look for testset directories containing test configuration scripts. (override global configfile)

-t timeout

Timeout for the run of the testset in seconds. If the testset does not finish after timeout seconds, the running test is killed and the testset returns immediately reporting an error. (override testset configfile)

-l

Turns on logging via syslog. (Default is to report via STDOUT.)

-v

Increase verbosity.

-x

Extend the testset statistical summary by the name of all tests with warning or error return state. (give -x twice for listing of OK tests)

--no-update

Do not try to update the configuration by running "psconfig update". (Default is to run update.)

--no-action

Activate no-action-mode. Runs tests but never execute any action script.

--dry-run

Activate dry-run-mode. Do not run tests or actions, only check the configuration and report witch tests and actions would run.

testset

Name of the testset to run.

CONFIGURATION

== Testsets ==

A new testset is created by making a new testset directory tree as subtree of one of the directories configured in ${HC_TESTSET_PATH}.

There has to be at least the file testset.conf in the testset directory. An empty testset.conf is supported.

Options in testset.conf:

TS_TIMEOUT

Timeout for the entire testset in seconds (Default: 0 (no timeout))

TS_BREAK

testset break condition (Default: "never")

  • "first": break on first error

  • "never": never break, always run all tests

== Tests ==

Tests can be configured in two ways:

  • Writing a testblock in a test configuration file

  • Putting a test script into the all tests directory and creating a symlink in the testset's tests directory

== Test Configuration Files ==

pshcgetconf(1) looks for test configuration files in all directories given in ${HC_TESTCONF_PATH}. All files found are read one by one in alphabetical order (as done be bash's pathname expansion).



  [ethernet_eth0]
  classes = cs:admin
  testsets = reboot:prologue
  test = /opt/parastation/lib/checks/ethernet eth0 100
  timeout = 10
  killwait = 2

  [md5sum_parastation_cs]
  classes = cs
  testsets = reboot
  test = /opt/parastation/lib/checks/md5sum /etc/parastation/classes/cs/md5sums

  [md5sum_parastation_admin]
  classes = admin
  testsets = reboot
  test = /opt/parastation/lib/checks/md5sum /etc/parastation/classes/admin/md5sums


Parameters:

classes

(mandatory) Connected node classes for this test. (colon separated)

testsets

(mandatory) Testsets containing this test. (colon separated)

test

(mandatory) Command to be executed. Everything right of the equal sign is passed as-is to bash's eval.

timeout

Timeout for the test is seconds. If the timeout is reached before the test returns, it is handled as if it returned an error. (Default: 0 (no timeout))

killwait

Time to wait between SIGTERM and SIGKILL in case the timeout of the test is reached. (Default: 1)

== Testset Directories ==

pshcgetconf(1) looks for testsets in all directories given in ${HC_TESTSET_PATH}. All directories found there are assumed to be testset directories with the subdirectories tests and actions and the file testset.conf.

== Test Scrips ==

Test scripts are very small scripts configuring and doing one test each.



  #!/bin/bash
  #classes cn:admin:node034
  #testname Ethernet_Test
  #timeout 10
  #killwait 2
  /opt/parastation/lib/checks/ethernet eth0 100


Parameters:

#classes

(mandatory) Connected node classes for this test. (colon separated)

#testname

(recommended) Name for the test used in output. (Default: Name of the test script)

#timeout

Timeout for the test is seconds. If the timeout is reached before the test returns, it is handled as if it returned an error. (Default: 0 (no timeout))

#killwait

Time to wait between SIGTERM and SIGKILL in case the timeout of the test is reached. (Default: 1)

Test scripts are executed after the tests defined in the test configuration files. They are meant for easily creating specialized or temporary tests by just dropping in a file to the correct place.

== Actions ==

The actions of a testset are executed as last step of the run. All scripts in the testset's action directory are executed in lexical order. Scripts without the executable bit set as well as those with names matching the regexp (^[^a-zA-Z0-9])|(~$)|(.bak$)|(.orig$)|(.rpmnew$)|(.rpmorig$)|(.rpmsave$) are silently ignored.

The action scripts are executed in an environment with the following variables set:

TESTSET

The name of the testset.

TS_RESULT

The global result of the testset (0=SUCCESS, 1=WARN, 2=ERROR)

TS_COUNT_TOTAL

Total number of tests in the testset.

TS_COUNT_OK

Number of successful tests in the current run.

TS_COUNT_WARN

Number of test with warnings in the current run.

TS_COUNT_ERR

Number of failed tests in the current run.

TS_LIST_OK

List of successful tests in the current run. (", "-separated)

TS_LIST_WARN

List of tests with warning in the current run. (", "-separated)

TS_LIST_ERR

List of failed tests in the current run. (", "-separated)

FILES

/opt/parastation/bin/pshealthcheck

Healthchecker executable

/opt/parastation/bin/pshcgetconf

Script reading the configuration. (pshcgetconf(1))

${PSconfDir}/general/healthcheck.conf

General configuration file for pshealthcheck

${HC_TESTCONF_PATH}/*

Tests configuration files

${HC_TESTSET_PATH}/all/tests/*

All test scripts

${HC_TESTSET_PATH}/all/actions/*

All action scrips

${HC_TESTSET_PATH}/${TESTSET}/tests/*

Symlinks to test scripts to be executed in testset ${TESTSET} in classes given by magic line

${HC_TESTSET_PATH}/${TESTSET}/actions/*

Symlinks to action scripts to be executed after testset ${TESTSET} failed

${HC_TESTSET_PATH}/${TESTSET}/testset.conf

Configuration file for testset ${TESTSET}

SEE ALSO

pshcgetconf(1)

COPYRIGHT

(c) 2009-2010 ParTec CCC GmbH, Munich.