HP WebQoS Software manual Sample Program

Page 140

External Measurement API

Sample Program

Sample Program

This sample UNIX program is an example of how the three methods can be used. It prompts for the name of the system to connect to and the measurement name and value to supply to the service level SLO.

To successfully run this program, you must first configure the service level SLO. The measurement name you type in response to the measurement name prompt must match the name you configured for the SLO.

#include <stdio.h> #include <time.h> #include <math.h> #include <stdlib.h>

#include </opt/webqos/include/qosExternMeasApi.h> #define MAX_TOKEN 64

/******************************************************************************

*******************************************************************************

*SOURCE FILE : Test.c

*PURPOSE : A sample test program that invokes the methods in the external

*measurement API and changes the statistic values. It makes the

*following three calls to the API.

*

*1. wqStatus wqCreateConnection(char *hostname, wqSocket *socket):This

*call sets up the connection with the SCI. This method returns an

*integer indicating success or failure.

*

*2. wqStatus wqSendMeasurement(wqSocket socket, char *xmlString): This

*call sends the xml string to the SCI, again returning an integer to

*success or failure.

*

*3. wqStatus wqCloseConnection(wqSocket socket): This call closes the

*connection between the SCI and the API.

*

*******************************************************************************

*******************************************************************************/

void main()

{

char

xmlString[WQ_MAX_XML_STRING_SIZE];

 

char

measName[MAX_TOKEN];

// Measurement Name

140

Appendix B

Image 140
Contents Edition E0801Legal Notices Contents Services, Sites, and Systems Troubleshooting Policy and Rule Descriptions Synopsis Arguments Return Value Sample Program Contents Printing History Page Understanding HP WebQoS Role and Benefits of HP WebQoS Role and Benefits of HP WebQoS Service WebQoS ConceptsRequest Classifications SessionsCapacity Protection SLOs, Thresholds, and Corrective ActionsRole and Benefits of HP WebQoS How WebQoS Fits Into Your Environment WebQoS in Your EnvironmentWebQoS Components WebQoS ComponentsComponent Installed On Description Management SCA ServiceWeb Services SCI ServiceHow WebQoS Fits Into Your Environment Chapter Setup WebQoS Software Installation WebQoS Configuration FilesSCA and Web Server Parameter Web Server ParametersDefault HTTP/1.1 MonitorInterval seconds SCA Parameters SCO Parameters Logging and Tracing Parameters Unix Only URL Encoding Parameters WebQoS setup Script Unix Restarting Individual WebQoS ComponentsRestarting WebQoS Components Unix Restarting WebQoS Components WindowsSingle Server Setup Continue? Multiple Server Setup Server 1 Setup Servers 2 and 4 Setup Server 3 Setup Opt/webqos/install/setup -r Removing WebQoSWebQoS setup Script Unix Chapter Management Console Management Console Login WebQoS Login Dialog BoxWindow Area Description Console Main ScreenManagement Console Main Screen Console Main Screen Services/Systems View Auto DiscoveryConsole Administration PasswordDomain Management Console Administration Chapter Templates Preconfigured Templates Preconfigured and Default TemplatesDefault Templates Service Template DescriptionFor the service template Service Template StatisticsService Statistics StatisticsURL Group Statistics Service Template SLOs SLOsAdd/Edit Service Level Objectives Add/Edit SLOsAdd/Edit Corrective Actions Service Template Advanced AdvancedDefer Defer Corrective ActionRedirect Redirect Corrective ActionReject Reject Corrective ActionSite Template 10 Site Template DescriptionClassification Rules 11 Site Template Classification RulesAdd/Edit Classification Rules 12 Add/Edit Request Classifications Rules13 Site Template SLOs Add/Edit SLOs 15Add/Edit Corrective Actions Threshold Policies 16 Site Template Threshold PoliciesAdd/Edit Threshold Policies 17 Add Thresholds Dialog Box18Add/Edit Corrective Actions 19 Edit Site Configuration Advanced Dialog Box Session Timeouts 20 Site Advanced Session Timeouts Dialog BoxWeb Server Accept Threads Corrective Action Policy Details22 Defer Corrective Action 23 Redirect Corrective Action 24 Reject Corrective Action Site Statistics 25 Site Template StatisticsSite Template Site Template Chapter Services, Sites, and Systems Services Add a ServiceEdit a Service Move a ServiceDelete a Service Sites Add a SiteEdit a Site Move a SiteDelete a Site Microsoft IISIPlanet Web Server Starting and Stopping IISDelete a System SystemsAdd a System Systems Systems Chapter Statistics Service Statistics Service SLO Related StatisticsService SLO Related Statistics Service Session Control Statistics Service Session Control StatisticsService Defer Related Statistics Service Defer Related StatisticsSite Statistics Site StatisticsSite SLO Related Statistics Site SLO Related StatisticsSite Session Control Statistics Site Session Control StatisticsSite Statistics Site Statistics Chapter Logs and Filters SLOs, Thresholds, and the History Log Service Level Objectives ViewService Level Objectives View SLOs, Thresholds, and the History Log History Log View History Log View SLO and Threshold Filters SLO and Threshold FiltersSLO Filters History Log Filter History Filters DialogChapter 103 Site Measurements Service and Site StatisticsOpenView Logs Policy and Corrective Action Events Field Values Chapter 107 108 Troubleshooting Shared Memory Troubleshooting on UnixManagement Console Error Messages Error Logging and Tracing Logging TracingMeasurement Logging Statistics LoggingChapter 113 Resetting the Management Console Password Troubleshooting on WindowsProblems with Shared Memory Error Messages Viewable From the Management Console Logging and Tracing Registry Editor Window for WebQoS Deleting WebQoS Log and Trace Files118 Policy and Rule Descriptions Request Classification Rules Appendix a 121 Service Level Objectives for Site Policies Set in WebQoSService Level Objectives for the Service Threshold Policy Corrective Actions for SLO and Threshold Policy ViolationsCustomizing the Defer and Reject Web Pages 126 Appendix a 127 Request to be retried see Figure A-2 Figure A-2 Example of Custom Defer Page with LinkAppendix a 129 Expired see Figure A-3 Figure A-3 Example of Custom Defer Page with Popup DialogAppendix a 131 132 External Measurement API Using the External Measurement API Appendix B 135 WqCreateConnection SynopsisArguments Return ValueWqSendMeasurement Values in the following formatReturn Values Status WqCloseConnection Connection with WebQoS has been closedSample Program Appendix B 141 142 Glossary Class See request classification rule144 145 146 Index 148 149 150
Related manuals
Manual 182 pages 33.13 Kb Manual 43 pages 2.68 Kb