Is it possible to...? (PNP4NAGIOS)

Hi everyone!

I have a script implemented in a remote machine that checks the occupation rate of the tablespaces in Oracle (made with sqlplus). For each tablespace the script send the result with identification, service status and also performance data. For example, in Oracle I have 4 tablespaces, the script will return 4 checks results via nsca. Each check result also have performance data appended.

echo -e "$HOST\t$SERVICE\t2\tService xpto blablabla: Occupation rate - ${usage}% | ${ts}=${usage}% "
/usr/local/nagios/bin/send_nsca -H $NSCASERVERHOST
-c /usr/local/nagios/etc/send_nsca.cfg

In Nagios side I have configured one host (oracle_machine) and one service (tablespaces_oracle). So, I’m trying to understand in how to have a graph in PNP that will gather the results sent by the nsca (One service configured to gather information about multiple tablespaces). Is it possible? For now I only can visualize a graph with information only related with check result’s tablespace that is send in last. I don’t want to configure in Nagios one service for one tablespace, because the number of tablespaces is inconstant (tests/debugs/new projects/…), that will be a tedious an unusable job!

sorry for my English… I’m trying to improve! :slight_smile:
Thanks

This forum is dead… :roll:

or maybe nobody knows how to help you?

Yes, sorry. That’s a possibility. Perhaps I only make difficult questions. This is my third post without reply. But sorry for the expression.

sorry, i’m not using pnp4nagios so i can’t help :slight_smile:

can you link me your old questions? i haven’t searched the older posts since i restarted using the forums, but maybe i can help a bit :slight_smile:

Hi,
I may be able to assist a little
I am running pnp4nagios and monitoring oracle tablespaces etc.
However from the way i read your question you would like Nagios to be able to graph new tablespaces without any input from yourself?
Is that correct? If so i don’t think it is possible to achieve this… Hopefully someone can prove me wrong :slight_smile:

I will explain how i have this working on our site.
I use the check_oracle_health plugin from http://www.consol.de/opensource/nagios/check-oracle-health/ (it is a great plugin.)
You need to have the tnsnames.ora file located in the nagios users home dir.
if you have followed the guide for PNP4Nagios on their site then you will then need to add host-pnp to your host definitions file or svr-pnp to your services. This will graph the performance data.
Note i have experienced inconsistencies with this plugin on Oracle 11g tablespace usage but is fine for 10g.
If using 11g you can still get tablespace as the plugin can submit a SQL statement :slight_smile:

You can run these from your plugins libexec dir

eg for 10g:
./check_oracle_health -connect=USERNAME/PASSWORD@SERVER -mode=tablespace-usage -name=DD7333I -warning 95 -critical 99

11g:
./check_oracle_health-connect=USERNAME/PASSWORD@SERVER -mode=sql --name=“SELECT (1-nvl(sum(free.bytes),0)/tot.bytes)*100 pctusd FROM (select ddf.tablespace_name, sum(ddf.bytes) bytes from dba_data_files ddf group by ddf.tablespace_name ) tot, sys.dba_free_space free where tot.tablespace_name = free.tablespace_name(+) and tot.tablespace_name = ‘TABLENAME’ group by tot.tablespace_name, tot.bytes” --name2=“Used Tablespace for TABLENAME” -critical=$ARG2$

Executing this remotely allows us to graph the performance data.
Unfortunatly you will need to add new tablespaces manually.

Hope this helps