Page 1 of 1

File as an argument for check_oracle_health

Posted: Sat Jan 11, 2020 10:50 am
by SiniSreen
Hello,

I'm using check_oracle_health plugin [as per in the wizard] to monitor the Oracle parameters and I have around 500 servers to add. Adding each server with the services having different details is a tedious task.

I'm looking for a feasibility where the 'connect' details are provided in a file with the same format "<address>:<port>/<SID>" as the argument and grepped with the address every time the script is executed so that whenever a new server needs to be added, I just have to update the file with the connection details and it will automatically inherit the service configuration.

Is it possible to add a file as an argument to a 'connect' string which will help in configuration? Please let me know at the earliest.

Thanks in advance!

Re: File as an argument for check_oracle_health

Posted: Mon Jan 13, 2020 9:55 pm
by Box293
I would look at adding host free variables for each option. On every host object you would define them. Then create a custom command that references these variables. You would have a common service that would use this check command and the service would also be assigned to multiple hosts/hostgroups.

Have a look at this KB article that shows a simple example for a password defined in every host:
https://support.nagios.com/kb/article/n ... s-509.html

This KB article explains common hostgroups:
https://support.nagios.com/kb/article/n ... s-507.html

Does any of this help?

Re: File as an argument for check_oracle_health

Posted: Tue Jan 14, 2020 10:30 am
by SiniSreen
Thanks for your email. The passwords and other parameters have been added to commands already. The only variable here is the connect details. Is there any options for this to have this under a comman service.

Re: File as an argument for check_oracle_health

Posted: Tue Jan 14, 2020 9:14 pm
by Box293
The method I am trying to explain to you, using custom variables, means you can define the connect details in each host object as custom variables. Then you can reference these macros in your command.
For example:
Define _ORACLE_SID in host object

In command definitions reference it as:
$_HOSTORACLE_SID$

Hence you end up with a common service using a common command where the host specific variables are pulled from each host object.