• No se han encontrado resultados

6.2 Procesos de formación de políticas

6.2.4 El PFP de la asignación y manejo del gasto en educación

Following is the summary of the steps to install Tivoli management agent on discovered nodes. Note that the scripts mentioned in this section are executed automatically by the NetView discovery script if the following conditions are true: 򐂰 The mdefault_password parameter is set to True.

򐂰 All required input is checked and found acceptable. To install Tivoli management agent on discovered nodes:

1. Before starting the actual processing, the system appends the message under all the log files to indicate what time processing was started so that an administrator can start from that point in the log file if any debugging is needed. The message appended in log files is shown in Example 3-7.

Example 3-7 Message in the mlog_eplog log file: Start echo "Script of Endpoint started on " `date` >> $i

Where the $i variable is the name of log file.

2. The script starts execution after collecting the parameter (two fields) with the operating system and file name containing the list of IP addresses (with the user account and password).

3. The system first checks the input parameter passed from the parent script. If any are found to be blank, it creates the following message in the mlog_eplog log file.

Example 3-8 Message in the mlog_eplog log file: Blank parameters

"All parameters are not passed to this script..Please check.">>$mlog_eplog "usage: inv_script_filename [Operating System {NT | UNIX }] [Filename {containing IP Address with user / password}] " >>$mlog_eplog

"Stopping the processing of script..." >>$mlog_eplog

4. It stops the execution of the script and further it checks whether or not $minputfile is present. If it is not present, it stops the execution of the script after creating and appending the following message to mlog_eplog log file.

Example 3-9 Message in the mlog_eplog log file: $minputfile

echo "The parameter Inputfile $minputfile not present..">>$mlog_eplog echo "usage: inv_script_filename [Operating System {NT | UNIX }] [Filename {containing IP Address with user / password}] " >>$mlog_eplog

echo "Stopping the processing of script..." >>$mlog_eplog

5. The system also checks the value of the $mparam_os parameter, and if it does not contain a value of Windows NT, UNIX, or UNKNOWN, the script stops execution after appending the following message to the $mlog_eplog log file.

Example 3-10 Message in the mlog_eplog log file: $mparam_os echo "Acceptable operating systems are NT / UNIX " >>$mlog_eplog echo "Stopping the processing of script..." >>$mlog_eplog

6. After checking and verifying the input parameter, the system checks the operating system parameter value in $mparam_os. If it is UNKNOWN, it is set to NT, because most of the nodes with an operating system value of

UNKNOWN are not enabled with the SNMP agent.

7. The system checks the other input values entered by an administrator, for example, minput_source_ep. It checks the validity of the endpoint using the

wlookup command as follows:

wlookup -r Endpoint $minput_source_ep >>$mlog_eplog 2>>$mlog_eplog

8. If the $minput_source_ep endpoint is not present in the Tivoli Management Region (TMR) endpoint database, the script stops processing after adding the following message to the $mlog_eplog log file.

Example 3-11 Message in the mlog_eplog log file: $minput_source_ep

echo "This endpoint $minput_source_ep does not exists under Endpoint list.." >>$mlog_eplog

echo "Stopping the processing of script..." >>$mlog_eplog

9. If $minput_source_ep is present in the TMR endpoint database, the system checks the status of the endpoint:

wep $minput_source_ep status >>$mlog_eplog 2>>$mlog_eplog

10.If the status is OK (running), it proceeds ;otherwise, it stops processing after appending the following message to the $mlog_eplog log file.

Example 3-12 Message in the mlog_eplog log file: $minput_source_ep not running echo "This endpoint $minput_source_ep is not running. Check & start it before executing the script." >>$mlog_eplog

echo "Stopping the processing of script..." >>$mlog_eplog

11.The system does not proceed if any of the previous input and parameter values are not found in a working or proper status. The system verifies the $minput_source_ep parameter, and the operating system parameter is NT. After this verification, the system continues processing.

12.The system checks the operating system, and if it is NT, the following command is executed to install the Tivoli management agent code:

winstlcf -N $minput_source_ep -g $minput_source_gateway -f $minputfile -Y -R >>$mlog_eplog 2>>$mlog_eplog

Note: Because these nodes mainly pertain to Windows NT, we decided to treat these nodes as Windows NT.

For UNIX operating systems, the following command installs the Tivoli management agent code:

winstlcf -f $minputfile -Y >>$mlog_eplog 2>>$mlog_eplog

13.After this command executes, the message is recorded in the $mlog_eplog log file. The administrator should refer to this log file to see the exact message generated during the installation of the Tivoli management agent code. In the Windows NT Tivoli management agent code, the -R flag reboots the machine.

14.After the Tivoli management agent installation finishes, the system checks each and every node using the wep command to see whether or not the Tivoli management agent is installed successfully. The command to check endpoint registration status is as follows:

wep $mep status >>$mlog_eplog 2>>$mlog_eplog

Where, $mep is the endpoint name (extracted from $minputfile, the first column).

15.If the return code of the previous command is 1 (meaning the endpoint was not found). The $mep value is appended in the $mlog_failed log file. If the return code is 0 (meaning the endpoint successfully registered and is live), the system continues executing task-related steps.

16.The system checks the input value of the $mcheckpol variable. If it is True, the system checks the policy region, task library, and task. If the value of the $mcheckpol variable is False, the system checks for the presence of a policy region, task library, and task. In this case, an administrator must ensure that the correct policy region, task library, and task are present in the TMR; otherwise, an error message will appear.

17.If the value of $mcheckpol is True, the system performs the activities

described in the following sections: “Policy region”, “Task library” on page 38, and “Task” on page 38.

Policy region

The following steps are performed for the policy region:

1. Check and create the policy region (if the policy region name $mpolicy_region is not present). The following command checks this:

wlookup -Lr PolicyRegion $mpolicy_region >>$mlog_eplog 2>>$mlog_eplog 2. If the policy region is not present, it is created using the following command:

wcrtpr $madmin -m ManagedNode $mresource $mpolicy_region >>$mlog_eplog 2>>$mlog_eplog

Example 3-13 Value of $mresource

mresource=" -m ManagedNode -m ProfileManager -m Endpoint -m TaskLibrary" We describe the parameters used with this command in 3.2.1, “Tivoli management agent installation prerequisites” on page 33. The appropriate message is also appended to the $mlog_eplog log file. These messages contain whether it is present, has been created, and so forth.

3. If the policy region was not created successfully, the system returns a message that it could not create the policy region successfully, so the task library or task is not checked or created.

Task library

The following steps are performed for the task library:

1. After the policy region is verified (or created successfully if missing), the task library is checked under the policy region. The following command checks the task library:

wlookup -Lr TaskLibrary $mtask_library >>$mlog_eplog 2>>$mlog_eplog 2. If the task library is not found, it is created using following command: wcrttlib $mtask_library $mpolicy_region >>$mlog_eplog 2>>$mlog_eplog 3. After the task library is created successfully, the verification of the task is

complete. The appropriate message is appended to the $mlog_eplog file during the check or creation of the task library. We explain the variables used in the scripts in 3.2.1, “Tivoli management agent installation prerequisites” on page 33.

Task

The following steps are performed for the task:

1. The following command is executed to check whether the task is present under the task library. We explain the variables used with the task in 3.2.1, “Tivoli management agent installation prerequisites” on page 33.

wgettask $mtask_library $mtask_name >>$mlog_eplog 2>>$mlog_eplog If the task is not present, the task library proceeds with the following steps. 2. First, it checks whether the task file $mtask_file is present. If it is not present,

it creates the file as follows:

echo "hostname>host.out">$mtask_file

3. After the system creates or verifies the $mtask_file file, the task is created using the following command:

wcrttask -t $mtask_name -l $mtask_library -r user -i default $mnode_name $mtask_file >>$mlog_eplog 2>>$mlog_eplog

4. All messages are appended to the $mlog_eplog log file (including error messages) and generated during the execution of the previous command. 5. If the value of the $mcheckpol parameter is False, this action is ignored by the

system.

After the $mcheckpol parameter verification, the system executes the following steps.

6. The NetView command (nvUtil or smartsetutil) returns the IP address of the node, and endpoint installation is performed using this IP address. Up to this point, the endpoint name of the node is registered with the IP address. The endpoint name used to be the host name of the machine (computer name) for various purposes, because of the Dynamic Host Configuration Protocol (DHCP) environment, the IP addresses kept changing). Therefore, changing the endpoint name from the IP address to the computer name is necessary. To do this, a task is executed to retrieve the computer name of the node, and this is copied from the remote endpoint host machine to the managed node server (from where the script is executed). Using the

set_label command, the endpoint name is changed to the computer name: wruntask -t $mtask_name -l $mtask_library -h $mep >>$mlog_eplog

2>>$mlog_eplog

7. This command runs the job at the endpoint level and the host name of the machine is stored in host.out file (as per the $mtask_name file, the command executed is hostname>host.out).

8. The following command copies the host.out file from the endpoint to the server:

wadminep $mep get_file host.out host.out >>$mlog_eplog 2>>$mlog_eplog 9. If the task executes successfully at the endpoint, it creates the host.out file,

which is copied from the endpoint machine to the managed node server. If the task did not executed successfully, the system generates the following message.

Example 3-14 Task not executed successfully message

echo "Task could not be executed on $mep node. It shall be executed once more after 5 minutes." >>$mlog_eplog

10.After the task executes successfully, the host.out file is copied from the endpoint machine to the managed node machine (with the wadminep command, explained in step 8 on page 39).

11.The installation ^M character is associated with the endpoint name. After the endpoint name is set (from the IP address to the host name), this control character (line break) gets attached, resulting in a problem with accessing the endpoint details. To avoid such situations, following command is executed, which removes the control character from the host.out file (only for managed nodes with a UNIX operating system).

Example 3-15 Removing the control character if [ "$mrkos" != "Windows_NT" ] ; then ex host.out<<END

%s/^M//g wq! END fi

Note: Generally, after the installation of the Tivoli management agent code, system is rebooted. For this reason, the task might not be executed successfully. To address this, the script is put to sleep for five minutes (generally, the server will reboot within five minutes). The following message to wait for five minutes (300 seconds) is in the log file: sleep 300

After five minutes, the task executes again, and the return code is checked. If it fails again, the following error message is appended to the $mlog_eplog log file:

echo "Task could not be executed on $mep node second time..Please check..">>$mlog_eplog

At this stage, the system appends the $mep value to the $log_taskfailed log file. This indicates that the endpoint was installed on this node, but the task could not be executed. The administrator needs to look into the cause, and after resolving the issue, initiate the inventory scanning activity.

Note: While copying the script from the UNIX server to the Windows NT server (or visa-versa), the %s/^M//g line breaks into two lines, resulting in an error while executing this command. To avoid this, the administrator must ensure that this command is on a single line only.

12.The endpoint name is changed to the host name of the endpoint: wep $mep set_label -s $minv_ep >>$mlog_eplog 2>>$mlog_eplog

13.At this stage, the value of $mep is appended to the $mlog_success log file. The system generates three types of log files for the endpoint:

– Tivoli management agent could not be installed.

– Tivoli management agent was installed, but the task could not be executed.

– Tivoli management agent installed successfully, and the task was also executed successfully.

In the second and third log files, the endpoint is executed for inventory scanning. This is done with the next script. The $minv_shell variable contains the shell script name of the inventory scan.

14.Along with this script, the endpoint name is passed as a parameter variable. The command to do this is as follows:

sh $minv_shell $minv_ep

Here, $minv_shell is the script name used to perform the inventory scan, and $minv_ep is the endpoint name. Therefore, the inventory details of the $minv_ep endpoint will be scanned.

3.3 Inventory scan on nodes with Tivoli management