|
Home > Product >
KSM >
Configuration
The KSM follows a simple logic in executing its state machine:
To be more Specific:
To activate KSM, you should at least specify a method to say aloha by setting either ALOHA_URL or ALOHA_CMD. Some directives are marked with supporting "strftime format string", it means the value of these directives will be randered through C funtion strftime (2) at run-time. Take FAIL_EMAIL_TITLE for instance, if the value of FAIL_EMAIL_TITLE is 'KSM Failure at %F %r', the '%F' and '%r' will be replaced with current time according to the format string defined by strftime (2). For example, they become '2004-12-01' and '02:32:54 p.m.'. Besides those directives mentioned above, there are also many other directives can be used to fine tune the run-time behaviors of KSM. Please read the comments in 'ksm.conf' for more details.
A sample 'ksm.conf': # Say aloha by fetching web page of specify URL. # The ALOHA_URL is performed before ALOHA_CMD, if they are both supplied # Example: # ALOHA_URL=http://127.0.0.1/index.html # # Default: (none) ALOHA_URL= # Say aloha by executing a shell command. # The ALOHA_URL is performed before ALOHA_CMD, if they are both supplied # Example # ALOHA_CMD=ping 192.168.0.254 # # Default: (none) ALOHA_CMD= # Check whether the aloha response is valid or not. # A valid aloha response resets the failure instance number to zero. # The ALOHA_CHECK_TRUE is checked before ALOHA_FALSE, if they are both supplied # Example: # The response is not checked # ALOHA_CHECK_TRUE= # # The response should identical to the string "I am fine" # ALOHA_CHECK_TRUE==I am fine # # The response constains the string "virus found" # ALOHA_CHECK_TRUE=virus found # # The response starts with the string "200" # ALOHA_CHECK_TRUE=^200 # # Default: (none) ALOHA_CHECK_TRUE= # Check whether the aloha response is invalid or not. # An invalid aloha response increase the failure instance number by one. # The ALOHA_CHECK_TRUE is checked before ALOHA_FALSE, if they are both supplied # Example: # The response is not checked # ALOHA_CHECK_FALSE= # # The response should identical to the string "I am fine" # ALOHA_CHECK_FALSE==I am fine # # The response constains the string "virus found" # ALOHA_CHECK_FALSE=virus found # # The response starts with the string "200" # ALOHA_CHECK_FALSE=^200 # # Default: (none) ALOHA_CHECK_FALSE= # If an aloha response is not determinded to neither valid nor invalid # by ALOHA_CHECK_TRUE and ALOHA_CHECK_FAILURE, should it be valid or invalid? # Example: # ALOHA_CHECK_DEFAULT=1 # # Default: 1 (valid) ALOHA_CHECK_DEFAULT= # The shell command to be executed when event of a server fail is detected. # Example: # KAAS_START_CMD=/etc/init.d/named start # # Default: (none) KAAS_START_CMD= # Should KSM forks a dedicated child process to run shell command specified # by KAAS_START_CMD. If KSM doesn't fork, KSM will stop and wait the # shell command exits. Set KAAS_START_FORK to YES, if the shell command # of KAAS_START_CMD can't exit successfully. # If KAAS_START_CMD is not set, KAAS_START_FORK has no effects to KSM. # Example: # KAAS_START_FORK=1 # # Default: 1 (YES) KAAS_START_FORK=1 # The maximum execution time in seconds to run a shell command of # KAAS_START_CMD, if KAAS_START_FORK is set to yes. # If CLIENT_GRACEFUL is set, the forked KSM child process will terminate # when specified time limit is reached. Set this value to 0 to cancel it. # If KAAS_START_FORK is not set to YES, CLIENT_GRACEFUL has no effects to KSM. # Example: # CLIENT_GRACEFUL=5 # # Default: 0 (no activated) CLIENT_GRACEFUL=0 # The location of the report file to be mailed when a server failure # is detected. # Example: # KAAS_REPORT_FILE=/var/log/vsftpd.log # # Default: (none) # Support strftime format string: YES KAAS_REPORT_FILE= # The shell command to be executed when when a server failure is detected. # The shell command executed is intended for report generation. # Example: # KAAS_REPORT_CMD= # # Default: (none) # Support strftime format string: YES KAAS_REPORT_CMD= # A delay in seconds between server failure and before executing the shell commands. # The shell commands are specified by KAAS_REPORT_CMD and KAAS_NOTIFY_CMD. # Example: # KAAS_REPORT_DELAY=20 # # Default: 0 (no delay) KAAS_REPORT_DELAY=0 # The shell command to be executed when event of a server fail is detected. # The shell command executed is intended for user defined server failure # notification. # Example: # KAAS_NOTIFY_CMD= # # Default: (none) FAIL_NOTIFY_CMD= # If KAAS_REPORT_FILE is set, the file will be sent to the email address # specified by FAIL_NOTIFY_EMAIL. # Example: # KAAS_NOTIDY_EMAIL=root, webmaster@abc.com, mis@def.net # # Default: (none) FAIL_NOTIFY_EMAIL= # The email title to be used when a notification email is sent. # Example: # KAAS_EMAIL_TITLE=Failure/Event detected # # Default: KSM Failure detected # Support strftime format string: YES FAIL_EMAIL_TITLE=KSM Failure detected # The web page to be fetched when a server failure detected. # Example: # KAAS_START_CMD= # # Default: (none) FAIL_NOTIFY_URL= # The shell command to be executed when event of a server fail is detected # Example: # PERSISTANT_NOTIFY=0 # # Default: 0 (not persistant) PERSISTANT_NOTIFY=0 # Where the log information should be sent to. If USE_SYS_LOG is set to 1, # the information is logged via standard syslog (3). # You can send log messages to both syslog(3) and user defined LOG_FILE. # Example: # USE_SYSLOG=1 # # Default: 1 (YES) USE_SYSLOG=1 # You can specify a file to save KSM log messages. # You can send log messages to both LOG_FILE and syslog(3) via USE_SYSLOG. # Example: # LOG_FILE=/tmp/ksm.log # # Default: (none) LOG_FILE= # The number of continous failure instances to be regarded as a failure event. # Example: # MAX_RETRY=1 # # Default: (none) MAX_RETRY=1 # The number of seconds between each aloha # Example: # KAAS_START_CMD= # # Default: (none) SCAN_INTERVAL=5 # The log message should be dumped on terminal or not. # Example: # VERBOSE=0 # # Default: 0 (don't dump on terminal) VERBOSE=0 |