If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Informix > Remote execution of onstat on AIX servers

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old
Registered User
 
Join Date: Jul 2012
Posts: 28
Remote execution of onstat on AIX servers

Hello,

I have 2 AIX 6.1 servers with Informix databases install on them.
I want to make a script that will check what informix servers are installed on each machine so that i will have the same.
On the server that i am logged on i run the command:
Code:
su informix -c 'export INFORMIXDIR=/usr/informix/informix_11.5;PATH=$PATH:$INFORMIXDIR/bin;onstat -g dis'
This command returns me the values that i want. When i am trying to get these values by executing the command remotely to the other server i get the following error:
ksh: onstat: not found
Note that i run the same command i just run
Code:
ssh <server_name>
before the command.
Also when i log in to the second server and run the command locally (without ssh <server_name>) it works correct again.
I dont understand what is the problem.

Anybody has an idea about it?

Thank you
Reply With Quote
  #2 (permalink)  
Old
Registered User
 
Join Date: Dec 2003
Location: North America
Posts: 144
take a look at the rsh (remote shell) AIX command, perhaps the INFORMIX environment variables, like INFORMIXDIR, are not being set properly when you connect remotely
Reply With Quote
  #3 (permalink)  
Old
Registered User
 
Join Date: Jul 2012
Posts: 28
i tried rsh also. it behaves the same way
Reply With Quote
  #4 (permalink)  
Old
Registered User
 
Join Date: Sep 2011
Location: Pont l'Abbé, Brittany, France
Posts: 345
Hi,


I can do this with at least ssh: proceeding the following way:

Code:
ssh hostname "export ONCONFIG=onconfigvalue;export INFORMIXSERVER=informixservervalue ;export INFORMIXDIR=informixdirvalue ;export PATH=$INFORMIXDIR/bin:$PATH; informixdirvalue/bin/onstat -youroption"
It words daily at a customer

Cheers
E.
Reply With Quote
  #5 (permalink)  
Old
Registered User
 
Join Date: Jul 2012
Posts: 28
thank you very much!
it was the onconfig variable that i was missing.
when i added the onconfig parameter it worked perfectly!
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On