Extending Oracle 10g Grid Control New Metrics, Targets and Plug - ins. Alex Gorbachev The Pythian Group 2006 November. http://www.pythian.com/documents/UKOUG06-Extending10gGC.ppt http://www.pythian.com/documents/UKOUG06-Extending10gGC.zip. Who am I?. Senior Oracle DBA at The Pythian Group
01 / 59Extending Oracle 10g Grid Control New Metrics, Targets and Plug - ins
1 / 17
Télécharger la présentation
Extending Oracle 10g Grid Control New Metrics, Targets and Plug - ins
Une image / un lien ci-dessous est fourni (tel quel) pour télécharger la présentation
Politique de téléchargement : le contenu du site vous est fourni TEL QUEL pour votre information et votre usage personnel ; il ne peut être vendu, concédé sous licence ni partagé sur d’autres sites sans l’accord de son auteur.Le contenu vous est fourni TEL QUEL, pour votre information et votre usage personnel uniquement.Téléchargez la présentation en cliquant sur ce lien.Lors du téléchargement, si vous ne parvenez pas à télécharger une présentation, l’éditeur a peut-être supprimé le fichier de son serveur.Pendant le téléchargement, si vous ne parvenez pas à obtenir une présentation, le fichier a peut-être été supprimé par l’éditeur.
F I N
Plus de contenu associé
Transcription de la présentation
Extending Oracle 10g Grid ControlNew Metrics, Targets and Plug-ins Alex Gorbachev The Pythian Group 2006 November http://www.pythian.com/documents/UKOUG06-Extending10gGC.ppt http://www.pythian.com/documents/UKOUG06-Extending10gGC.zip
Who am I? • Senior Oracle DBA at The Pythian Group • Working with Oracle since ‘97 • Pythian is a leading DBA outsourcing provider – remote DBA 24x7 • Offices worldwide – Canada, US, UK, India, Australia • www.pythian.com/blogs
Why Extending Grid Control? • Keep your own proven monitoring • Monitor non-Oracle components • In-house or COTS software • Software and hardware vendors • Cut costs – avoid expensive packs • Write once – use many times
Pythian Real Life Example • Pythian is providing full remote DBA service and has monitoring tool “Avail” • State of art monitoring tool built by DBA’s for themselves • Years of development and contributions of many DBA’s • More than just Oracle monitoring • Two old customers using Avail • They don’t want to loose proven monitoring • Another customer has invested a lot into OEM but want to leverage our tool • Solution – integrate Avail into OEM
Agenda • User Defined Metrics (UDM) • New target types • Example – MySQL • Management Plug-ins • Advanced Topics • Reports
User Defined Metrics • To extend existing targets • Oracle Instance targets • SQL querybased • Host targets • OS scripts based • UDMs - bottom of the target’s home page in the Related Links section
SQL based UDM – 10gR1 • Single column, single row • Numeric value • Thresholds operators – = < <= != etc. • Text value • Threshold operators • CONTAINS, MATCH, = • Avoid NULL values • Use “Test” button • SELECT ROUND (c.open_cursors / p.value * 100) open_cursors • FROM (SELECT sid, COUNT (*) open_cursors • FROM v$open_cursor • GROUP BY sid • ORDER BY 2 DESC) c, • v$parameter p • WHERE p.name = 'open_cursors' AND ROWNUM = 1; • Credentials (username + password) • Thresholds (70,90) • Alert message • Collection interval
SQL based UDM – 10gR2 • Two columns, multiple rows • The key • The value (numeric or text) • Each key-value pair is treated separately SELECT q.owner || '.' || q.NAME queue_name, s.ready FROM v$aq s, dba_queues q WHERE s.qid = q.qid AND q.owner IN ('PYTHIAN') • Key based thresholds “<key1>:<th1>;…” • “QUEUE1:10;QUEUE2:100” • Custom alert message • Queue %Key% contains %value% messages
OS script based UDM • Script/binary returning single value • em_result=<value> + return zero • em_error=<message> + return none-zero • Permissions (!) • %scriptsDir% • $AGENT_HOME/sysman/admin/scripts • %perlBin% • Environment variables
OS script based UDM • Script/binary returning single value status=`/usr/bin/mysqladmin ping 2>&1` if [ "$status" = "mysqld is alive" ] ; then echo "em_result=Up" else mysqld=`ps -e | grep mysqld | grep -v grep | wc -l` if [ "$mysqld" = "0" ] ; then echo "em_result=Down“ else echo "em_error=$status“ ;exit 1 fi fi
UMDs Pros and Cons • Very simple • but… • No new targets • Limited collection mechanisms • No collection on cumulative counters (V$SYSSTAT) • Has to be defined and managed for each instance • Separate credentials • No real-time collection • Requires Database Diagnostic Pack
New Targets – Real Extensibity • Develop new target types • Write once and reuse • Variety of collection mechanisms • Separation of development and operations
OEM Repository Management Servers Grid Control Architecture Agent Agent Agent Agent DBA’s Data collection
New Target Type – Main Steps • Create target type metadata • Validate new target type and metric collection • Define metrics default collection parameters • Distribute metadata and required support files to all hosts • Add instances of new target type
XML DTD’s – Best Reference • $AGENT_HOME/sysman/admin/dtds • Target type metadata • TargetMetadata.dtd • Metrics default collection • TargetCollection.dtd, Schedule.dtd • Target instances (in targets.xml) • TargetInstance.dtd
Target type metadata $AGENT_HOME/sysman/admin/metadata/pythian_mysql.xml <?xml version="1.0" ?> <!DOCTYPE TargetMetadata SYSTEM "../dtds/TargetMetadata.dtd"> <TargetMetadata META_VER="1.0" TYPE="pythian_mysql"> <Display>…</Display> <Metric>…</Metric> <Metric>…</Metric> <InstanceProperties>…</InstanceProperties> </TargetMetadata>
Output– pythian_mysql_load.sh • MySQL server up……………exit 0 em_result=Up|10 • MySQL server down………...exit 0 em_result=Down • Metric collection error………exit 1 em_error=<error message>
Response Metric • Availability monitoring • Must be of type TABLE • Must contain column Status • Must have critical threshold defined in default collection properties
Why Plug-ins? • Central management and deployment • Distribute all required files to agents • Packaging tool for vendors • System reports • Customized home page • Setup and cleanup procedures • Custom storage tables
Configure EM CLI Client • EM Command-Line Interface • Download $OMS_HOME/sysman/jlib/emclikit.jar • https://gc.oracloid.com:1159/em/console/emcli/download • Set environment for JDK 1.4.1 or above $ export JAVA_HOME=… $ export PATH=$JAVA_HOME/bin:$PATH • Install client java -jar emclikit.jar client \ -install_dir=/opt/oracle/emcli
Deployment - Import • Import MPA using EM web-based GUI • Set Agent’s preferred credentials • Setup->Management Plug-ins->Import • Enter path • Click “List Archive” • Mark plug-in • OK
Reports • MPA allows adding SYSTEM reports • Can’t be deleted • Can be placed on target’s home page
How to Add Reports to MP • Design and develop using GUI • SQL Statements • Appearance • Using Information Publisher API • Report definition file with PL/SQL block • MGMT_IP and MGMT_MP_HOMEPAGE packages • So far no wizard to convert GUI => IP API