160 likes | 176 Views
Learn practical exercises in SEM including script development, post-processing, pre-processing, interface options, audit logging, and working within a subscriber context.
E N D
Development of Scripts inSysgem Enterprise Manager (SEM)Exercises
Practical Exercises • Simple Display (Agent Script) • Post-processing (filter/modify agent output) • Pre-processing (banner & status bar text) • Interface with Options Cache • Write to Audit log • Work within the context of a Subscriber
Exercise 1(Simple Display - Agent Script) • Using: “Own Library”, create a new SEM Display with “Exercise 1” in the “Title” field on the “General” page • The Display is to have three columns: “Platform”; “Username”; “Profile” • Write an Agent script (on your own platform type) to display two (hard-coded, text) records: Platform = (one of: Windows/UNIX/VMS). Usernames = “User1”; “User2”. Profiles = “Profile1”; “Profile2”.
Exercise 2 (Post-processing - filter/modify agent output) • Copy “Exercise 1” display and rename the copy as “Exercise 2” • Intercept the Agent output in the Post-processing script and reverse who owns Profile1 & Profile2 for User1 and User2 • (User1 = Profile2; User2 = Profile1)
Exercise 3(Pre-processing - banner & status bar text) • Add text to the display banner, to read: “LCH Banner” • Add text to the display status bar, to read: “LCH Exercise - Status”
Exercise 4(Interface with Options Cache) • Write a text file in the Options Cache from the Main Post-processing script: The file is to contain the agent name. • Read that Options Cache file in the start-up script and display the agent name in a read-only start-up field labelled: “Agent last used:”
Exercise 5(Write to Audit log) • Copy Exercise 4 display and rename the copy as Exercise 5 • From the main post-processing script, write an entry in the SAcM Audit Database to show that Exercise 5 completed successfully. • The entry should read: “Exercise 5 successful”,… and it should also show: • the SEM user who started the window, • the agent it was done on • the agent platform type • the SEM users workstation id • the target account name as your own Window’s username • a ‘generated’ Audit Sequence number • Use the SAcM Audit Browser to view the Audit record.
Exercise 6(Work within the context of a Subscriber) • Start the Subscriber DB and select the entry for (Fullname) “Exercise Five Subscriber” • Copy Exercise 5 display, renaming it to “Exercise 6” and add two new columns: Cost Centre CC Manager • In the Main Agent script write values into the Cost Centre and CC Manager fields. • Write a new Menu option “Compare” which operates on ONE selected entry. • In menu script (M) Pre-processing do the following: • Check for a current selected subscriber – if none exit with error • Compare selected subscriber CC & CC Manager fields with selected display record • Write new variables to Agent script giving content of both fields from both records and indicating whether each set matches or not • Write menu script (M) <agent-type> to read new variables and display them in a dialogue box to user showing the four fields & whether each set match each other.
Exercise 7(Menu Option: Modify) • Copy Exercise 6 display, renaming it to “Exercise 7” • Write a new Menu option “Modify” which operates on ONE selected entry • Add input fields for: Platform; Username; Profile; CC; CC Manager • In menu script (I) Windows / Unix / VMS, do the following: Send (hardcoded) new values for each input field to standard output:e.g. print “PR : Profile4\n”; (as if we were reading an account record) • In (M) Fields set the new values into the input form • In (M) Windows / Unix / VMS simply echo back the input fields (as if we had also updated an account) • In (M) Post-processing, suppress the auto-refresh and update the selected record in situ
Exercise 7 (should look like:) 1. 3. 2.