Tags:,,,, Posted in Debian,planet-libre.org,supervision,Ubuntu 4 Comments

Hop, j’ai trouvé ça : http://labs.consol.de/nagios/check_oracle_health/ repéré sur exchange.nagios.org.
Y’a aussi le pendant pour MySQL, MSSQL etc. A voir à l’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 et Oracle ToolBox que je décris là, y’a de quoi surveiller et optimiser.

L’installation de ce plug-in est assez simple. Le plus dur est d’avoir un environnement PERL/Oracle fonctionnel. Je le décris dans un précédent article, car ça bug un peu.

Installation

Ensuite, il faut simplement récupérer les sources (actuellement cette version), lire le fichier « INSTALL », ce qui revient à taper un classique configure/make/make check/make install et vérifier qu’on obtient bien le binaire dans /usr/local/nagios/libexec/.
Si vous devez créer un utilisateur Oracle dédié pour analyser ces indicateurs, la doc dit de lui donner ces permissions :

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;

Test en ligne de commande

Enfin, on l’essaye avec :
/usr/local/nagios/libexec/check_oracle_health
Par exemple :

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:

Houuuuu, la baffe !

Intégration dans Nagios

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 /etc/nagios/nrpe_local.cfg. J’en parle déjà ici. Et comme je suis sympa, j’en donne un long exemple en fin de cet article.

Une fois lancé depuis Nagios, alors qu’en utilisateur nagios et ligne de commande, ça marchait bien, je me suis récupéré l’erreur ORA-24327 « need explicit attach before authenticating a user » en sortie de NRPE…
Il manquait des variables d’environnement à passer à l’utilisateur nagios pour le daemon NRPE. Je n’ai rien trouvé plus propre que de modifier le script de lancement du service… (si vous avez mieux, dites moi) :

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

### 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
###

test -x $DAEMON || exit 0

blablablababla...

Résultat

A la fin, ouaaa, ça donne ça :
check_oracle_health
Yapuka corriger la palanquée de problèmes. Où est mon DBA ? ah, y’en a pas, ça promet. Allez, on ressort « Oracle for dummies ».

Annexes

Conf NRPE de tous les tests

Comme je suis sympa, je donne un bout de fichier de conf NRPE au cas où. J’ai simplement fait cracher tous les « modes » (contrôles) possibles en scriptant, histoire de générer ça facilement.

#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

Conf Nagios pour appeler ces tests NRPE

La même chose pour le fichier Nagios appelant NRPE :

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
}

Remarques

J’ai fait le bourrin : un « service Nagios » = un « appel NRPE » = un « lancement de check_oracle_health ». On doit pouvoir fignoler avec des paramètres et le « check_nrpe » normal plutôt que le « 1arg »-ument.

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.
A base de :

check_oracle_health --blabla -mode list-events | awk ...

et idem pour les sysstats, enqueues, latches etc.
Attention, dans les 3000 tests (de mémoire) et des fichiers de conf Nagios de 10 km de long. C’est passablement crétin de tout mettre d’un coup (bon OK, je l’ai fait quand même, histoire de voir ;)) car le serveur Nagios accuse un peu le coup.
Je crois de plus que les tests génériques, genre check_oracle_health --mode event-waits sortent en premier les erreur critiques les plus graves. Pas la peine de descendre dans un détail sans fin de check_oracle_health --blabla --mode event-waits --name 687721825 par exemple, ou encore /usr/local/nagios/libexec/check_oracle_health --connect bla/bla@BLA --mode enqueue-waiting --name XR.

Voilà, vous devriez pouvoir sortir un reporting de votre base en 17 tomes, de quoi assomer n’importe quel patron, emmerder un DBA et vous laisser du temps libre. :D

16 novembre 2010