Unanswered: How do I return a list of Informix instances
Please may I have your assistance?
This is probably trivial to an Informix DBA?
I would like to be able to return a list of Informix instances running on a Unix machine.
The objective is to script the monitoring of the status of all the instances. I would like to make this generic. Normally to return the status we need to set up our environment variables
then run onstat -
however my objective is to script this to retreive automatically all the possible values of the above variables and check each instance.
Any ideas how this can be done?
Your help would be greatly appreciated
There is no way to programatically determine this unless you have been extreamly consistant in your naming of everything.
Assuming that you only have one INFORMIXDIR (certainly not always the case) you could look at you sqlhosts files to determine instance names. You would then have to tie them to the onconfig somehow - either by a naming standard or search for files with DBSERVERNAME, etc.
All said, it would probibly just be easier to maintain a list of instances with the path to their environment shell script. After all, you have to start and stop them somehow. Are they not indirectly started though inittab and shutdown?
Many thanks for your response.
The objective is to create a single capability to monitor more than one customer. Hence I cannot make any assumptions about naming convention or startup scripts.
It looks as if I will need to design this so that the customer configures which instances I want to monitor.