Home Directory

Search Exchange

Search All Sites

Nagios Live Webinars

Let our experts show you how Nagios can help your organization.

Contact Us

Phone: 1-888-NAGIOS-1
Email: sales@nagios.com


Remember Me

Directory Tree




i have installed your yaonp-collector.pl in my oracle db machine. to test i have executed your script.

#perl yaonp-collector.pl

dictcachmisses|9.7|||Dict Cache Miss Ratio=%|
libcachmisses|5.7|||Lib Cache Miss Ratio=%|
dbblckbufmisses|2.6|||Block Buffer Cache Miss=%|
redoentryretr|0|||redo buff alloc entries/retries=%|
latchmisses|0|||Latch Miss=%|
disksorts|0|||Disk Sort=%|
rollbckwa|0|||Rollback Segment Waits=%|
dispworkl|0|||Dispatcher Workload=%|
numsessions|23|||Count Sessions=|
numlckedobj|0|||Number of locked objects=|
numlckblcklck|0|||Number of locks blocking other locks=|
numblcksess|0|||Number of sessions blocked by other sessions=|
tbspcuse|5|SYSAUX||Tablespace Usage=%|
tbspcuse|59|SYSTEM||Tablespace Usage=%|
tbspcuse|0|TEMP||Tablespace Usage=%|
tbspcuse|0|UNDOTBS1||Tablespace Usage=%|
tbspcuse|0|USERS||Tablespace Usage=%|

those are the results but i want to modify your one to do the following;

select current_utilization from v$resource_limit where resource_name ='sessions';

this would give a numeric number and i want to alert based on the number retrieved.

i have tried to modify your plugin SQL's but yet no luck ,,,,, can you give me an idea.

anyideas owner of the plugin?
Owner's reply

Sorry for answering your question so late. But i had problems with my internet connection and was most time offline. Even now it is very slow and often disconnecting.

But now back to topic. Here is a small, step by step, example how to extend yaonp:

1. on oracle host

1. open yaonp-collector.pl, go to the section where the checks are defined and copy/paste the last check, three lines. E.g.

$SQL[12]='SELECT \'tbspcuse\'||\'|\'||ROUND(USED_PERCENT)||\'|\'||TABLESPACE_NAME||\'|\'||\'|Tablespace Usage=%|\' FROM dba_tablespace_usage_metrics;';

2. modify this lines to your needs
a. give the test a name. Eg. sessuti
b. count the array index up by one
c. edit the SQL-Statement to your needs and adjust the output fitting for yaonp-plugin.pl. E.g.

select current_utilization from v$resource_limit where resource_name ='sessions';

will be

'SELECT \'sessuti\'||\'|\'||current_utilization||\'|\'||\'|\'||\'|Session Utilization=%|\'FROM v$resource_limit WHERE resource_name =\'sessions\';';

the resulting lines should look like:

$SQL[13]='SELECT \'sessuti\'||\'|\'||current_utilization||\'|\'||\'|\'||\'|Session Utilization=%|\'FROM v$resource_limit WHERE resource_name =\'sessions\';';

3. test it

ozone:~$ ./yaonp-collector.pl |grep sess
numsessions|24|||Count Sessions=|
numblcksess|0|||Number of sessions blocked by other sessions=|
sessuti|31|||Session Utilization=%|

looks good.

4. edit nrpe.cfg and insert the new check, e.g.

command[ora_sessuti]=/usr/local/nagios/libexec/yaonp-plugin.pl sessuti -w 50% -c 75%

5. reload/restart nrpe.

All done on oracle host.

2. on nagios host

1. edit checkcommands.cfg and insert the new command, e.g.

define command {
command_name ora_sessuti
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c ora_sessuti

2. edit services.cfg, e.g.

define service {
service_description ora_sessuti
check_command ora_sessuti!
host_name ozone
check_period 24x7
event_handler_enabled 0
max_check_attempts 3
check_interval 5
retry_interval 1
active_checks_enabled 1
passive_checks_enabled 0
notifications_enabled 1
check_freshness 0
freshness_threshold 86400
contact_groups admins

3. reload/restart nagios/icinga on your nagios host
4. done

bycipher, May 30, 2012
i need to check the sessions used in a oracle DB and alert if it exceeds. i have compiled your plugin successfully.

what i want i am listing below can you tell me how i cud do the follow: with your plugin if possible

My Oracle DB server details

operating System: Solaris
database: oracle
IP: (not real ip)

My Nagios Server details
OS : Ubuntu
i have configured nagios 3.x

i connect to my db server from my nagios as follow:

ssh -Y root@
Password: xxxxxxxxx
[root@vboxdb /]# su - oracle

Sun Microsystems Inc. SunOS 5.10 Generic January 2005
[oracle@vboxdb ~]$ sqlplus / as sysdba

SQL*Plus: Release Production on Wed May 30 04:53:48 2012

Copyright (c) 1982, 2009, Oracle. All rights reserved.

Connected to:
Oracle Database 11g Release - 64bit Production

what i want to do i will list below ;

SQL> select current_utilization, max_utilization, limit_value from v$resource_limit where resource_name =’sessions’;

——————- ————— ————————- —————

386 404 1528

if the current utilization reaches 1500 alert critical, 1450 warning state. else normal.
can you tell me how i can use your plugin to do this.