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: <server name="Java Server Name" version ="version #" <plugin type="autoinventory" class="org. hyperic hq- product. jmx. Mx ServerDetector" />
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: <server name="Java Server Name" version ="version #"> ... <plugin type="autoinventory" class="org.hyperic.hq.product.jmx.MxServerDetector"/> ... </server> 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 <service name=" Java Service Name"> <plugin type="autoinventory"/ service> 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 <property name= AUTOINVENTORY_ NAME value="platform. name%%path% Tomcat WebApp String Cache"/> 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: <service name="Java Service Name"> ... <plugin type="autoinventory"/> ... </service> 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: <property name="AUTOINVENTORY_NAME" value="%platform.name% %path% Tomcat WebApp String Cache"/> 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: <properties> <property name="cacheMaxSize" description="Maximum Cache Size"/> </properties> 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 <service name="String Cache server= Sun JvM version= 1.5> property name= OBJECT_NAME <property name="AUTOINVENTORY_NAME value="%platform name% Tomcat String Cache"/> plugin type="autoinventory"/> <plugin type="measurement class="org. hyperic ha. product jmx. MxMeasurementPlugin"/> plugin type="control class="org. hyperic hq. product jmx. Mx ControLPlugin"/> <l-- reset is an MBean operation, set* are attribute setters -> <actions include="reset, setcacheSize, settrainThreshold"/ <properties> property name="cachesize"description="Cache Size"/> <property name="trainThreshold"description="TrainThreshold"/ properties> <filter name=" template value="S[]ECT_NAME]: Salias]"/> <metric name="Availability emplate="S[OBJECT_NAME: Availability indicator="true"/ <metric name="Cache Hits alias=" hitCount collectionType=" trendsup ndicator="true"/ </service> </plugin> tomcat-webapp-cache-plugin. xmL lugin> <servlce namer server ion="1.5"> 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 <plugin> <service name="String Cache" server="Sun JVM" version="1.5"> <property name="OBJECT_NAME" value="Catalina:type=StringCache"/> <property name="AUTOINVENTORY_NAME" value="%platform.name% Tomcat String Cache"/> <plugin type="autoinventory"/> <plugin type="measurement" class="org.hyperic.hq.product.jmx.MxMeasurementPlugin"/> <plugin type="control" class="org.hyperic.hq.product.jmx.MxControlPlugin"/> <!-- reset is an MBean operation, set* are attribute setters --> <actions include="reset,setcacheSize,settrainThreshold"/> <properties> <property name="cacheSize" description="Cache Size"/> <property name="trainThreshold" description="TrainThreshold"/> </properties> <filter name="template" value="${OBJECT_NAME}:${alias}"/> <metric name="Availability" template="${OBJECT_NAME}:Availability" indicator="true"/> <metric name="Cache Hits" alias="hitCount" collectionType="trendsup" indicator="true"/> </service> </plugin> tomcat-webapp-cache-plugin.xml <plugin> <service name="WebApp Cache" server="Sun JVM" version="1.5"> <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=*"/> <property name="AUTOINVENTORY NAME value="%platform name%%path% Tomcat WebApp Cache"/> plugin type="autoinventory"/> plugin type="measurement class="org. hyperic hq. product jmx. MxMeasurementPlugin"/> <l-- set* are attribute setters, the rest are MBean operations--> actions include="setscacheMax Size, unload, lookup, allocate"/> <confid <option name="host description="Host name default="localhost"/> <option name="path description="Path default="/jsp-examples"/: /config <properties> rty name="cache MaxSize"description="Maximum Cache Size"/> </properties> <filter name="template value="S[OBJECT_NAME: Salias"/> <metric name="Availability template="SOBJECT_NAME]: Availability <metric name="Access Coun alias="access Count collectionType="trendsup indicator="true"/> <metric name="Hit Count collectionType="trendsup indicator="true"/> <metric name= Size /service> 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=*"/> <property name="AUTOINVENTORY_NAME" value="%platform.name% %path% Tomcat WebApp Cache"/> <plugin type="autoinventory"/> <plugin type="measurement" class="org.hyperic.hq.product.jmx.MxMeasurementPlugin"/> <!-- set* are attribute setters, the rest are MBean operations--> <actions include="setscacheMaxSize,unload,lookup,allocate"/> <config> <option name="host" description="Host name" default="localhost"/> <option name="path" description="Path" default="/jsp-examples"/> </config> <properties> <property name="cacheMaxSize" description="Maximum Cache Size"/> </properties> <filter name="template" value="${OBJECT_NAME}:${alias}"/> <metric name="Availability" template="${OBJECT_NAME}:Availability" indicator="true"/> <metric name="Access Count" alias="accessCount" collectionType="trendsup" indicator="true"/> <metric name="Hit Count" alias="hitsCount" collectionType="trendsup" indicator="true"/> <metric name="Size" alias="cacheSize"/> </service> </plugin> 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