Endpoint Operations Management Agent Plug-in Development Kit sendmail Plug-in Descriptor <?xml version= 1.0 ? <!DOCTYPE plugin <IENTITY multi-process-metrics SYSTEM/pdk/plugins/multi-process-metrics xmL NOTE: This copyright does *not* cover user programs that use HQ program services by normal system calls through the application program interfaces provided as part of the Hyperic Plug-in Deve lopment Kit or the Hyperic Client Deve lopment Kit this is merely considere normal use of the program, and does *not* fall under the heading of derived work Copyright (o [2004-2008], Hyperic, Inc This file is part of HQ HQ is free software; you can redistribute it andyor modit it under the terms version 2 of the gNu general public license as published by the Free Software Foundation. This program is distribute in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABIlITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details You should have received a copy of the GNU General Public License llong with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 <plugin> <l-- extracted to: pdk/work/scripts/sendmail/hg-sendmail-stat -- <script name="hq-sendmail-stat"> <I [CDATAL #!/bin/sh #1 LnUx msgdir="/var/spool/mqueue"&& premsgdir="/var/spool/clientmqueue solaris msgdir="/usr/spool/ mqueue"&& premsgdir="/usr/spool/clientmqueue If the mqueue dir doesn't exist, exit 1 May not have permission to cd to the mqueue, make sure stdout/err don't get echo 'd
sendmail Plug-in Descriptor <?xml version="1.0"?> <!DOCTYPE plugin [ <!ENTITY multi-process-metrics SYSTEM "/pdk/plugins/multi-process-metrics.xml"> ]> <!-- NOTE: This copyright does *not* cover user programs that use HQ program services by normal system calls through the application program interfaces provided as part of the Hyperic Plug-in Development Kit or the Hyperic Client Development Kit - this is merely considered normal use of the program, and does *not* fall under the heading of "derived work". Copyright (C) [2004-2008], Hyperic, Inc. This file is part of HQ. HQ is free software; you can redistribute it and/or modify it under the terms version 2 of the GNU General Public License as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. --> <plugin> <!-- extracted to: pdk/work/scripts/sendmail/hq-sendmail-stat --> <script name="hq-sendmail-stat"> <![CDATA[ #!/bin/sh # linux / aix [ -d "/var/spool/mqueue" ] && msgdir="/var/spool/mqueue" && premsgdir="/var/spool/clientmqueue" # solaris [ -d "/usr/spool/mqueue" ] && msgdir="/usr/spool/mqueue" && premsgdir="/usr/spool/clientmqueue" # If the mqueue dir doesn't exist, exit 1 [ -z "$msgdir" -o ! -r "$msgdir" ] && exit 1 # May not have permission to cd to the mqueue, make sure # stdout/err don't get echo'd Endpoint Operations Management Agent Plug-in Development Kit VMware, Inc. 16
Endpoint Operations Management Agent Plug-in Development Kit cd Smsgdir> nulL 2>&1 ["s?"!="θ exit 1 count msgs in sendmail mqueue dir. Do NOT use find since it may fail when there are lots of files messfiles-'ls 2>/dev/null I wc - premessfiles=O if[ l-z "Spremsgdir"]&&[-dspremsgdir"]&&[-rSpremsgdir] [cd Spremsgdir >/dev/null 2>&1]&&[5? =0"]&& premessfiles="ls 2>/dev/null I wc - echo MessagesInQueue=Smessfiles echo MessagesAwaitingPreprocessing-Spremessfiles exit e <script> <server name= Sendmail version= 8x"> property name= ORY ID vaLt dmail"/ <I-- hardwire this cosmetic to universal location -- <property name="INSTALLPATH" value="/usr/sbin/sendmail"/ description="Process Quer default="State Name. eq=sendmail, state Name Pne=sl, CredName User eq=root"/ description="Type " sudo" To Avoid Having Agent As Root default="/> <I--notifies the plugin to auto-discover one instance of each service--> <property name="HAS_BUILTIN_ SERVICES value="true"/> property name="PROC_QUERY value="State Name eq=sendmail"/> plugin type= class="org. hyperic hq. product. Daemon"/ plugin type="measurement class="org. hyperic hq. product. MeasurementPlugin"/ <metric name="Availability' lias="Availability template="sigar: Type=ProsTate, Arg=process query%: State
cd $msgdir > /dev/null 2>&1 [ "$?" != "0" ] && exit 1 # count msgs in sendmail mqueue dir. DO NOT use find since it # may fail when there are lots of files messfiles=`ls 2>/dev/null | wc -w` premessfiles=0 if [ ! -z "$premsgdir" ] && [ -d "$premsgdir" ] && [ -r "$premsgdir" ] then [ `cd $premsgdir > /dev/null 2>&1` ] && [ "$?" = "0" ] && premessfiles=`ls 2>/dev/null | wc -w` fi echo MessagesInQueue=$messfiles echo MessagesAwaitingPreprocessing=$premessfiles exit 0 ]]> </script> <server name="Sendmail" version="8.x"> <property name="INVENTORY_ID" value="sendmail"/> <!-- hardwire this cosmetic to universal location --> <property name="INSTALLPATH" value="/usr/sbin/sendmail"/> <config> <option name="process.query" description="Process Query" default="State.Name.eq=sendmail,State.Name.Pne=$1,CredName.User.eq=root"/> <option name="exec" description="Type "sudo" To Avoid Having Agent As Root" default=""/> </config> <!--notifies the plugin to auto-discover one instance of each service--> <property name="HAS_BUILTIN_SERVICES" value="true"/> <property name="PROC_QUERY" value="State.Name.eq=sendmail"/> <plugin type="autoinventory" class="org.hyperic.hq.product.DaemonDetector"/> <plugin type="measurement" class="org.hyperic.hq.product.MeasurementPlugin"/> <metric name="Availability" alias="Availability" template="sigar:Type=ProcState,Arg=%process.query%:State" Endpoint Operations Management Agent Plug-in Development Kit VMware, Inc. 17
Endpoint Operations Management Agent Plug-in Development Kit category="AVAILABILITY nd units="percentage collectionType="dynamic"/ <service name= "Message Submission Process"> <config> option name="user default="smmsp description="Sendmail Message Submission Process User"/> option a process query default="State Name. eqssendmail, CredName. User. eq=guser% description="PTQL for Sendmail Message Submission Process"/ </config> <metric name="Availability template="sigar: Type= MultiProcCpu, Arg=%process query: Processes indicator="true"/ &multi-process-metrics service> <service name="Root Daemon Process"> plugin type="autoinventory"/> <option name="process. query default="State Name. eq=sendmail, State. Name. Pne=Sl, CredName User eq=root description="PTQL for Sendmail Root Daemon Process"/> </config> lability template="sigar: Type=MultiProcCpu, Arg=%process query%: Processes indicator="true"/ &multi-process-metrics <I-- sendmail-stat metrics -- <filter name=" template alue="exec: file=pdk/work/scripts/sendmail/hg-sendmail-stat, exec=exec%: Salias"/> <metric name="Messages In Queue indicator="true"/> <metric name="Messages Awaiting Preprocessing indicator="true/ <!一 protocol services+ metrics→> description="SMTP Post option name="hostname description="SMTP Hostname efault="localhost"/> </config>
category="AVAILABILITY" indicator="true" units="percentage" collectionType="dynamic"/> <service name="Message Submission Process"> <config> <option name="user" default="smmsp" description="Sendmail Message Submission Process User"/> <option name="process.query" default="State.Name.eq=sendmail,CredName.User.eq=%user%" description="PTQL for Sendmail Message Submission Process"/> </config> <metric name="Availability" template="sigar:Type=MultiProcCpu,Arg=%process.query%:Processes" indicator="true"/> &multi-process-metrics; </service> <service name="Root Daemon Process"> <plugin type="autoinventory"/> <config> <option name="process.query" default="State.Name.eq=sendmail,State.Name.Pne=$1,CredName.User.eq=root" description="PTQL for Sendmail Root Daemon Process"/> </config> <metric name="Availability" template="sigar:Type=MultiProcCpu,Arg=%process.query%:Processes" indicator="true"/> &multi-process-metrics; </service> <!-- sendmail-stat metrics --> <filter name="template" value="exec:file=pdk/work/scripts/sendmail/hq-sendmail-stat,exec=%exec%:${alias}"/> <metric name="Messages In Queue" indicator="true"/> <metric name="Messages Awaiting Preprocessing" indicator="true"/> <!-- protocol services+metrics --> <service name="SMTP"> <config> <option name="port" description="SMTP Post" default="25"/> <option name="hostname" description="SMTP Hostname" default="localhost"/> </config> Endpoint Operations Management Agent Plug-in Development Kit VMware, Inc. 18
Endpoint Operations Management Agent Plug-in Development Kit <filter template e="SMTP: hostname=%hostname%, port=%port%: Salias]"/> <metric Availability indicator="true"/> <metric name="Inbound Connections indicator="true"/> <metric name=" Outbound Connections ndicator="true"/ /service> < Plugin Help <he lp name="Sendr < [CDATAD h3>Configure HQ for monitoring Sendmail</h3 This plugin needs sudo access as root in order to access the appropriate To configure sudo (in /etc/sudoers) Cmnd_Alias HQ_SENDMAIL_STAT -< hqdir> /agent/ pdk/work/scripts/sendmail/hq-sendmail-stat < agentuser> ALL- NOPASSWD: HQ_SENDMAIL_STAT </help> <he lp name="Sendmail 8.x" include="Sendmail"/> </plugin> SNMP Plug-in SNMP is the standard protocol for monitoring network-attached devices, which is leveraged by several bundled plug-ins and made easy by the Plug-in Development Kit The bundled netdevice plug-in provides a generic network device platform type that can be used to monitor any device that implements IF-MIB (rfc2863)and IP-MIB (rfc4293) The Network Host platform type extends Network Device with support for HOST-RESOURCES-MIB (rfc2790). The Cisco platform also extends Network Device, adding metrics from CISCO-PROCESS-MIB and CISCO-MEMORY-POOL-MIB The Cisco PIXOS platform extends Cisco lOS, adding metrics from CISCO-FIREWALL-MIB In any vRealize Operations Manager plug-in, there are two main concepts to understand The Inventory Model Resource types define where things live in the hierarchy along with supported metrics, control actions, log message sources, and so on, as well as the configuration properties used by each feature
<filter name="template" value="SMTP:hostname=%hostname%,port=%port%:${alias}"/> <metric name="Availability" indicator="true"/> <metric name="Inbound Connections" indicator="true"/> <metric name="Outbound Connections" indicator="true"/> </service> </server> <!-- ==================== Plugin Help =========================== --> <help name="Sendmail"> <![CDATA[ <p> <h3>Configure HQ for monitoring Sendmail</h3> </p> <p> This plugin needs sudo access as root in order to access the appropriate <br> Sendmail dirs. <br> To configure sudo (in /etc/sudoers): <br> Cmnd_Alias HQ_SENDMAIL_STAT = <hqdir>/agent/pdk/work/scripts/sendmail/hq-sendmail-stat <br> <agentuser> ALL = NOPASSWD: HQ_SENDMAIL_STAT </p> ]]> </help> <help name="Sendmail 8.x" include="Sendmail"/> </plugin> SNMP Plug-in SNMP is the standard protocol for monitoring network-attached devices, which is leveraged by several bundled plug-ins and made easy by the Plug-in Development Kit. The bundled netdevice plug-in provides a generic network device platform type that can be used to monitor any device that implements IF-MIB (rfc2863) and IP-MIB (rfc4293). The Network Host platform type extends Network Device with support for HOST-RESOURCES-MIB (rfc2790). The Cisco platform also extends Network Device, adding metrics from CISCO-PROCESS-MIB and CISCO-MEMORY-POOL-MIB. The Cisco PIXOS platform extends Cisco IOS, adding metrics from CISCO-FIREWALL-MIB. In any vRealize Operations Manager plug-in, there are two main concepts to understand: The Inventory Model Resource types define where things live in the hierarchy along with supported metrics, control actions, log message sources, and so on, as well as the configuration properties used by each feature. Endpoint Operations Management Agent Plug-in Development Kit VMware, Inc. 19
Endpoint Operations Management Agent Plug-in Development Kit In the case of implementing a custom SNMP plug-in for a network device, you are typically defining a platform type that collects any scalar variables that apply to the device and one or more service types to collect table data such as interfaces, power supplies, fans, and so on The Metric Template The metric template attribute which is a string containing all the information Attribute required to collect a specific data point. In an SNMP plug-in, each of the metrics correlate to an SNMP OID. Although the object names are frequently used to gather the required data points in the plug-ins, you can also use the numeric OlD. This has the added benefit of negating the need to the MIB file anywhere that the plug-in is used Implementing a new SNMP-based plug-in for vRealize Operations Manager starts with locating the device vendor's MIB files and selecting which OIDs to collect as metrics in vRealize Operations Manager JMX-Based Management provides support for managing and monitoring JMX-enabled applications vRealize Operations Manager has a number of built-in plug-ins that monitor specific JMX products including Sun JVM15 Active MQ 4.0 Geronimo 1.0 Resin 3.0 JOnAS 4.7 vreaLizeOPerationsManagerusestheremoteApi(Http://www.jcporg/en/jsr/detail?id=160)specifiedby JSR-160 to manage products that support JMX 1.2/JSR-160, including the ones listed above. For JMX enabled servers that do not support JSR-160, vRealize Operations Manager uses vendor-specific vRealize Operations Manager JMX support classes enable auto-discovery of MBean servers and MBeans, collection of MBean attributes, and execution of MBean operations To enable monitoring, you must configure the JMX-enabled target to accept remote connections. In many cases, the remote connector is enabled by default, otherwise, you must configure it for remote access JMX Prod Product Information Link 2sE15 http://download.oraclecom/javase/1.5.0/docs/apijavax/management/remote/package-summary.htm http://mx4jsourceforge.net/docs/ch03.html ActiveMO http:/lactivemq.apacheorg/jmx.html http:/fjonas.objectweb.org/current/doc/doc-en/integrated/howto/jsr160supporthtml#jsr160suppOrt Servicemixhttp://servicemix.apacheorg/jmx-console.html
In the case of implementing a custom SNMP plug-in for a network device, you are typically defining a platform type that collects any scalar variables that apply to the device and one or more service types to collect table data such as interfaces, power supplies, fans, and so on. The Metric Template Attribute The metric template attribute which is a string containing all the information required to collect a specific data point. In an SNMP plug-in, each of the metrics correlate to an SNMP OID. Although the object names are frequently used to gather the required data points in the plug-ins, you can also use the numeric OID. This has the added benefit of negating the need for ready access to the MIB file anywhere that the plug-in is used. Implementing a new SNMP-based plug-in for vRealize Operations Manager starts with locating the device vendor's MIB files and selecting which OIDs to collect as metrics in vRealize Operations Manager. JMX-Based Management provides support for managing and monitoring JMX-enabled applications. vRealize Operations Manager has a number of built-in plug-ins that monitor specific JMX products, including: n Sun JVM 1.5 n ActiveMQ 4.0 n Geronimo 1.0 n Resin 3.0 n JOnAS 4.7 vRealize Operations Manager uses the remote API (http://www.jcp.org/en/jsr/detail?id=160) specified by JSR-160 to manage products that support JMX 1.2/JSR-160, including the ones listed above. For JMXenabled servers that do not support JSR-160, vRealize Operations Manager uses vendor-specific connectors. vRealize Operations Manager JMX support classes enable auto-discovery of MBean servers and MBeans, collection of MBean attributes, and execution of MBean operations. To enable monitoring, you must configure the JMX-enabled target to accept remote connections. In many cases, the remote connector is enabled by default, otherwise, you must configure it for remote access. JMX Product Product Information Link J2SE 1.5 http://download.oracle.com/javase/1.5.0/docs/api/javax/management/remote/package-summary.html MX4J http://mx4j.sourceforge.net/docs/ch03.html ActiveMQ http://activemq.apache.org/jmx.html JOnAS http://jonas.objectweb.org/current/doc/doc-en/integrated/howto/JSR160_support.html#JSR160_support ServiceMix http://servicemix.apache.org/jmx-console.html Endpoint Operations Management Agent Plug-in Development Kit VMware, Inc. 20