lib/sles4sap/sapcontrol.pm

SYNOPSIS

Package containing functions which interact or are related to sapcontrol execution.

sapcontrol

sapcontrol(instance_id=>'00',
   webmethod=>'GetProcessList',
   sidadm=>'pooadm',
   [additional_args=>'someargument',
   remote_execution=>$remote_execution]);

Executes sapcontrol webmethod for instance specified in arguments and returns exit code received from command. Allows remote execution of webmethods between instances, however not all webmethods are possible to execute in that manner. Function expects to be executed from an authorized user (sidadm or root).

Sapcontrol return codes:

RC 0 = webmethod call was successful
RC 1 = webmethod call failed
RC 2 = last webmethod call in progress (processes are starting/stopping)
RC 3 = all processes GREEN
RC 4 = all processes GREY (stopped)

sap_show_status_info

sap_show_status_info(cluster=>1, netweaver=>1);

Prints output for standard set of commands to show info about system in various stages of the test for troubleshooting. It is possible to activate or deactivate various output sections by named args:

sapcontrol_process_check

sapcontrol_process_check(expected_state=>expected_state,
   [instance_id=>$instance_id,
   loop_sleep=>$loop_sleep,
   timeout=>$timeout,
   wait_for_state=>$wait_for_state]);

Runs "sapcontrol -nr <INST_NO> -function GetProcessList" via SIDadm and compares RC against expected state. Croaks if state is not correct.

Expected return codes are:

RC 0 = webmethod call was successfull
RC 1 = webmethod call failed (This includes NIECONN_REFUSED status)
RC 2 = last webmethod call in progress (processes are starting/stopping)
RC 3 = all processes GREEN
RC 4 = all processes GREY (stopped)

get_remote_instance_number

get_instance_number(instance_type=>$instance_type);

Finds instance number from remote instance using sapcontrol "GetSystemInstanceList" webmethod. Local system instance number is required to execute sapcontrol though.