Endpoint Operations Management Agent Plug- in Development Kit vRealize Operations Manager 6.5 VmWare
Endpoint Operations Management Agent Plugin Development Kit vRealize Operations Manager 6.5
Endpoint Operations Management Agent Plug-in Development Kit ou can find the most up-to-date technical documentation on the VMware website at https://docs.vmware.com If you have comments about this docu submit your feedback to docfeedh VMware Inc 3401 Hillview Palo Alto, CA 94304 ww. vmware. com Copyright. 2018 VMware, Inc. All rights reserved. Copyright and trademark information re. Inc
Endpoint Operations Management Agent Plug-in Development Kit VMware, Inc. 2 You can find the most up-to-date technical documentation on the VMware website at: https://docs.vmware.com/ If you have comments about this documentation, submit your feedback to docfeedback@vmware.com Copyright © 2018 VMware, Inc. All rights reserved. Copyright and trademark information. VMware, Inc. 3401 Hillview Ave. Palo Alto, CA 94304 www.vmware.com
Contents About the Endpoint Operations Management Agent Plug-in Development Kit 4 Introduction to Plug-in Development 5 The Role of the Server and Agent in Plug-ins 5 Technical Overview 6 Plug-in Implementations 6 Using Support Classes to Simplify a Plug-in 6 Writing Plug-ins 7 Running and Testing Plug-ins from the Command Line 26 2 Using Auto-Discovery Support Classes in Plug-ins 41 Auto-Discovery Classes 41 Auto-Discovery Interfaces 42 Specifying Auto-Discovery Implementation for a Resource Type 43 Measurement Plug-ins 44 3 Working with Plug-in Descriptors 50 Hierarchy of Managed Object Types 50 Management Functions and Classes for Object Types 51 Inventory and Configuration Data for Object Types 51 Metrics to Collect for Each Object Type 51 Structure of a Plug-in Descriptor 51 Functionality of Plug-in Descriptor Elements 53 4 Plug-In Support Classes 55 Auto-Discovery Support Classes 55 Measurement Support Classes 70 ProductPlugin Class 73 Server Resource Class 73 Service Resource class 8 Config Response Class 80
Contents About the Endpoint Operations Management Agent Plug-in Development Kit 4 1 Introduction to Plug-in Development 5 The Role of the Server and Agent in Plug-ins 5 Technical Overview 6 Plug-in Implementations 6 Using Support Classes to Simplify a Plug-in 6 Writing Plug-ins 7 Running and Testing Plug-ins from the Command Line 26 2 Using Auto-Discovery Support Classes in Plug-ins 41 Auto-Discovery Classes 41 Auto-Discovery Interfaces 42 Specifying Auto-Discovery Implementation for a Resource Type 43 Measurement Plug-ins 44 3 Working with Plug-in Descriptors 50 Hierarchy of Managed Object Types 50 Management Functions and Classes for Object Types 51 Inventory and Configuration Data for Object Types 51 Metrics to Collect for Each Object Type 51 Structure of a Plug-in Descriptor 51 Functionality of Plug-in Descriptor Elements 53 4 Plug-In Support Classes 55 Auto-Discovery Support Classes 55 Measurement Support Classes 70 ProductPlugin Class 73 ServerResource Class 73 ServiceResource Class 80 ConfigResponse Class 80 VMware, Inc. 3
About the Endpoint Operations Management Agent Plug-in Development Kit The Endpoint Operations Management Agent Plug-in Development Kit documents the XML plug-in descriptor that is the basis of every plug-in Endpoint Operations Management supports classes for auto- discovery, measurement, control, and other management functions. It provides information about developing VMware vRealize Operations Manager product plug-ins to manage new object types Intended audience This information is intended for developers who build or customize plug-ins VMware Technical Publications Glossary VMware Technical Publications provides a glossary of terms that might be unfamiliar to you. For definitions of terms as they are used in VMware technical documentation, go to http://www.vmware.com/support/pubs
About the Endpoint Operations Management Agent Plug-in Development Kit The Endpoint Operations Management Agent Plug-in Development Kit documents the XML plug-in descriptor that is the basis of every plug-in. Endpoint Operations Management supports classes for autodiscovery, measurement, control, and other management functions. It provides information about developing VMware vRealize Operations Manager product plug-ins to manage new object types. Intended Audience This information is intended for developers who build or customize plug-ins. VMware Technical Publications Glossary VMware Technical Publications provides a glossary of terms that might be unfamiliar to you. For definitions of terms as they are used in VMware technical documentation, go to http://www.vmware.com/support/pubs. VMware, Inc. 4
Introduction to Plug-in Development Plug-ins are the interface between vRealize Operations Manager and products on the network you want to manage You can develop your own plug-ins to extend the functionality of vRealize Operations Manager coverage to products or parts of products not yet covered. For information about the Endpoint Operations Management source code and the plug-ins provided by VMware, see https://github.com/vmware/ep-ops-management What Plug-ins Do Plug-in development requires an understanding of the vRealize Operations Manager inventory model and of the management functions that plug- ins implement. Management functions can include Auto-Discovery Plug-ins can implement auto-discovery of server resources, services resources, and application resources. Custom plug-ins usually just call the vRealize Operations Manager built-in ServerDetector class Monitoring Plug-ins can implement metric collection, defining and collecting metrics and configuring them for display in the vRealize Operations Manager user interface Measurement plug-ins implement monitoring You can use plug-ins discover, collect data from, and control resources; plug-ins cannot be used to change alerting, reporting, or similar, server-side functionality This chapter includes the following topics The Role of the Server and Agent in Plug-ins Technical Overview Plug-in Implementations sing Support Classes to Simplify a Plug-in Writing Plug-ins Running and Testing Plug-ins from the Command Line The role of the server and Agent in Plug-ins Plug-ins exist on the server and you can download them automatically to the agents
Introduction to Plug-in Development 1 Plug-ins are the interface between vRealize Operations Manager and products on the network you want to manage. You can develop your own plug-ins to extend the functionality of vRealize Operations Manager coverage to products or parts of products not yet covered. For information about the Endpoint Operations Management source code and the plug-ins provided by VMware, see https://github.com/vmware/ep-ops-management. What Plug-ins Do Plug-in development requires an understanding of the vRealize Operations Manager inventory model and of the management functions that plug-ins implement. Management functions can include: Auto-Discovery Plug-ins can implement auto-discovery of server resources, services resources, and application resources. Custom plug-ins usually just call the vRealize Operations Manager built-in ServerDetector class. Monitoring Plug-ins can implement metric collection, defining and collecting metrics and configuring them for display in the vRealize Operations Manager user interface. Measurement plug-ins implement monitoring. You can use plug-ins discover, collect data from, and control resources; plug-ins cannot be used to change alerting, reporting, or similar, server-side functionality. This chapter includes the following topics: n The Role of the Server and Agent in Plug-ins n Technical Overview n Plug-in Implementations n Using Support Classes to Simplify a Plug-in n Writing Plug-ins n Running and Testing Plug-ins from the Command Line The Role of the Server and Agent in Plug-ins Plug-ins exist on the server and you can download them automatically to the agents. VMware, Inc. 5
Endpoint Operations Management Agent Plug-in Development Kit The agent gathers all the data from resources and generally communicates with the resource. Using the plug-in, the agent can: Auto-discover resources Collect resource metrics The server manages metadata, including Platform, server, and service resource types and how the plug-ins targeted resources map to the nventory model The configuration schema for each resource. Technica|。 Overview vRealize Operations Manager plug-ins are self-contained jar or xml files that are deployed on both the server and every agent that you want to run the plug-in. Every plug-in contains, at a minimum, an XML descriptor, which is either a standalone. xml file or embedded in the. jar file Plug-in Implementations Consider measurement, control, and so on, as types of plug-ins. These types of plug-ins can be created for any type of object You write different implementations of plug-in types, depending on the type of object and how it communicates and presents its data. The different implementations are JMX SQL SNMP Using Support Classes to simplify a plug-in vRealize Operations Manager includes a number of support classes that you can invoke in your own plug-ins to abstract and simplify its construction vRealize Operations Manager provides the following support classes Table 1-1. rEalize Operations Manager Support classes When to Invoke the Support Class qmail, Sendmail, Sybase SNMP Squid, Cisco IOS JMX JBoss, WLS, WAS, ActiveMQ, Jetty JDBC MySQL, Postgre SQL, Oracle To gather database system tables metrics
The agent gathers all the data from resources and generally communicates with the resource. Using the plug-in, the agent can: n Auto-discover resources n Collect resource metrics The server manages metadata, including: n Platform, server, and service resource types and how the plug-in's targeted resources map to the inventory model. n The configuration schema for each resource. Technical Overview vRealize Operations Manager plug-ins are self-contained .jar or .xml files that are deployed on both the server and every agent that you want to run the plug-in. Every plug-in contains, at a minimum, an XML descriptor, which is either a standalone .xml file or embedded in the .jar file. Plug-in Implementations Consider measurement, control, and so on, as types of plug-ins. These types of plug-ins can be created for any type of object. You write different implementations of plug-in types, depending on the type of object and how it communicates and presents its data. The different implementations are: n Script n JMX n SQL n SNMP Using Support Classes to Simplify a Plug-in vRealize Operations Manager includes a number of support classes that you can invoke in your own plug-ins to abstract and simplify its construction. vRealize Operations Manager provides the following support classes: Table 1‑1. vRealize Operations Manager Support Classes Category Support Classes When to Invoke the Support Class Scripting qmail, Sendmail, Sybase SNMP Squid, Cisco IOS JMX JBoss, WLS, WAS, ActiveMQ, Jetty JDBC MySQL, PostgreSQL, Oracle To gather database system tables metrics Endpoint Operations Management Agent Plug-in Development Kit VMware, Inc. 6
Endpoint Operations Management Agent Plug-in Development Kit Table 1-1. vRealize Operations Manager Support Classes(Continued) When to Invoke the Supp Win-Perf Counters IIS, Exchange, DS,. NET To gather metrics from an application that surfaces perf counters SIGAR System, Process, Netstat To communicate with an operating ystem SIGAR is HQ,s proprietary OS- P Net Protocols Http Ftp Smtp and so on To communicate with platform services that HQ already has built-in, but you might Vendor Citrix. DB2. VMware Writing Plug-ins While the interface with vRealize Operations Manager plug-ins is straightforward, you also must determine how to retrieve data from a managed resources and how it should appear in the inventory model, and at what level Plug-in Naming Plug-in names must be in the following formats, where PluginName is the name of the plug-in, as specified in the root plugin element of the plug-in descriptor PluginName-plugin jar for a plug-in that contains program or script files in addition to the plug-in XML descriptor. PluginName-plugin xml for a plug-in that consists only of the plug-in XML descripto JMX Plug-in Auto-discovery(called"auto-inventory"within plug-ins)is easily implemented by implementing a vRealize Operations Manager-provided autoinventory plug-in To implement auto-discovery at the server level, you must invoke an autoinventory plug-in with the Mx ServerDetector class within the server tag:
Table 1‑1. vRealize Operations Manager Support Classes (Continued) Category Support Classes When to Invoke the Support Class Win-Perf Counters IIS, Exchange, DS, .NET To gather metrics from an application that surfaces perf counters SIGAR System, Process, Netstat To communicate with an operating system. SIGAR is HQ's proprietary OSindependent API Net Protocols HTTP, FTP, SMTP, and so on To communicate with platform services that HQ already has built-in, but you might want to gather additional metrics from it Vendor Citrix, DB2, VMware Writing Plug-ins While the interface with vRealize Operations Manager plug-ins is straightforward, you also must determine how to retrieve data from a managed resources and how it should appear in the inventory model, and at what level. Plug-in Naming Plug-in names must be in the following formats, where PluginName is the name of the plug-in, as specified in the root plugin element of the plug-in descriptor: n PluginName-plugin.jar for a plug-in that contains program or script files in addition to the plug-in XML descriptor. n PluginName-plugin.xml for a plug-in that consists only of the plug-in XML descriptor. JMX Plug-in Auto-discovery (called "auto-inventory" within plug-ins) is easily implemented by implementing a vRealize Operations Manager-provided autoinventory plug-in. To implement auto-discovery at the server level, you must invoke an autoinventory plug-in with the MxServerDetector class within the server tag: ... ... Endpoint Operations Management Agent Plug-in Development Kit VMware, Inc. 7
Endpoint Operations Management Agent Plug-in Development Kit In the case of service, auto-discovery is supported for custom MBean services, driven by the OBJECT__NAME property. To implement auto-discovery at the service level, invoke the autoinventory plug-in leaving out the class attribute, within a service tag The JMX plug-in uses the MBean Server query Names method to discover a service for each MBean instance. In the case where the OBJECT_NAME contains configuration properties, the properties are auto unfigured By default, auto-discovered service names are composed using the hosting-server name, configuration properties, and service type name. For example myhost Sun JVM 1.5 localhost /jsp-examples WebApp String Cache You can override the naming using the AUTOINVENTORY_ NAME property You can use the configuration properties from the platform, hosting server, and the service itself in the %replacement% strings, resulting in a name such myhost /jsp-examples Tomcat WebApp String Cache Discovering Custom Properties Discovery of Custom Properties is supported using the OBJECT_NAME and MBeanServer getAttribute You define a properties tag with any number of property tags where the name attribute value is that of an MBean attribute property n description="Maximum Cache Size"/ that maps to the following MBean interface method public interface WebAppCacheMBean public int getCacheMaxSize O;
In the case of service, auto-discovery is supported for custom MBean services, driven by the OBJECT_NAME property. To implement auto-discovery at the service level, invoke the autoinventory plug-in, leaving out the class attribute, within a service tag: ... ... The JMX plug-in uses the MBeanServer.queryNames method to discover a service for each MBean instance. In the case where the OBJECT_NAME contains configuration properties, the properties are autoconfigured. By default, auto-discovered service names are composed using the hosting-server name, configuration properties, and service type name. For example: "myhost Sun JVM 1.5 localhost /jsp-examples WebApp String Cache" You can override the naming using the AUTOINVENTORY_NAME property: You can use the configuration properties from the platform, hosting server, and the service itself in the %replacement% strings, resulting in a name such as: "myhost /jsp-examples Tomcat WebApp String Cache" Discovering Custom Properties Discovery of Custom Properties is supported using the OBJECT_NAME and MBeanServer.getAttribute. You define a properties tag with any number of property tags where the name attribute value is that of an MBean attribute: that maps to the following MBean interface method: public interface WebAppCacheMBean { public int getCacheMaxSize(); } Endpoint Operations Management Agent Plug-in Development Kit VMware, Inc. 8
Endpoint Operations Management Agent Plug-in Development Kit Custom MBean Plug-in Examples Here are examples of MBean plugins that you can use to assist you in creating your plug-ins tomcat-string-cache-plugin. xmL property name= OBJECT_NAME plugin type="autoinventory"/> plugin type="control class="org. hyperic hq. product jmx. Mx ControLPlugin"/> property name="cachesize"description="Cache Size"/> tomcat-webapp-cache-plugin. xmL lugin> property name= OBJECT_NAME re. Inc
Custom MBean Plug-in Examples Here are examples of MBean plugins that you can use to assist you in creating your plug-ins. tomcat-string-cache-plugin.xml tomcat-webapp-cache-plugin.xml <property name="OBJECT_NAME" Endpoint Operations Management Agent Plug-in Development Kit VMware, Inc. 9
Endpoint Operations Management Agent Plug-in Development Kit value="Catalina: type=Cache, host**, path=*"/> plugin type="autoinventory"/> plugin type="measurement class="org. hyperic hq. product jmx. MxMeasurementPlugin"/> actions include="setscacheMax Size, unload, lookup, allocate"/> rty name="cache MaxSize"description="Maximum Cache Size"/> Script plug-ins A script plug-in is a plug-in that runs one or more scripts that return process metrics
value="Catalina:type=Cache,host=*,path=*"/> Script Plug-ins A script plug-in is a plug-in that runs one or more scripts that return process metrics. Endpoint Operations Management Agent Plug-in Development Kit VMware, Inc. 10