logo资料库

Hyperic hqapi 使用手册.pdf

第1页 / 共145页
第2页 / 共145页
第3页 / 共145页
第4页 / 共145页
第5页 / 共145页
第6页 / 共145页
第7页 / 共145页
第8页 / 共145页
资料共145页,剩余部分请下载后查看
About vFabric Hyperic Web Services API
Intended Audience
Introduction to HQApi
Overview of HQApi
Version Compatibility
What HQApi is Good For
User Permissions and HQApi
How to Access HQApi
How to Install HQApi
API Package Contents
HQApi Command-Line Tools
Command-Line Tools Overview
Invoking Command-Line Tools
Common Subcommands
list
sync
delete
Required Command Qualifiers and How to Supply Them
Define a Connection Properties File
Encrypt Hyperic Password
Supply Properties File Path on Command Line
Tips and Reminders for CLI Tools
Sync with Caution
How to Find a Resource ID
HQApi agent command
agent Functionality
agent Command Options
agent list
Structure of an AgentsResponse Element
Content of an Agent Element
agent list Command Qualifiers
agent list Example
agent ping
agent ping Command Qualifiers
agent ping examples
agent transferPlugin
agent transferPlugin Command Qualifiers
agent transferPlugin Examples
agent bundle-list
Structure of an AgentBundleFilesResponse Element
Content of an AgentBundleFile Element
agent bundle-list Command Qualifiers
agent bundle-list Example
agent bundle-status
agent bundle-status Command Qualifiers
agent bundle-status example
bundle-push
agent bundle-push Command Qualifiers
agent bundle-push example
HQApi alertdefinition command
alertdefinition Functionality
Understanding Alert Definition Options
alertdefinition Command Options
alertdefinition list
alertdefinition list Command Qualifiers
Structure of an AlertDefinitionsResponse
Attributes in an AlertDefinitionsResponse
AlertCondition Attributes for Different Condition Types
AlertActionConfig Attributes for Different Action Types
alertdefinition sync
alertdefinition sync Command Qualifiers
alertdefinition delete
alertdefinition create
alertdefinition create Command Qualifiers
alertdefinition Command Examples
alertdefinition list --typeAlerts
AlertCondition Examples
alertdefinition create - based on existing alert definition
alertdefinition create - new alert definition
HQApi alert command
Functionality
alert Command Options
alert list
Structure of an AlertsResponse Element
Attributes in an AlertsResponse
List Examples
List Last n Alerts
List Last n Alerts in Escalation
List Last n Unfixed Alerts
List Alerts that Fired During an Interval
List Unfixed Alerts with Severity Level
alert ack
alert fix
alert delete
HQApi application command
Functionality
application Command Options
application list
Structure of an ApplicationResponse
Attributes in an ApplicationResponse
Example - application list
application sync
Example - Create Applications with application sync
Example - Update Applications with application sync
application delete
HQApi autodiscovery command
Functionality
autodiscovery Command Options
autodiscovery list
autodiscovery list Command Qualifiers
Structure of a QueueResponse
Attributes in a QueueResponse
autodiscovery approve
autodiscovery approve Command Qualifiers
Examples
autodiscovery approve with Regex Qualifier
HQApi control command
Functionality
control Command Options
control actions
control history
control execute
control Command Examples
control actions --resourceId
control history --resourceId
control execute --action --resourceId
control execute --action --resourceId – option
HQApi dependency command
dependency Functionality
dependency Command Options
dependency list
dependency list Command Qualifiers
Structure of ResourcesResponse
Atributes of ResourcesResponse
Structure of ResourceEdgesResponse element
dependency list Examples
dependency list --prototype
Dependency List --name
dependency list --prototype --name
dependency list --children --id
dependency list --children --prototype
dependency list --children --name
dependency list --children --prototype --name
Dependency List --children --id --relation=containment
dependency sync
dependency sync Command Qualifiers
dependency delete
dependency delete Command Qualifiers
dependency select
dependency select Command Qualifiers
HQApi escalation command
Functionality
escalation Command Options
escalation list
escalation list Command Qualifiers
Structure of an EscalationsResponse
Attributes in an EscalationsResponse
escalation sync
Examples
HQApi event command
Functionality
event Command Options
event list
Structure of an EventsResponse
Attributes in an EventResponse Element
event Command Examples
event list --resourceId
Example Event Element for Different Event Types
Event Element for an Alert Event
Event Element for an Control Action Event
Event Element for an Log Event
Event Element for an Configuration Event
HQApi groovyshell command
groovshell Functionality
groovyshell Command Qualifiers
HQApi group command
Functionality
group Command Options
group list
group list Command Qualifiers
Structure of a GroupsResponse
Attributes in a GroupsResponse
group sync
group sync Command Qualifiers
group delete
group delete Command Qualifiers
Examples
group sync via XML
group sync - Create or Update a Compatible Group from Command Line
group sync - Create or Update a Mixed Group from Command Line
HQApi maintenance command
Functionality
maintenance Command Options
maintenance schedule
maintenance unschedule
maintenance get
Examples
Sample Script for Scheduling Recurring Maintenance
Using group_maintenance_api.pl
Set Environment Variables
Schedule Maintenance for a Group
Check Maintenance Schedule
Cancel a Maintenance Schedule
Set Up a Recurring Maintenance Schedule
Use Time Only for Start and End Arguments
Tip - Wrap the Script Invocation
HQApi metric command
Functionality
metric Command Options
metric list
Metric list Command Qualifiers
Structure of a MetricsResponse
Attributes in a MetricsResponse
metric sync
metric reschedule
Examples
HQApi metricData command
Functionality
Command Options
list
list Command Output
list Command Qualifiers
Examples
List Measurements for a Metric
List Measurements for a Resource
List Measurements for a Compatible Group
HQApi metricTemplate command
Functionality
metricTemplate Command Options
metricTemplate list
metricTemplate list Command Qualifiers
Structure of a metricTemplatesResponse
Attributes in a MetricTemplatesResponse
metricTemplate sync
Examples
HQApi resource command
Functionality
resource Command Options
resource list
resource list Command Qualifiers
Structure of a ResourcesResponse
Attributes in an ResourcesResponse
resource sync
resource delete
resource createPlatform
resource createPlatform Command Qualifiers
resource createServer
resource createServer Command Qualifiers
resource createService
resource createService Command Qualifiers
resource move
resource move Command Qualifiers
Examples
List Resources of the Same Type
List Resources of the Same Type Verbosely
Write Resource Data to a File
Update Resource Properties
Delete a Resource
Create a New Platform
Create a New Server
Create a New Service
HQApi resourceprototype command
Functionality
resourceprototype Command Options
resourceprototype list
Attributes in an ResourcePrototype Element
resourceprototype Command Examples
resourceprototype list --existing
HQApi role command
Functionality
Command Options
list
list Command Output
list Command Qualifiers
sync
Samples
role list
role sync
Understanding Role Permissions
Operations List
HQApi serverConfig command
Functionality
serverConfig Command Options
serverConfig get
Structure of a ServerConfigResponse Element
Attributes in an ServerConfigResponse
Example - serverConfig get
Example - Write Results of serverConfig get to a file
serverConfig set
serverConfig getParameter
serverConfig setParameter
Server Configuration Reference
Hyperic Email Configuration Properties
Data Manager Configuration Properties
Global Alert Properties
Notification Throttling Configuration Properties
Automatic Baseline Configuration Properties
LDAP Configuration Properties
Kerberos Configuration Properties
SNMP Properties
Configure HQ Server for SNMP v1
Configure HQ Server for SNMP v2c
Configure HQ Server for SNMP v3
Server Configuration Reference
Hyperic Email Configuration Properties
Data Manager Configuration Properties
Global Alert Properties
Notification Throttling Configuration Properties
Automatic Baseline Configuration Properties
LDAP Configuration Properties
Kerberos Configuration Properties
SNMP Properties
Configure HQ Server for SNMP v1
Configure HQ Server for SNMP v2c
Configure HQ Server for SNMP v3
HQApi user command
Functionality
Command Options
list
list command output
list Command Qualifiers
sync
Examples
user list
user sync
HQApi Java API
vFabric Hyperic Web Services API VMware vFabric Hyperic 4.6.6 VMware vFabric Suite 5.2 VMware vFabric Suite 5.1 VMware vFabric Cloud Application Platform 5.0 This document supports the version of each product listed and supports all subsequent versions until the document is replaced by a new edition. To check for more recent editions of this document, see http://www.vmware.com/support/pubs . EN-000655-00
vFabric Hyperic Web Services API You can find the most up-to-date technical documentation on the VMware Web site at: http://www.vmware.com/support/ The VMware Web site also provides the latest product updates. If you have comments about this documentation, submit your feedback to: docfeedback@vmware.com Copyright © 2012 VMware, Inc. All rights reserved. This product is protected by U.S. and international copyright and intellectual property laws. VMware products are covered by one or more patents listed at http://www.vmware.com/go/patents VMware is a registered trademark or trademark of VMware, Inc. in the United States and/or other jurisdictions. All other marks and names mentioned herein may be trademarks of their respective companies. . VMware, Inc. 3401 Hillview Ave. Palo Alto, CA 94304 www.vmware.com 2 VMware, Inc.
vFabric Hyperic Web Services API Contents 1 2 About vFabric Hyperic Web Services API 7 Intended Audience 7 8 8 Introduction to HQApi Overview of HQApi Version Compatibility What HQApi is Good For User Permissions and HQApi 9 How to Access HQApi 9 How to Install HQApi API Package Contents 9 8 8 8 3 HQApi Command-Line Tools 11 Command-Line Tools Overview Invoking Command-Line Tools Common Subcommands 15 Required Command Qualifiers and How to Supply Them Tips and Reminders for CLI Tools 12 14 17 15 4 5 6 7 HQApi agent command 18 agent Functionality 19 agent Command Options 19 HQApi alertdefinition command 24 25 alertdefinition Functionality Understanding Alert Definition Options alertdefinition Command Options 25 alertdefinition Command Examples 38 25 HQApi alert command 43 Functionality alert Command Options 42 43 HQApi application command 47 Functionality application Command Options 48 48 VMware, Inc. 3
vFabric Hyperic Web Services API 8 9 HQApi autodiscovery command 52 53 Functionality autodiscovery Command Options Examples 53 53 HQApi control command 55 56 Functionality control Command Options control Command Examples 56 57 10 HQApi dependency command 59 60 dependency Functionality dependency Command Options 60 11 HQApi escalation command 68 68 Functionality escalation Command Options Examples 70 68 12 HQApi event command 72 73 Functionality event Command Options event Command Examples 73 75 13 HQApi groovyshell command 79 groovshell Functionality groovyshell Command Qualifiers 78 79 14 HQApi group command 80 81 Functionality group Command Options Examples 83 81 15 HQApi maintenance command 86 87 Functionality maintenance Command Options Examples Sample Script for Scheduling Recurring Maintenance 87 88 88 16 HQApi metric command 91 92 Functionality metric Command Options Examples 93 92 4 VMware, Inc.
vFabric Hyperic Web Services API 17 HQApi metricData command 96 97 Functionality Command Options 97 18 HQApi metricTemplate command 99 100 Functionality metricTemplate Command Options Examples 101 100 19 HQApi resource command 104 105 Functionality resource Command Options Examples 110 105 20 HQApi resourceprototype command 115 116 Functionality resourceprototype Command Options resourceprototype Command Examples 116 116 21 HQApi role command 119 118 Functionality Command Options Samples Understanding Role Permissions 119 120 120 22 HQApi serverConfig command 123 124 Functionality serverConfig Command Options Server Configuration Reference Server Configuration Reference 124 126 133 23 HQApi user command 142 Functionality Command Options Examples 142 141 142 24 HQApi Java API 144 VMware, Inc. 5
vFabric Hyperic Web Services API About vFabric Hyperic Web Services API (see page 7) Introduction to HQApi (see page 8) HQApi Command-Line Tools (see page 11) HQApi agent command (see page 18) HQApi alertdefinition command (see page 24) HQApi alert command (see page 42) HQApi application command (see page 47) HQApi autodiscovery command (see page 52) HQApi control command (see page 55) HQApi dependency command (see page 59) HQApi escalation command (see page 68) HQApi event command (see page 72) HQApi groovyshell command (see page 78) HQApi group command (see page 80) HQApi maintenance command (see page 86) HQApi metric command (see page 91) HQApi metricData command (see page 96) HQApi metricTemplate command (see page 99) HQApi resource command (see page 104) HQApi resourceprototype command (see page 115) HQApi role command (see page 118) HQApi serverConfig command (see page 123) HQApi user command (see page 141) HQApi Java API (see page 144) 6 VMware, Inc.
vFabric Hyperic Web Services API About vFabric Hyperic Web Services API 1 vFabric Hyperic Web Services API and Hyperic HQ configuration and administration processes. It has instructions for running each API from the command-line and introductory information for calling the APIs from Java. documents HQApi, a set of APIs for automating VMware® vFabric™ Hyperic® Intended Audience is intended for Hyperic administrators who to automate Hyperic configuration and vFabric Hyperic Web Services API administration processes, and for developers who want to access Hyperic backend functionality from Java programs. VMware, Inc. 7
vFabric Hyperic Web Services API Introduction to HQApi Topics marked with * relate to features available only in vFabric Hyperic. Overview of HQApi (see page 8) Version Compatibility (see page 8) What HQApi is Good For (see page 8) User Permissions and HQApi (see page 8) How to Access HQApi (see page 9) How to Install HQApi (see page 9) API Package Contents (see page 9) Overview of HQApi 2 HQApi is a set of Java APIs for accessing and updating HQ inventory and related configuration data. You can use the Hthe HQApi to access Hyperic data and resources from the command line, using scripts, or from Java. You can use the API to access platforms, servers, services, groups, escalations, users, and roles. For applicable inventory types, you can use the API to manage default metric collection settings and alert definitions. Version Compatibility Hyperic 4.6.5 ships with HQApi 5.0.0, and is not compatible with prior versions of HQApi. What HQApi is Good For HQApi allows you to circumvent the Hyperic user interface and directly access Hyperic Server functionality. This is useful for streamlining common Hyperic implementation and configuration, for instance, you can use command line tools to perform bulk updates to inventory and configuration data. The Hyperic API also allows you to implement interfaces between Hyperic and other management systems, for instance, you could write a utility that calls the APIs to extract inventory data for import into an asset tracking system. With HQApi you can: create, update, and extract data about platforms, servers, services, groups, create, update, and extract metric collection settings for resource types and individual resources define alerts for resource types and individual resources create and update users, and roles 8 VMware, Inc.
分享到:
收藏