Results 1 to 5 of 5
  1. #1
    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

  2. #2
    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

  3. #3
    Join Date
    Jul 2012
    Posts
    28
    i tried rsh also. it behaves the same way

  4. #4
    Join Date
    Sep 2011
    Location
    Pont l'Abbé, Brittany, France
    Posts
    346
    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.

  5. #5
    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!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •