1 / 48

Development of Scripts in Sysgem Enterprise Manager (SEM) & Sysgem Account Manager (SAcM)

Understand the structure of SEM & scripts within SAcM, customize, diagnose problems, support in production.

Download Presentation

Development of Scripts in Sysgem Enterprise Manager (SEM) & Sysgem Account Manager (SAcM)

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Development of Scripts in Sysgem Enterprise Manager (SEM) &Sysgem Account Manager (SAcM)

  2. Goals • To give an understanding of the structure of SEM and the scripts within SAcM • To help you know where to look for information in SEM Non-Goals • To teach everything there is to know about SEM • To teach Perl

  3. By the end of the course you should be able to: • Produce customisations in SAcM. • Enable those customisations to survive an upgrade of SEM. • Diagnose problems encountered by customised scripts. • Introduce and support the customised scripts in a production environment.

  4. Contents • SEM Components • Authorization Server • Authorization Server File Structure • SEM ‘Layers’ of Routines • SEM Options Cache • Database Access in SEM • Development Interface

  5. 1.0 Overview: SEM Components Management Console Authorization Server Managed Agents on Target Systems

  6. 2.0 SEM Authorization Server • SEM User Profiles (for SEM permissions) are held at the SEM AuthServer. • SEM Scripts are held at the AuthServer and loaded into the GUI when a SEM user logs in. • Libraries at the AuthServer are updated as scripts are developed.

  7. 3.0 AuthServer Folder Structure Contains: SAcM Audit Database Home Directories for Users and Script Libraries SAcM Application Databases Cache of Contents of Drop Down Lists Perl Libraries used by SEM SEM Agent & Working Directory SAcM Subscriber Database SEM GUI

  8. 4.0 SEM Routine Layers Perl Scripts. ‘Include File’ sub-routines, included at run-time. (Listed in Appendix C & D) Compiled routines called from scripts.(Listed in Appendix E)

  9. 5.0 SEM Options CacheLocal cache synch’d with central cache Management Console Authorization Server Local cache Central cache SEM OptionsCache SEM OptionsCache Checksum file Checksum file cached files cached files

  10. 5.1 SEM Options Cache Routines • Options_SaveToFile() Options_SaveToFile(“ORACLE”, “Permissions", \@permissionList); • Options_LoadFromFile() @PermissionList = Options_LoadFromFile (“ORACLE”, “Permissions "); • Options_FileExists() if (!Options_FileExists(“ORACLE", “Permissions"))

  11. 6.0 Database Access in SAcM Authorization Server Management Console ODBC Agent SAcM Databases

  12. 6.1 DB Access: Example.SEM Routines to read / write via ODBC • Compiled SEM routines held in Sysgem Perl Librarye.g. Sysgem::ODBCAddRecord() • Perl Subroutine, e.g.: “UMLogAddAccount()”calls: Sysgem::ODBCAddRecord() • UMLogAddAccount()” is held in the SAcM Include file:“SAcM_Logfile” • SEM Include Files are held in a SEM Module Library

  13. 6.2 Example DB Access.(SAcM Audit record) Code within a standard SAcM Script: use Sysgem; #include SAcM_Logfile my $AudSeq = AuditSeqNumber(); UMLogAddAccount($SysgemComputer, $SysgemUsername, $ENTRY_UN, "Exchange2000 mailbox modified", $SERVER_TYPE, $SERVER_NAME, "Audit Seq. No..: $AudSeq", @mods);

  14. 6.3 Example DB Access.(SAcM Audit record) Call to the (compiled) Sysgem library routine from within the ‘included’ routine: UMLogAddAccount() use Sysgem; $status = Sysgem::ODBCAddRecord($db_umlog_dsn, "", $db_umlog_table_actions, \@fields, \@values, $error);

  15. 7.0 Script Logfile Window Set verbose on for debugging (Send, Rcv)

  16. 8.0 SEM Development: Starting to Edit a Display Script With the correct permissions, the “Edit” option appears With the correct SEM permissions, the “Edit” options appear

  17. 8.1 Select a Display (e.g. “Enterprise Accounts”) Double click a display to start the SEM editor

  18. 8.2 Use the Navigation Bar to Navigate between Pages Navigation Bar... Select the “Columns” page

  19. 8.3 The Columns page defines the characteristics of the text shown on a SEM Display Window Note, particularly, the Column Title and Column Code

  20. 8.4 Navigate to the Scripts Page Select “Scripts”

  21. 8.5 Main Display Scripts Target (platform-specific) Scripts Pre- & Post- Processing

  22. 8.6 Main Agent Scripts

  23. Exercise 1 See separate PowerPoint Presentation for details of “Exercise 1” (Simple Display)

  24. 8.7 Post-Processing Script Intercept (& filter) Agent Output # # Replace the output. # print "{{REPLACE_VALUES=YES\n“; # # Load Agent output into input array. # LoadInputArray(); # Agent output now in @input_array foreach $input (@input_array) { …

  25. Exercise 2 See separate PowerPoint Presentation for details of “Exercise 2” (Post-processing - filter/modify agent output)

  26. 8.8 Pre-processing Script # @{{AUTOSTART_DISPLAY_TITLE <Display name here> # # Status Bar # print "\@{{STATUS_BAR_TEXT <status text here>\ \n"; # # Header Banner # print "\@{{ADD_WINDOW_TITLE <banner text here>\n";

  27. Exercise 3 See separate PowerPoint Presentation for details of “Exercise 3” (Pre-processing - banner & status bar)

  28. 8.9 Customer Include Files Most Enterprise Accounts scripts have two lines at the top and bottom similar to these.

  29. 8.10 Editing Customer Include Files

  30. 8.11 Editing Custom Include Files (find: “Main-Script-Post”) #++ # # Main Script Post # # Added .....: 14-Jul-2000 06:35:39 # Platform ..: Windows # #-- @{{CUSTOM_CODE_START(Main-Script-Post) @}}CUSTOM_CODE_START(Main-Script-Post) @{{CUSTOM_CODE_FINISH(Main-Script-Post) @}}CUSTOM_CODE_FINISH(Main-Script-Post)

  31. 8.12 Editing Custom Include Files (insert custom script) #++ # # Main Script Post # # Added .....: 14-Jul-2000 06:35:39 # Platform ..: Windows # #-- @{{CUSTOM_CODE_START(Main-Script-Post) print “Hello World \n”; @}}CUSTOM_CODE_START(Main-Script-Post)

  32. 8.13 VariablesDefinedAutomatically in SEM Scripts • Before a script is run, SEM places variables into the script that describe the environment in which the script runs. • Appendix A to the associated course notes describes these variables.

  33. Exercise 4 See separate PowerPoint Presentation for details of “Exercise 4” (Interface with Options Cache)

  34. 8.14 Menu Options 2. 3. 4. 5. 1.

  35. 8.15 Passing Variables to Agent Scripts # # Insert a line into the agent script from a “Menu Pre-Process” script # print "\@{{ADD_SVR<string to insert>\n"; # # For example… # if ($SERVER_TYPE =~ m/UNIX/) { print "\@{{ADD_SVR echo \"$CC\" \n"; } elsif ($SERVER_TYPE =~ m/VMS/) { print "\@{{ADD_SVR \$ write sys$output \"$CC\" \n"; } elsif ($SERVER_TYPE =~ m/Windows/) { print "\@{{ADD_SVR print \"$SubCC\\n\";\n"; }

  36. Exercise 5 See separate PowerPoint Presentation for details of “Exercise 5” (Write Audit Log)

  37. 8.16 Dialogue Boxes print "\@{{B VMS Username : $INPUT_UN\n"; print "\@{{T The Username field contains an invalid character: \"$val\"\n"; print "\@{{DW\n";

  38. 8.17 Subscriber DB(Tracks Ownership of Accounts) Personal Details Account Pointers Subscriber DB

  39. 8.18 Subscriber DB Window

  40. 8.19 Current SubscriberTest if in context of a “Current Subscriber” & extract field values. if (!exists($Classes{"SAcM Subscriber"}{"BN"}{"value"})) { $fullname = $Classes{"SAcM Subscriber"}{"FN"}{"value"}; }

  41. 8.20 Update Current Subscriber my @fields = (); my @values = (); # # Modify the CC field in the Subscriber record. # push(@fields, "FLD_COST_CENTER"); push(@values, $INPUT_CC); my $error = ""; my $status = 0; # # Build a filter string so that only the selected entry gets # updated. # my $filter = "[FLD_INDEX] = '$ENTRY_BN'"; # # Now update people. # my $error = ""; my $status = Sysgem::ODBCUpdateRecords(DB_DSN, "", DB_TABLE_PERSON, $filter, \@fields, \@values, $error);

  42. 8.21 Add/Remove Account Pointers to Current Subscriber # # Add to current Subscriber database entry. # print "\@{{CUSTOM_CLASS_NAME SAcM Subscriber\n"; print "\@{{CUSTOM_CLASS_ROUTINE Add\n"; print "\@{{CUSTOM_CLASS_DATA Username $INPUT_UN\n"; print "\@{{CUSTOM_CLASS_DATA FullName $INPUT_ON\n"; print "\@{{CUSTOM_CLASS_DATA Server $SERVER_NAME\n"; print "\@{{CUSTOM_CLASS_APPLY\n";

  43. Exercise 6 See separate PowerPoint Presentation for details of “Exercise 6” (Work with Subscriber)

  44. 8.22 Read before Edit (e.g. during a “Modify” menu option) An “Account Modify” transaction could have a form similar to the following simple example: Before the input can be acted upon, the fields of data need to be filled in from the current state of the user account.

  45. 8.23 Suppress Window Refresh after Menu Action, then Modify an Entry in Situ # In the Menu – Post Processing Script… # # Do not refresh the display. # # @{{REFRESH_DISPLAY=NO # # Modify this entry on the display. # print "\@{{DSP_MOD 99 $ENTRY_99\n"; # Index of entry to modify print "\@{{DSP_MOD XX new value\n";

  46. Exercise 7 See separate PowerPoint Presentation for details of “Exercise 7” (Menu Option: Modify)

  47. 8.24 Using “SEM Tasks” as a development aid • Good Environment for writing small subroutines and testing them under the conditions of a SEM Agent. • Rudimentary input forms in a “Task” work similar to forms in a “Display”

  48. 8.25 SEM Task

More Related