File as an argument for check_oracle_health

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
SiniSreen
Posts: 11
Joined: Mon Apr 28, 2014 2:28 am

File as an argument for check_oracle_health

Post 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!
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: File as an argument for check_oracle_health

Post 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?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
SiniSreen
Posts: 11
Joined: Mon Apr 28, 2014 2:28 am

Re: File as an argument for check_oracle_health

Post 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.
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: File as an argument for check_oracle_health

Post 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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked