<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Le blog de Michauko &#187; oracletoolbox</title>
	<atom:link href="http://michauko.org/blog/tag/oracletoolbox/feed/" rel="self" type="application/rss+xml" />
	<link>http://michauko.org/blog</link>
	<description>Si tu ne comprends pas le titre de l&#039;article, passe ton chemin</description>
	<lastBuildDate>Mon, 16 Apr 2012 10:10:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Nagios : supervision d&#8217;une base Oracle</title>
		<link>http://michauko.org/blog/2010/11/16/nagios-supervision-dune-base-oracle/</link>
		<comments>http://michauko.org/blog/2010/11/16/nagios-supervision-dune-base-oracle/#comments</comments>
		<pubDate>Tue, 16 Nov 2010 14:52:06 +0000</pubDate>
		<dc:creator>michauko</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[planet-libre.org]]></category>
		<category><![CDATA[supervision]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[check_oracle_health]]></category>
		<category><![CDATA[nagios]]></category>
		<category><![CDATA[NRPE]]></category>
		<category><![CDATA[oracle]]></category>
		<category><![CDATA[oracletoolbox]]></category>

		<guid isPermaLink="false">http://michauko.org/blog/?p=1167</guid>
		<description><![CDATA[Hop, j&#8217;ai trouvé ça : http://labs.consol.de/nagios/check_oracle_health/ repéré sur exchange.nagios.org. Y&#8217;a aussi le pendant pour MySQL, MSSQL etc. A voir à l&#8217;occasion. Ca permet de contrôler depuis Nagios tout un tas de choses dans une instance Oracle : hit ratio, nb de sessions, vitesse de remplissage des redo logs, espace libre des tablespaces etc. Avec ça [...]]]></description>
			<content:encoded><![CDATA[<p>Hop, j&#8217;ai trouvé ça : <a href="http://labs.consol.de/nagios/check_oracle_health/">http://labs.consol.de/nagios/check_oracle_health/</a> repéré sur <a href="http://exchange.nagios.org/directory/Plugins/Databases/Oracle/check_oracle_health/details">exchange.nagios.org</a>.<br />
Y&#8217;a aussi le pendant pour MySQL, MSSQL etc. A voir à l&#8217;occasion.</p>
<p>Ca permet de contrôler depuis Nagios tout un tas de choses dans une instance Oracle : hit ratio, nb de sessions, vitesse de remplissage des redo logs, espace libre des tablespaces etc.<br />
Avec ça et <a href="http://michauko.org/blog/2010/02/03/oracletoolbox-sous-linux-pour-analyser-vos-perfs-oracle/">Oracle ToolBox que je décris là</a>, y&#8217;a de quoi surveiller et optimiser.</p>
<p>L&#8217;installation de ce plug-in est assez simple. Le plus dur est d&#8217;avoir un environnement PERL/Oracle fonctionnel. Je le décris <a href="http://michauko.org/blog/2010/11/15/libdbd-oracle-perl-sur-debian/">dans un précédent article, car ça bug un peu</a>.</p>
<h1>Installation</h1>
<p>Ensuite, il faut simplement <span id="more-1167"></span>récupérer les sources (actuellement <a href="http://labs.consol.de/wp-content/uploads/2010/10/check_oracle_health-1.6.6.1.tar.gz">cette version</a>), lire le fichier &laquo;&nbsp;INSTALL&nbsp;&raquo;, ce qui revient à taper un classique configure/make/make check/make install et vérifier qu&#8217;on obtient bien le binaire dans <code>/usr/local/nagios/libexec/</code>.<br />
Si vous devez créer un utilisateur Oracle dédié pour analyser ces indicateurs, la doc dit de lui donner ces permissions :</p>
<pre>serveur:~# sqlplus sys/manager_que_t_as_pas_change_gros_malin@MABASE as sysdba
CREATE user nagios IDENTIFIED BY super_motdepasse;
GRANT CREATE session TO nagios;
GRANT SELECT any dictionary TO nagios;
GRANT SELECT ON V_$SYSSTAT TO nagios;
GRANT SELECT ON V_$INSTANCE TO nagios;
GRANT SELECT ON V_$LOG TO nagios;
GRANT SELECT ON SYS.DBA_DATA_FILES TO nagios;
GRANT SELECT ON SYS.DBA_FREE_SPACE TO nagios;</pre>
<h1>Test en ligne de commande</h1>
<p>Enfin, on l&#8217;essaye avec :<br />
<code>/usr/local/nagios/libexec/check_oracle_health</code><br />
Par exemple :</p>
<pre>serveur:~#/usr/local/nagios/libexec/check_oracle_health  --connect nagios/super_motdepasse@MABASE --mode sga-library-cache-hit-ratio
CRITICAL - SGA library cache hit ratio 53.51% | sga_library_cache_hit_ratio=53.51%;98:;95:
</pre>
<p>Houuuuu, la baffe !</p>
<h1>Intégration dans Nagios</h1>
<p>Et pour intégrer tout ça dans Nagios, il suffit de jouer avec NRPE en ajoutant les petites commandes qui vont bien dans le fichier <code>/etc/nagios/nrpe_local.cfg</code>. <a href="http://michauko.org/blog/2010/01/06/nrpe-monitorer-des-linux-avec-nagios/">J&#8217;en parle déjà ici</a>. Et comme je suis sympa, j&#8217;en donne un long exemple en fin de cet article.</p>
<p>Une fois lancé depuis Nagios, alors qu&#8217;en utilisateur nagios et ligne de commande, ça marchait bien, je me suis récupéré l&#8217;erreur ORA-24327 &laquo;&nbsp;need explicit attach before authenticating a user&nbsp;&raquo; en sortie de NRPE&#8230;<br />
Il manquait des variables d&#8217;environnement à passer à l&#8217;utilisateur nagios pour le daemon NRPE. Je n&#8217;ai rien trouvé plus propre que de modifier le script de lancement du service&#8230; (si vous avez mieux, dites moi) :</p>
<pre>serveur_nrpe:~# head -30 /etc/init.d/nagios-nrpe-server
#! /bin/sh
#

### BEGIN INIT INFO
# Provides:          nagios-nrpe-server
# Required-Start:    $local_fs $remote_fs $syslog $named $network $time
# Required-Stop:     $local_fs $remote_fs $syslog $named $network
# Should-Start:
# Should-Stop:
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Start/Stop the Nagios remote plugin execution daemon
### END INIT INFO

PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/sbin/nrpe
NAME=nagios-nrpe
DESC=nagios-nrpe
CONFIG=/etc/nagios/nrpe.cfg

<strong>### JACQUES pour ORACLE/Nagios check_oracle_health
export ORACLE_HOME=/usr/lib/oracle/11.1/client
export PATH=$PATH:$ORACLE_HOME/bin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
###
</strong>
test -x $DAEMON || exit 0

blablablababla...</pre>
<h1>Résultat</h1>
<p>A la fin, ouaaa, ça donne ça :<br />
<a href="http://michauko.org/blog/wp-content/uploads/2010/11/20101116_152343.png"><img src="http://michauko.org/blog/wp-content/uploads/2010/11/20101116_152343-300x103.png" alt="check_oracle_health" title="check_oracle_health" width="300" height="103" class="aligncenter size-medium wp-image-1169" /></a><br />
Yapuka corriger la palanquée de problèmes. Où est mon DBA ? ah, y&#8217;en a pas, ça promet. Allez, on ressort &laquo;&nbsp;Oracle for dummies&nbsp;&raquo;.</p>
<h1>Annexes</h1>
<h2>Conf NRPE de tous les tests</h2>
<p>Comme je suis sympa, je donne un bout de fichier de conf NRPE au cas où. J&#8217;ai simplement fait cracher tous les &laquo;&nbsp;modes&nbsp;&raquo; (contrôles)  possibles en scriptant, histoire de générer ça facilement.</p>
<pre>#command[ORAOCTM_tnsping]=/usr/local/nagios/libexec/check_oracle_health --connect nagios/super_motdepasse@BASE --mode tnsping
command[ORAOCTM_connection-time]=/usr/local/nagios/libexec/check_oracle_health --connect nagios/super_motdepasse@BASE --mode connection-time
command[ORAOCTM_connected-users]=/usr/local/nagios/libexec/check_oracle_health --connect nagios/super_motdepasse@BASE --mode connected-users
command[ORAOCTM_sga-data-buffer-hit-ratio]=/usr/local/nagios/libexec/check_oracle_health --connect nagios/super_motdepasse@BASE --mode sga-data-buffer-hit-ratio
command[ORAOCTM_sga-library-cache-hit-ratio]=/usr/local/nagios/libexec/check_oracle_health --connect nagios/super_motdepasse@BASE --mode sga-library-cache-hit-ratio
command[ORAOCTM_sga-dictionary-cache-hit-ratio]=/usr/local/nagios/libexec/check_oracle_health --connect nagios/super_motdepasse@BASE --mode sga-dictionary-cache-hit-ratio
command[ORAOCTM_sga-latches-hit-ratio]=/usr/local/nagios/libexec/check_oracle_health --connect nagios/super_motdepasse@BASE --mode sga-latches-hit-ratio
command[ORAOCTM_sga-shared-pool-reload-ratio]=/usr/local/nagios/libexec/check_oracle_health --connect nagios/super_motdepasse@BASE --mode sga-shared-pool-reload-ratio
command[ORAOCTM_sga-shared-pool-free]=/usr/local/nagios/libexec/check_oracle_health --connect nagios/super_motdepasse@BASE --mode sga-shared-pool-free
command[ORAOCTM_pga-in-memory-sort-ratio]=/usr/local/nagios/libexec/check_oracle_health --connect nagios/super_motdepasse@BASE --mode pga-in-memory-sort-ratio
command[ORAOCTM_invalid-objects]=/usr/local/nagios/libexec/check_oracle_health --connect nagios/super_motdepasse@BASE --mode invalid-objects
command[ORAOCTM_stale-statistics]=/usr/local/nagios/libexec/check_oracle_health --connect nagios/super_motdepasse@BASE --mode stale-statistics
command[ORAOCTM_tablespace-usage1]=/usr/local/nagios/libexec/check_oracle_health --connect nagios/super_motdepasse@BASE --mode tablespace-usage --tablespace BASEDATA
command[ORAOCTM_tablespace-usage2]=/usr/local/nagios/libexec/check_oracle_health --connect nagios/super_motdepasse@BASE --mode tablespace-usage --tablespace BASEIDX
command[ORAOCTM_tablespace-usage3]=/usr/local/nagios/libexec/check_oracle_health --connect nagios/super_motdepasse@BASE --mode tablespace-usage --tablespace SYSAUX
command[ORAOCTM_tablespace-usage4]=/usr/local/nagios/libexec/check_oracle_health --connect nagios/super_motdepasse@BASE --mode tablespace-usage --tablespace SYSTEM
command[ORAOCTM_tablespace-usage5]=/usr/local/nagios/libexec/check_oracle_health --connect nagios/super_motdepasse@BASE --mode tablespace-usage --tablespace TEMP
command[ORAOCTM_tablespace-usage6]=/usr/local/nagios/libexec/check_oracle_health --connect nagios/super_motdepasse@BASE --mode tablespace-usage --tablespace UNDOTBS1
#command[ORAOCTM_tablespace-free]=/usr/local/nagios/libexec/check_oracle_health --connect nagios/super_motdepasse@BASE --mode tablespace-free
### A séparer en plusieurs tablespace au besoin :
command[ORAOCTM_tablespace-remaining-time]=/usr/local/nagios/libexec/check_oracle_health --connect nagios/super_motdepasse@BASE --mode tablespace-remaining-time
###
command[ORAOCTM_tablespace-fragmentation1]=/usr/local/nagios/libexec/check_oracle_health --connect nagios/super_motdepasse@BASE --mode tablespace-fragmentation --tablespace BASEDATA
command[ORAOCTM_tablespace-fragmentation2]=/usr/local/nagios/libexec/check_oracle_health --connect nagios/super_motdepasse@BASE --mode tablespace-fragmentation --tablespace BASEIDX
command[ORAOCTM_tablespace-fragmentation3]=/usr/local/nagios/libexec/check_oracle_health --connect nagios/super_motdepasse@BASE --mode tablespace-fragmentation --tablespace SYSAUX
command[ORAOCTM_tablespace-fragmentation4]=/usr/local/nagios/libexec/check_oracle_health --connect nagios/super_motdepasse@BASE --mode tablespace-fragmentation --tablespace SYSTEM
#command[ORAOCTM_tablespace-fragmentatioN5]=/usr/local/nagios/libexec/check_oracle_health --connect nagios/super_motdepasse@BASE --mode tablespace-fragmentation --tablespace TEMP
command[ORAOCTM_tablespace-fragmentation6]=/usr/local/nagios/libexec/check_oracle_health --connect nagios/super_motdepasse@BASE --mode tablespace-fragmentation --tablespace UNDOTBS1
command[ORAOCTM_tablespace-io-balance1]=/usr/local/nagios/libexec/check_oracle_health --connect nagios/super_motdepasse@BASE --mode tablespace-io-balance --tablespace BASEDATA
command[ORAOCTM_tablespace-io-balance2]=/usr/local/nagios/libexec/check_oracle_health --connect nagios/super_motdepasse@BASE --mode tablespace-io-balance --tablespace BASEIDX
command[ORAOCTM_tablespace-io-balance3]=/usr/local/nagios/libexec/check_oracle_health --connect nagios/super_motdepasse@BASE --mode tablespace-io-balance --tablespace SYSAUX
command[ORAOCTM_tablespace-io-balance4]=/usr/local/nagios/libexec/check_oracle_health --connect nagios/super_motdepasse@BASE --mode tablespace-io-balance --tablespace SYSTEM
command[ORAOCTM_tablespace-io-balance5]=/usr/local/nagios/libexec/check_oracle_health --connect nagios/super_motdepasse@BASE --mode tablespace-io-balance --tablespace TEMP
command[ORAOCTM_tablespace-io-balance6]=/usr/local/nagios/libexec/check_oracle_health --connect nagios/super_motdepasse@BASE --mode tablespace-io-balance --tablespace UNDOTBS1
command[ORAOCTM_tablespace-can-allocate-next1]=/usr/local/nagios/libexec/check_oracle_health --connect nagios/super_motdepasse@BASE --mode tablespace-can-allocate-next --tablespace BASEDATA
command[ORAOCTM_tablespace-can-allocate-next2]=/usr/local/nagios/libexec/check_oracle_health --connect nagios/super_motdepasse@BASE --mode tablespace-can-allocate-next --tablespace BASEIDX
command[ORAOCTM_tablespace-can-allocate-next3]=/usr/local/nagios/libexec/check_oracle_health --connect nagios/super_motdepasse@BASE --mode tablespace-can-allocate-next --tablespace SYSAUX
command[ORAOCTM_tablespace-can-allocate-next4]=/usr/local/nagios/libexec/check_oracle_health --connect nagios/super_motdepasse@BASE --mode tablespace-can-allocate-next --tablespace SYSTEM
command[ORAOCTM_tablespace-can-allocate-next5]=/usr/local/nagios/libexec/check_oracle_health --connect nagios/super_motdepasse@BASE --mode tablespace-can-allocate-next --tablespace TEMP
command[ORAOCTM_tablespace-can-allocate-next6]=/usr/local/nagios/libexec/check_oracle_health --connect nagios/super_motdepasse@BASE --mode tablespace-can-allocate-next --tablespace UNDOTBS1
command[ORAOCTM_datafile-io-traffic1]=/usr/local/nagios/libexec/check_oracle_health --connect nagios/super_motdepasse@BASE --mode datafile-io-traffic --name INDEX01.DBF
command[ORAOCTM_datafile-io-traffic2]=/usr/local/nagios/libexec/check_oracle_health --connect nagios/super_motdepasse@BASE --mode datafile-io-traffic --name SYSAUX01.DBF
command[ORAOCTM_datafile-io-traffic3]=/usr/local/nagios/libexec/check_oracle_health --connect nagios/super_motdepasse@BASE --mode datafile-io-traffic --name SYSTEM01.DBF
command[ORAOCTM_datafile-io-traffic4]=/usr/local/nagios/libexec/check_oracle_health --connect nagios/super_motdepasse@BASE --mode datafile-io-traffic --name TEMP01.DBF
command[ORAOCTM_datafile-io-traffic5]=/usr/local/nagios/libexec/check_oracle_health --connect nagios/super_motdepasse@BASE --mode datafile-io-traffic --name UNDOTBS01.DBF
command[ORAOCTM_datafile-io-traffic6]=/usr/local/nagios/libexec/check_oracle_health --connect nagios/super_motdepasse@BASE --mode datafile-io-traffic --name USERS01.DBF
command[ORAOCTM_soft-parse-ratio]=/usr/local/nagios/libexec/check_oracle_health --connect nagios/super_motdepasse@BASE --mode soft-parse-ratio
command[ORAOCTM_switch-interval]=/usr/local/nagios/libexec/check_oracle_health --connect nagios/super_motdepasse@BASE --mode switch-interval
command[ORAOCTM_retry-ratio]=/usr/local/nagios/libexec/check_oracle_health --connect nagios/super_motdepasse@BASE --mode retry-ratio
command[ORAOCTM_redo-io-traffic]=/usr/local/nagios/libexec/check_oracle_health --connect nagios/super_motdepasse@BASE --mode redo-io-traffic
command[ORAOCTM_roll-header-contention]=/usr/local/nagios/libexec/check_oracle_health --connect nagios/super_motdepasse@BASE --mode roll-header-contention
command[ORAOCTM_roll-block-contention]=/usr/local/nagios/libexec/check_oracle_health --connect nagios/super_motdepasse@BASE --mode roll-block-contention
command[ORAOCTM_roll-hit-ratio]=/usr/local/nagios/libexec/check_oracle_health --connect nagios/super_motdepasse@BASE --mode roll-hit-ratio
command[ORAOCTM_roll-wraps]=/usr/local/nagios/libexec/check_oracle_health --connect nagios/super_motdepasse@BASE --mode roll-wraps
command[ORAOCTM_roll-extends]=/usr/local/nagios/libexec/check_oracle_health --connect nagios/super_motdepasse@BASE --mode roll-extends
command[ORAOCTM_roll-avgactivesize]=/usr/local/nagios/libexec/check_oracle_health --connect nagios/super_motdepasse@BASE --mode roll-avgactivesize
command[ORAOCTM_seg-top10-logical-reads]=/usr/local/nagios/libexec/check_oracle_health --connect nagios/super_motdepasse@BASE --mode seg-top10-logical-reads
command[ORAOCTM_seg-top10-physical-reads]=/usr/local/nagios/libexec/check_oracle_health --connect nagios/super_motdepasse@BASE --mode seg-top10-physical-reads
command[ORAOCTM_seg-top10-buffer-busy-waits]=/usr/local/nagios/libexec/check_oracle_health --connect nagios/super_motdepasse@BASE --mode seg-top10-buffer-busy-waits
command[ORAOCTM_seg-top10-row-lock-waits]=/usr/local/nagios/libexec/check_oracle_health --connect nagios/super_motdepasse@BASE --mode seg-top10-row-lock-waits
command[ORAOCTM_event-waits]=/usr/local/nagios/libexec/check_oracle_health --connect nagios/super_motdepasse@BASE --mode event-waits
command[ORAOCTM_event-waiting]=/usr/local/nagios/libexec/check_oracle_health --connect nagios/super_motdepasse@BASE --mode event-waiting
command[ORAOCTM_enqueue-contention]=/usr/local/nagios/libexec/check_oracle_health --connect nagios/super_motdepasse@BASE --mode enqueue-contention
command[ORAOCTM_enqueue-waiting]=/usr/local/nagios/libexec/check_oracle_health --connect nagios/super_motdepasse@BASE --mode enqueue-waiting
command[ORAOCTM_latch-contention]=/usr/local/nagios/libexec/check_oracle_health --connect nagios/super_motdepasse@BASE --mode latch-contention
command[ORAOCTM_latch-waiting]=/usr/local/nagios/libexec/check_oracle_health --connect nagios/super_motdepasse@BASE --mode latch-waiting
command[ORAOCTM_sysstat]=/usr/local/nagios/libexec/check_oracle_health --connect nagios/super_motdepasse@BASE --mode sysstat
command[ORAOCTM_flash-recovery-area-usage]=/usr/local/nagios/libexec/check_oracle_health --connect nagios/super_motdepasse@BASE --mode flash-recovery-area-usage
command[ORAOCTM_flash-recovery-area-free]=/usr/local/nagios/libexec/check_oracle_health --connect nagios/super_motdepasse@BASE --mode flash-recovery-area-free
#command[ORAOCTM_sql]=/usr/local/nagios/libexec/check_oracle_health --connect nagios/super_motdepasse@BASE --mode sql
#command[ORAOCTM_list-tablespaces]=/usr/local/nagios/libexec/check_oracle_health --connect nagios/super_motdepasse@BASE --mode list-tablespaces
#command[ORAOCTM_list-datafiles]=/usr/local/nagios/libexec/check_oracle_health --connect nagios/super_motdepasse@BASE --mode list-datafiles
#command[ORAOCTM_list-enqueues]=/usr/local/nagios/libexec/check_oracle_health --connect nagios/super_motdepasse@BASE --mode list-enqueues
#command[ORAOCTM_list-latches]=/usr/local/nagios/libexec/check_oracle_health --connect nagios/super_motdepasse@BASE --mode list-latches
#command[ORAOCTM_list-events]=/usr/local/nagios/libexec/check_oracle_health --connect nagios/super_motdepasse@BASE --mode list-events
#command[ORAOCTM_list-background-events]=/usr/local/nagios/libexec/check_oracle_health --connect nagios/super_motdepasse@BASE --mode list-background-events
#command[ORAOCTM_list-sysstats]=/usr/local/nagios/libexec/check_oracle_health --connect nagios/super_motdepasse@BASE --mode list-sysstats</pre>
<h2>Conf Nagios pour appeler ces tests NRPE</h2>
<p>La même chose pour le fichier Nagios appelant NRPE :</p>
<pre>define service {
        use generic-service
        host_name srvnrpe
        service_description ORAOCTM_connection-time
        check_command check_nrpe_1arg!ORAOCTM_connection-time
}
define service {
        use generic-service
        host_name srvnrpe
        service_description ORAOCTM_connected-users
        check_command check_nrpe_1arg!ORAOCTM_connected-users
}
define service {
        use generic-service
        host_name srvnrpe
        service_description ORAOCTM_sga-data-buffer-hit-ratio
        check_command check_nrpe_1arg!ORAOCTM_sga-data-buffer-hit-ratio
}
define service {
        use generic-service
        host_name srvnrpe
        service_description ORAOCTM_sga-library-cache-hit-ratio
        check_command check_nrpe_1arg!ORAOCTM_sga-library-cache-hit-ratio
}
define service {
        use generic-service
        host_name srvnrpe
        service_description ORAOCTM_sga-dictionary-cache-hit-ratio
        check_command check_nrpe_1arg!ORAOCTM_sga-dictionary-cache-hit-ratio
}
define service {
        use generic-service
        host_name srvnrpe
        service_description ORAOCTM_sga-latches-hit-ratio
        check_command check_nrpe_1arg!ORAOCTM_sga-latches-hit-ratio
}
define service {
        use generic-service
        host_name srvnrpe
        service_description ORAOCTM_sga-shared-pool-reload-ratio
        check_command check_nrpe_1arg!ORAOCTM_sga-shared-pool-reload-ratio
}
define service {
        use generic-service
        host_name srvnrpe
        service_description ORAOCTM_sga-shared-pool-free
        check_command check_nrpe_1arg!ORAOCTM_sga-shared-pool-free
}
define service {
        use generic-service
        host_name srvnrpe
        service_description ORAOCTM_pga-in-memory-sort-ratio
        check_command check_nrpe_1arg!ORAOCTM_pga-in-memory-sort-ratio
}
define service {
        use generic-service
        host_name srvnrpe
        service_description ORAOCTM_invalid-objects
        check_command check_nrpe_1arg!ORAOCTM_invalid-objects
}
define service {
        use generic-service
        host_name srvnrpe
        service_description ORAOCTM_stale-statistics
        check_command check_nrpe_1arg!ORAOCTM_stale-statistics
}
define service {
        use generic-service
        host_name srvnrpe
        service_description ORAOCTM_tablespace-usage1
        check_command check_nrpe_1arg!ORAOCTM_tablespace-usage1
}
define service {
        use generic-service
        host_name srvnrpe
        service_description ORAOCTM_tablespace-usage2
        check_command check_nrpe_1arg!ORAOCTM_tablespace-usage2
}
define service {
        use generic-service
        host_name srvnrpe
        service_description ORAOCTM_tablespace-usage3
        check_command check_nrpe_1arg!ORAOCTM_tablespace-usage3
}
define service {
        use generic-service
        host_name srvnrpe
        service_description ORAOCTM_tablespace-usage4
        check_command check_nrpe_1arg!ORAOCTM_tablespace-usage4
}
define service {
        use generic-service
        host_name srvnrpe
        service_description ORAOCTM_tablespace-usage5
        check_command check_nrpe_1arg!ORAOCTM_tablespace-usage5
}
define service {
        use generic-service
        host_name srvnrpe
        service_description ORAOCTM_tablespace-usage6
        check_command check_nrpe_1arg!ORAOCTM_tablespace-usage6
}
define service {
        use generic-service
        host_name srvnrpe
        service_description ORAOCTM_tablespace-remaining-time
        check_command check_nrpe_1arg!ORAOCTM_tablespace-remaining-time
}
define service {
        use generic-service
        host_name srvnrpe
        service_description ORAOCTM_tablespace-fragmentation1
        check_command check_nrpe_1arg!ORAOCTM_tablespace-fragmentation1
}
define service {
        use generic-service
        host_name srvnrpe
        service_description ORAOCTM_tablespace-fragmentation2
        check_command check_nrpe_1arg!ORAOCTM_tablespace-fragmentation2
}
define service {
        use generic-service
        host_name srvnrpe
        service_description ORAOCTM_tablespace-fragmentation3
        check_command check_nrpe_1arg!ORAOCTM_tablespace-fragmentation3
}
define service {
        use generic-service
        host_name srvnrpe
        service_description ORAOCTM_tablespace-fragmentation4
        check_command check_nrpe_1arg!ORAOCTM_tablespace-fragmentation4
}
define service {
        use generic-service
        host_name srvnrpe
        service_description ORAOCTM_tablespace-fragmentation5
        check_command check_nrpe_1arg!ORAOCTM_tablespace-fragmentation5
}
define service {
        use generic-service
        host_name srvnrpe
        service_description ORAOCTM_tablespace-fragmentation6
        check_command check_nrpe_1arg!ORAOCTM_tablespace-fragmentation6
}
define service {
        use generic-service
        host_name srvnrpe
        service_description ORAOCTM_tablespace-io-balance1
        check_command check_nrpe_1arg!ORAOCTM_tablespace-io-balance1
}
define service {
        use generic-service
        host_name srvnrpe
        service_description ORAOCTM_tablespace-io-balance2
        check_command check_nrpe_1arg!ORAOCTM_tablespace-io-balance2
}
define service {
        use generic-service
        host_name srvnrpe
        service_description ORAOCTM_tablespace-io-balance3
        check_command check_nrpe_1arg!ORAOCTM_tablespace-io-balance3
}
define service {
        use generic-service
        host_name srvnrpe
        service_description ORAOCTM_tablespace-io-balance4
        check_command check_nrpe_1arg!ORAOCTM_tablespace-io-balance4
}
define service {
        use generic-service
        host_name srvnrpe
        service_description ORAOCTM_tablespace-io-balance5
        check_command check_nrpe_1arg!ORAOCTM_tablespace-io-balance5
}
define service {
        use generic-service
        host_name srvnrpe
        service_description ORAOCTM_tablespace-io-balance6
        check_command check_nrpe_1arg!ORAOCTM_tablespace-io-balance6
}
define service {
        use generic-service
        host_name srvnrpe
        service_description ORAOCTM_tablespace-can-allocate-next1
        check_command check_nrpe_1arg!ORAOCTM_tablespace-can-allocate-next1
}
define service {
        use generic-service
        host_name srvnrpe
        service_description ORAOCTM_tablespace-can-allocate-next2
        check_command check_nrpe_1arg!ORAOCTM_tablespace-can-allocate-next2
}
define service {
        use generic-service
        host_name srvnrpe
        service_description ORAOCTM_tablespace-can-allocate-next3
        check_command check_nrpe_1arg!ORAOCTM_tablespace-can-allocate-next3
}
define service {
        use generic-service
        host_name srvnrpe
        service_description ORAOCTM_tablespace-can-allocate-next4
        check_command check_nrpe_1arg!ORAOCTM_tablespace-can-allocate-next4
}
define service {
        use generic-service
        host_name srvnrpe
        service_description ORAOCTM_tablespace-can-allocate-next5
        check_command check_nrpe_1arg!ORAOCTM_tablespace-can-allocate-next5
}
define service {
        use generic-service
        host_name srvnrpe
        service_description ORAOCTM_tablespace-can-allocate-next6
        check_command check_nrpe_1arg!ORAOCTM_tablespace-can-allocate-next6
}
define service {
        use generic-service
        host_name srvnrpe
        service_description ORAOCTM_datafile-io-traffic1
        check_command check_nrpe_1arg!ORAOCTM_datafile-io-traffic1
}
define service {
        use generic-service
        host_name srvnrpe
        service_description ORAOCTM_datafile-io-traffic2
        check_command check_nrpe_1arg!ORAOCTM_datafile-io-traffic2
}
define service {
        use generic-service
        host_name srvnrpe
        service_description ORAOCTM_datafile-io-traffic3
        check_command check_nrpe_1arg!ORAOCTM_datafile-io-traffic3
}
define service {
        use generic-service
        host_name srvnrpe
        service_description ORAOCTM_datafile-io-traffic4
        check_command check_nrpe_1arg!ORAOCTM_datafile-io-traffic4
}
define service {
        use generic-service
        host_name srvnrpe
        service_description ORAOCTM_datafile-io-traffic5
        check_command check_nrpe_1arg!ORAOCTM_datafile-io-traffic5
}
define service {
        use generic-service
        host_name srvnrpe
        service_description ORAOCTM_datafile-io-traffic6
        check_command check_nrpe_1arg!ORAOCTM_datafile-io-traffic6
}
define service {
        use generic-service
        host_name srvnrpe
        service_description ORAOCTM_soft-parse-ratio
        check_command check_nrpe_1arg!ORAOCTM_soft-parse-ratio
}
define service {
        use generic-service
        host_name srvnrpe
        service_description ORAOCTM_switch-interval
        check_command check_nrpe_1arg!ORAOCTM_switch-interval
}
define service {
        use generic-service
        host_name srvnrpe
        service_description ORAOCTM_retry-ratio
        check_command check_nrpe_1arg!ORAOCTM_retry-ratio
}
define service {
        use generic-service
        host_name srvnrpe
        service_description ORAOCTM_redo-io-traffic
        check_command check_nrpe_1arg!ORAOCTM_redo-io-traffic
}
define service {
        use generic-service
        host_name srvnrpe
        service_description ORAOCTM_roll-header-contention
        check_command check_nrpe_1arg!ORAOCTM_roll-header-contention
}
define service {
        use generic-service
        host_name srvnrpe
        service_description ORAOCTM_roll-block-contention
        check_command check_nrpe_1arg!ORAOCTM_roll-block-contention
}
define service {
        use generic-service
        host_name srvnrpe
        service_description ORAOCTM_roll-hit-ratio
        check_command check_nrpe_1arg!ORAOCTM_roll-hit-ratio
}
define service {
        use generic-service
        host_name srvnrpe
        service_description ORAOCTM_roll-wraps
        check_command check_nrpe_1arg!ORAOCTM_roll-wraps
}
define service {
        use generic-service
        host_name srvnrpe
        service_description ORAOCTM_roll-extends
        check_command check_nrpe_1arg!ORAOCTM_roll-extends
}
define service {
        use generic-service
        host_name srvnrpe
        service_description ORAOCTM_roll-avgactivesize
        check_command check_nrpe_1arg!ORAOCTM_roll-avgactivesize
}
define service {
        use generic-service
        host_name srvnrpe
        service_description ORAOCTM_seg-top10-logical-reads
        check_command check_nrpe_1arg!ORAOCTM_seg-top10-logical-reads
}
define service {
        use generic-service
        host_name srvnrpe
        service_description ORAOCTM_seg-top10-physical-reads
        check_command check_nrpe_1arg!ORAOCTM_seg-top10-physical-reads
}
define service {
        use generic-service
        host_name srvnrpe
        service_description ORAOCTM_seg-top10-buffer-busy-waits
        check_command check_nrpe_1arg!ORAOCTM_seg-top10-buffer-busy-waits
}
define service {
        use generic-service
        host_name srvnrpe
        service_description ORAOCTM_seg-top10-row-lock-waits
        check_command check_nrpe_1arg!ORAOCTM_seg-top10-row-lock-waits
}
define service {
        use generic-service
        host_name srvnrpe
        service_description ORAOCTM_event-waits
        check_command check_nrpe_1arg!ORAOCTM_event-waits
}
define service {
        use generic-service
        host_name srvnrpe
        service_description ORAOCTM_event-waiting
        check_command check_nrpe_1arg!ORAOCTM_event-waiting
}
define service {
        use generic-service
        host_name srvnrpe
        service_description ORAOCTM_enqueue-contention
        check_command check_nrpe_1arg!ORAOCTM_enqueue-contention
}
define service {
        use generic-service
        host_name srvnrpe
        service_description ORAOCTM_enqueue-waiting
        check_command check_nrpe_1arg!ORAOCTM_enqueue-waiting
}
define service {
        use generic-service
        host_name srvnrpe
        service_description ORAOCTM_latch-contention
        check_command check_nrpe_1arg!ORAOCTM_latch-contention
}
define service {
        use generic-service
        host_name srvnrpe
        service_description ORAOCTM_latch-waiting
        check_command check_nrpe_1arg!ORAOCTM_latch-waiting
}
define service {
        use generic-service
        host_name srvnrpe
        service_description ORAOCTM_sysstat
        check_command check_nrpe_1arg!ORAOCTM_sysstat
}
define service {
        use generic-service
        host_name srvnrpe
        service_description ORAOCTM_flash-recovery-area-usage
        check_command check_nrpe_1arg!ORAOCTM_flash-recovery-area-usage
}
define service {
        use generic-service
        host_name srvnrpe
        service_description ORAOCTM_flash-recovery-area-free
        check_command check_nrpe_1arg!ORAOCTM_flash-recovery-area-free
}
</pre>
<h2>Remarques</h2>
<p>J&#8217;ai fait le bourrin : un &laquo;&nbsp;service Nagios&nbsp;&raquo; = un &laquo;&nbsp;appel NRPE&nbsp;&raquo; = un &laquo;&nbsp;lancement de check_oracle_health&nbsp;&raquo;. On doit pouvoir fignoler avec des paramètres et le &laquo;&nbsp;check_nrpe&nbsp;&raquo; normal plutôt que le &laquo;&nbsp;1arg&nbsp;&raquo;-ument.</p>
<p>Enfin, vous pouvez détailler chaque test pour les problèmes de verrous, events etc. La liste est méga longue. Vous pourrez facilement scripter pour obtenir la liste de tous les test si vous êtes un bon gros psychopathe.<br />
A base de :</p>
<pre>check_oracle_health --blabla -mode list-events | awk ...</pre>
<p> et idem pour les sysstats, enqueues, latches etc.<br />
Attention, dans les 3000 tests (de mémoire) et des fichiers de conf Nagios de 10 km de long. C&#8217;est passablement crétin de tout mettre d&#8217;un coup (bon OK, je l&#8217;ai fait quand même, histoire de voir <img src='http://michauko.org/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> ) car le serveur Nagios accuse un peu le coup.<br />
Je crois de plus que les tests génériques, genre <code>check_oracle_health --mode event-waits</code> sortent en premier les erreur critiques les plus graves. Pas la peine de descendre dans un détail sans fin de <code>check_oracle_health --blabla --mode event-waits --name 687721825</code> par exemple, ou encore <code>/usr/local/nagios/libexec/check_oracle_health --connect bla/bla@BLA --mode enqueue-waiting --name XR</code>.</p>
<p>Voilà, vous devriez pouvoir sortir un reporting de votre base en 17 tomes, de quoi assomer n&#8217;importe quel patron, emmerder un DBA et vous laisser du temps libre. <img src='http://michauko.org/blog/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://michauko.org/blog/2010/11/16/nagios-supervision-dune-base-oracle/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>OracleToolbox sous Linux, pour analyser vos perfs Oracle</title>
		<link>http://michauko.org/blog/2010/02/03/oracletoolbox-sous-linux-pour-analyser-vos-perfs-oracle/</link>
		<comments>http://michauko.org/blog/2010/02/03/oracletoolbox-sous-linux-pour-analyser-vos-perfs-oracle/#comments</comments>
		<pubDate>Wed, 03 Feb 2010 17:19:56 +0000</pubDate>
		<dc:creator>michauko</dc:creator>
				<category><![CDATA[autres outils]]></category>
		<category><![CDATA[planet-libre.org]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[oci8]]></category>
		<category><![CDATA[oracle]]></category>
		<category><![CDATA[oracletoolbox]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://michauko.org/blog/?p=1005</guid>
		<description><![CDATA[L&#8217;objectif Afin de creuser certaines baisses de perfs d&#8217;une base Oracle non loin de là, j&#8217;ai cherché un outil, si possible libre, pour obtenir facilement des infos du genre top-ten des requêtes les plus lancées, les plus longues, qui brassent le plus de données etc etc. Et de faire un EXPLAIN sur celles-ci pour trouver [...]]]></description>
			<content:encoded><![CDATA[<h1>L&#8217;objectif</h1>
<p>Afin de creuser certaines baisses de perfs d&#8217;une base Oracle non loin de là, j&#8217;ai cherché un outil, si possible libre, pour obtenir facilement des infos du genre top-ten des requêtes les plus lancées, les plus longues, qui brassent le plus de données etc etc. Et de faire un EXPLAIN sur celles-ci pour trouver l&#8217;index qu&#8217;on a raté, l&#8217;algorithme pensé avec les pieds et ce genres de choses.</p>
<p>Comme Oracle est un lointain souvenir, je n&#8217;avais pas envie de me plonger dans la liste des tables V_$TRUC qui contiennent tout ceci, mais dont je n&#8217;ai aucune envie de me souvenir.</p>
<h1>Quelques outils</h1>
<p>Bilan, on trouve rapidement :<span id="more-1005"></span></p>
<ul>
<li>
l&#8217;Enterprise Manager d&#8217;Oracle (java, lourd, chiant, façon Oracle tout simplement)
</li>
<li>
SpotLight de l&#8217;éditeur Quest Software (celui qui pond T.O.A.D). Ca balance du gros, mais c&#8217;est commercial, cher etc. Vu que tout est dans des tables et que j&#8217;ai simplement besoin d&#8217;un outil qui me présente ça lisiblement, c&#8217;est presque trop. M&#8217;enfin, si vous êtes fortunés, n&#8217;hésitez pas.
</li>
<li>
Enfin, OracleToolBox sur <a href="http://www.oracletoolbox.org/">http://www.oracletoolbox.org/</a>
</li>
</ul>
<h1>La configuration de OracleToolbox</h1>
<p>Je livre ici 2/3 détails sur l&#8217;installation de Oracle Toolbox, après avoir ramé un peu.<br />
C&#8217;est rapide, mais ça vaut sûrement le coup d&#8217;être résumé :</p>
<h2>Couche Oracle</h2>
<p>Il faut d&#8217;abord avoir une couche cliente Oracle et PHP/OCI8 fonctionnelle. Ca tombe bien je l&#8217;ai décrit ici : <a href="http://michauko.org/blog/2009/05/07/installer-le-client-oracle-sur-debianlenny-interco-avec-php/">http://michauko.org/blog/2009/05/07/installer-le-client-oracle-sur-debianlenny-interco-avec-php/</a></p>
<h2>Installation</h2>
<p>Facile, il suffit de dézipper, par exemple dans <code>/var/www/oracletoolbox/</code>.</p>
<h2>Variables globales</h2>
<p>Il faut activer le passage de variables globales. C&#8217;est le choix de codage qui est fait avec l&#8217;application. Côté PHP, il s&#8217;agit d&#8217;un paramètre sensible permettant éventuellement quelques failles de sécurité.<br />
Donc 2 options s&#8217;offrent à nous :</p>
<ul>
<li>la première, crade pour tester, c&#8217;est de passer à &laquo;&nbsp;On&nbsp;&raquo; la variable <code>register_globals</code> dans <code>/etc/php5/apache2/php.ini</code>
</li>
<li>la deuxième sera plutôt d&#8217;intégrer cette modification uniquement pour le répertoire <code>/var/www/oracletoolbox/</code>, décrit ci-dessous avec au passage la restriction d&#8217;accès à l&#8217;outil par htaccess.
</li>
</ul>
<h2>htpasswd &#038; register_globals</h2>
<p>Pour protéger l&#8217;accès à l&#8217;outil, je propose une conf spécifique pour ce répertoire (<code>/var/www/oracletoolbox/</code>) qu&#8217;on décrira par exemple dans <code>/etc/apache2/conf.d/oracletoolbox</code> :</p>
<pre>&lt;Directory /var/www/oracletoolbox>
        AuthName "Acces restreint"
        AuthType Basic
        AuthUserFile /etc/oracle/toolbox.htpass
        &lt;limit GET POST>
                require user toolbox
        &lt;/Limit>
        php_value register_globals 1
        &lt;Files *.ini>
                Order allow,deny
                Deny from all
        &lt;/Files>

&lt;/Directory></pre>
<p>A noter le &laquo;&nbsp;php_value&nbsp;&raquo;, qui évite d&#8217;activer &laquo;&nbsp;register_globals&nbsp;&raquo; sur toute l&#8217;installation Apache/PHP. Donc de la restreindre à l&#8217;application OracleToolbox.<br />
La restriction sur les fichiers ini évitera qu&#8217;un gros malin récupère les mots de passe.</p>
<p>
Pour créer un mot de passe associé au compte &laquo;&nbsp;toolbox&nbsp;&raquo; dans le fichier <code>/etc/oracle/toolbox.htpass</code> (emplacement complètement arbitraire), il faut utiliser l&#8217;outil <code>htpasswd</code>, comme d&#8217;hab :</p>
<pre>srv:/# htpasswd -bc /etc/oracle/toolbox.htpass toolbox mon_pass
Adding password for user toolbox
srv:/# cat /etc/oracle/toolbox.htpass
toolbox:76X12345jNUkI</pre>
<h2>Déclaration des bases, tnsnames, tout ça</h2>
<p>Le fichier &laquo;&nbsp;INSTALL&nbsp;&raquo; fourni dans le package donne tous les pré-requis logiciels, en incluant les lib GD, PNG etc. Du facile à installer si vous n&#8217;avez pas ces modules (php5-gd etc).<br />
Ce fichier donne surtout quelques indices sur le reste de la configuration Oracle.<br />
Il faudra donc jeter en vrac tous les logins/passwd des comptes Oracle qui vous permettront d&#8217;accéder à vos bases, dans <code>/var/www/oracletoolbox/pswd.ini</code>. L&#8217;outil testera tout ce qu&#8217;il trouve, quelle que soit la base à laquelle vous vous connectez, en espérant qu&#8217;un marchera.<br />
Au premier lancement de l&#8217;outil (http://votre.serveur/oracletoolbox/), il vous demandera aussi où est votre fichier &laquo;&nbsp;tnsnames.ora&nbsp;&raquo; qui décrit vos bases et lesquelles vous voudrez &laquo;&nbsp;installer&nbsp;&raquo;, c&#8217;est-à-dire rendre accessible depuis OracleToolbox. En gros, il se refait une copie locale de celles qui vous intéressent parmi toutes celles de votre tnsnames.ora. Soit. Si vous avez suivi <a href="http://michauko.org/blog/2009/05/07/installer-le-client-oracle-sur-debianlenny-interco-avec-php/">ma doc de mise en place d&#8217;Oracle sur Debian, citée plus haut</a>, le fichier est <code>/etc/oracle/tnsnames.ora</code>.<br />
Tout ceci est au final stocké dans <code>/var/www/oracletoolbox/tnsnames</code>. Au besoin ça s&#8217;édite à la main, ça va plus vite.</p>
<p>Voilà, normalement-ça-marche &#8482;.</p>
<h1>LE bug corrigé &#038; version Windows autonome</h1>
<p>Il existe une version autonome (portable ?) pour windows embarquant un apache, php et le code source. Bref tout ce qu&#8217;il faut pour lancer l&#8217;outil (il manque peut-être le client Oracle et configuration à faire avant). Ca marche bien. Juste que chaque utilisateur doit avoir tout ça en local, faire tourner momentanément un Apache sur son PC etc.</p>
<p>A côté de cette version Windows, il y a le zip des sources dont je parle depuis le début. Ca marcherait sûrement sur un Windows avec un environnement Apache/PHP/Oracle déjà mis en place d&#8217;ailleurs.<br />
Dans cette version, il y avait un léger bug dans le packaging (dans le zip), l&#8217;auteur m&#8217;a confirmé ça ce matin, qui faisait qu&#8217;un champ RAW d&#8217;Oracle était mal interpreté par PHP. Bref, ça merdait. Normalement, le package est corrigé ce jour et vous n&#8217;aurez pas de problème.<br />
Si toutefois vous voyez une réaction comme ci-dessous dans le top-ten des &laquo;&nbsp;Disk/Buffer intensive request&nbsp;&raquo;, vous êtes concerné, prenez le code de l&#8217;autre zip (celui pour windows) ou retéléchargez les sources si vous l&#8217;avez fait avant la correction :<br />
<div id="attachment_1022" class="wp-caption alignnone" style="width: 585px"><a href="http://michauko.org/blog/wp-content/uploads/2010/02/20100126_1111451.png"><img src="http://michauko.org/blog/wp-content/uploads/2010/02/20100126_1111451.png" alt="OracleToolbox avec RAWTOHEX manquant" title="OracleToolbox avec RAWTOHEX manquant" width="575" height="199" class="size-full wp-image-1022" /></a><p class="wp-caption-text">OracleToolbox avec RAWTOHEX manquant</p></div><br />
Pour en avoir le coeur net, cherchez &laquo;&nbsp;rawtohex&nbsp;&raquo; dans &laquo;&nbsp;fonction_oracle.php&nbsp;&raquo;. Si ça n&#8217;y est pas, c&#8217;est pas bon.</p>
<p>Allez, bonne analyse de perfs</p>
]]></content:encoded>
			<wfw:commentRss>http://michauko.org/blog/2010/02/03/oracletoolbox-sous-linux-pour-analyser-vos-perfs-oracle/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

