Skip to content
Denis Immoos edited this page May 18, 2016 · 13 revisions

Installation

On oracle

create user monitor identified by monitor temporary tablespace TEMP; grant connect, resource to monitor;

For versions 11gR1

create view v_v$diag_alert_ext as select * from x$dbgalertext; create public synonym v$diag_alert_ext for sys.v_v$diag_alert_ext;

grant select on v$diag_alert_ext to monitor; grant select on v_$session to monitor; grant select on v_$parameter to monitor; grant select on v$resource_limit to monitor; grant select on v$instance to monitor; grant select on dba_tablespaces to monitor; grant select on dba_data_files to monitor; grant select on dba_free_space to monitor;

EXAMPLE: check_oracle_open_sessions.pl

./check_oracle_open_sessions.pl --hostname myhost --sid MYSID --authfile /etc/auth/host.auth --warning 2 --critical 4

Output:

CRITICAL | OPEN_SESSIONS=27;2;4;0;170, MAX_SESSIONS=170;2;4;0;170 Options:

sid => MYSID nagios-status => 2 hostname => myhost MAX_SESSIONS => 170 critical => 4 nagios-msg => CRITICAL authfile => /etc/auth/host.auth OPEN_SESSIONS => 27 username => monitor warning => 2 print-options => yes

EXAMPLE in icinga2

icinga2

EXAMPLE: check_oracle_alertlog.pl

Check log entries 30 days back:

./check_oracle_alertlog.pl --hostname myhost --sid MYSID --authfile /etc/auth/host.auth --days 30 OK - W[0]:C[0]

EXAMPLE: check_oracle_open_processes.pl

./check_oracle_open_processes.pl --hostname myhost --sid MYSID --authfile /etc/auth/host.auth --warning 30 --critical 100

Output:

WARNING | MAX_UTILIZATION=33;30;100;0;150, LIMIT_VALUE=150;;;0;150 Options:

sid => MYSID nagios-status => 1 hostname => myhost critical => 100 nagios-msg => WARNING authfile => /etc/auth/host.auth LIMITS => $VAR1 = { 'LIMIT_VALUE' => '150', 'MAX_UTILIZATION' => 33, 'RESOURCE_NAME' => 'processes' }; username => monitor warning => 30 print-options => yes

EXAMPLE: check_oracle_open_sessions.pl

./check_oracle_open_sessions.pl --hostname myhost --sid MYSID --authfile /etc/auth/host.auth --warning 30 --critical 100

EXAMPLE: check_oracle_status.pl

./check_oracle_status.pl --hostname myhost --sid MYSID --authfile /etc/auth/host.auth

Output: OK - OPEN

EXAMPLE: check_oracle_tablespace_multi.pl

OK

./check_oracle_tablespace_multi.pl --twc-statuses="DEFAULT:90:98" --hostname myhost --sid MYSID --authfile check_oracle_tablespace_multi.pl

Output:

OK - C[0]:W[0] | SYSAUX=40.36%;90;98;0;100, USERS=62.6%;90;98;0;100, USERS_IDX=63.4%;90;98;0;100, SYSTEM=61.95%;90;98;0;100, RBS=67.48%;90;98;0;100, TOOLS=.25%;90;98;0;100, USERS_LOB=84.71%;90;98;0;100

W - Warning C - Critical AE - Autoextensible DF - Datafiles

OK - SYSAUX 40.36% W[90%]:C[98%]:AE[NO]:DF[1] OK - USERS 62.6% W[90%]:C[98%]:AE[NO]:DF[1] OK - USERS_IDX 63.4% W[90%]:C[98%]:AE[NO]:DF[1] OK - SYSTEM 61.95% W[90%]:C[98%]:AE[NO]:DF[1] OK - RBS 67.48% W[90%]:C[98%]:AE[NO]:DF[1] OK - TOOLS .25% W[90%]:C[98%]:AE[NO]:DF[1] OK - USERS_LOB 84.71% W[90%]:C[98%]:AE[NO]:DF[2]

CRITICAL

./check_oracle_tablespace_multi.pl --twc-statuses="DEFAULT:90:98,RBS:30:40" --hostname myhost --sid MYSID --authfile check_oracle_tablespace_multi.pl

Output:

CRITICAL - C[1]:W[0] | SYSAUX=40.36%;90;98;0;100, USERS=62.6%;90;98;0;100, USERS_IDX=63.4%;90;98;0;100, SYSTEM=61.95%;90;98;0;100, RBS=67.48%;30;40;0;100, TOOLS=.25%;90;98;0;100, USERS_LOB=84.71%;90;98;0;100

W - Warning C - Critical AE - Autoextensible DF - Datafiles

OK - SYSAUX 40.36% W[90%]:C[98%]:AE[NO]:DF[1] OK - USERS 62.6% W[90%]:C[98%]:AE[NO]:DF[1] OK - USERS_IDX 63.4% W[90%]:C[98%]:AE[NO]:DF[1] OK - SYSTEM 61.95% W[90%]:C[98%]:AE[NO]:DF[1] CRITICAL - RBS 67.48% W[30%]:C[40%]:AE[NO]:DF[1] OK - TOOLS .25% W[90%]:C[98%]:AE[NO]:DF[1] OK - USERS_LOB 84.71% W[90%]:C[98%]:AE[NO]:DF[2]

EXAMPLE: In icinga2

icinga2