Page 1 of 2 12 LastLast
Results 1 to 15 of 17
  1. #1
    Join Date
    Aug 2002
    Location
    Kurva
    Posts
    10

    Unanswered: "onstat -" remote execution

    I would like to control state of other Informix servers from one server,
    l was thinking to do it by remote execution of "onstat -":

    $rexec remote_server /usr/informix/bin/onstat -

    but it doesnīt work, output is:

    shared memory not initialized, but that is not true!
    (because it doesnot work)

    CAN somebody help me how to do it?

    IS THERE ANY OTHER WAY HOW to remotely find out from one server
    if informix is ok at other server?

    Thanx

  2. #2
    Join Date
    Aug 2002
    Location
    Belgium
    Posts
    534
    Hi Steve,

    When you start onstat, it will try and find the configuration file, the root directory of informix software, ... If onstat cannot find these variables it will state: 'Shared memory not initialized'


    You should put your 'onstat -' statement in a shell script, r_onstat.ksh
    Before you rexec it you have to set the environment variables:
    INFORMIXSERVER
    INFORMIXDIR
    ONCONFIG
    INFORMIXSQLHOSTS (if it's on a different location than $INFORMIXDIR/etc/sqlhosts)

    Put these three at the top of your shell script a try again.
    rws

  3. #3
    Join Date
    Aug 2002
    Location
    Kurva
    Posts
    10

    am I doing it bad?

    I tried to put and to set these environment variables,
    but still nothing, may be I have done it not good:

    rexec $DU INFORMIXSERVER=$DU
    rexec $DU INFORMIXDIR=/usr/informix
    rexec $DU ONCONFIG=/usr/informix/etc/onconfig
    rexec $DU /usr/informix/bin/onstat -

    where $DU is server


    when I run it, output is:

    shared memory not initialized for INFORMIXSERVER '<NULL>'

    it seem like I am setting variables bad way?

    thanX

  4. #4
    Join Date
    Aug 2002
    Location
    Belgium
    Posts
    534
    Your INFORMIXSERVER variable is wrong. It is not the name of the machine.
    Check your sqlhosts file in $INFORMIXDIR/etc
    The first column can server as an INFORMIXSERVER.
    Did you perhaps install csdk on the machine where you want to run the rexec?
    rws

  5. #5
    Join Date
    Aug 2002
    Location
    Belgium
    Posts
    534
    If you logon to the remote machine as user infromix, does onstat - work?
    If so, check the INFORMIXSERVER variable defined...
    rws

  6. #6
    Join Date
    Aug 2002
    Location
    Kurva
    Posts
    10

    the name are the same

    this is part of /usr/informix/etc/sqlhosts file:


    bbdes1 onsoctcp bbdes1 sqlexec
    bbkrs1 onsoctcp bbkrs1 sqlexec
    bbzvs1 onsoctcp bbzvs1 sqlexec
    bbbss1 onsoctcp bbbss1 sqlexec
    bbnbs1 onsoctcp bbnbs1 sqlexec

    the name of server is the same like the name of
    INFORMIXSERVER, for example server ZVOLEN is
    bbzvs1 and it has the same name of INFORMIXSERVER
    bbzvs1

    (when I will enter: ping bbzvs1, it works, so bbzvs1 is the name of server)

    so I donīt know, what is wrong

  7. #7
    Join Date
    Aug 2002
    Location
    Belgium
    Posts
    534
    And if you create a script for it:

    server.ksh
    INFORMIXSERVER=server
    INFORMIXDIR=/usr/informix
    ONCONFIG=/usr/informix/etc/onconfig
    /usr/informix/bin/onstat -


    rexec $DU server.ksh
    rws

  8. #8
    Join Date
    Aug 2002
    Location
    Kurva
    Posts
    10
    bbzvs1:/u/test <0> $ su - informix
    informix's Password:
    [YOU HAVE NEW MAIL]
    bbzvs1:/usr/informix $ echo $INFORMIXSERVER
    bbzvs1
    bbzvs1:/usr/informix $


    is it good proof that the name of INFORMIXSERVER for server bbzvs1 is also bbzvs1?

    or how I can check itīs name better?

  9. #9
    Join Date
    Aug 2002
    Location
    Belgium
    Posts
    534
    If you only have one server installed on that machine and if onstat - works on that machine, that's enough proof.

    Change 'server' in the script and replace it by bbzvs1

    That should work.
    rws

  10. #10
    Join Date
    Aug 2002
    Location
    Kurva
    Posts
    10

    what about this?

    #!/bin/ksh
    for DU in bbbb1s1 bbbb2s1 bbbrs1 bbfis1 bblcs1 bbrss1 bbtos1 bbvks1
    bbdes1 bbkrs1 bbzvs1 bbbss1 bbnbs1 bbzhs1 keres1
    do
    echo;echo
    echo $DU":"
    INFORMIXSERVER=$DU
    INFORMIXDIR=$DU:/usr/informix
    ONCONFIG=$DU:/usr/informix/etc/onconfig
    rexec $DU INFORMIXSERVER=$DU;INFORMIXDIR=$DU:/usr/informix;ONCONFIG=$DU:/usr/inf
    ormix/etc/onconfig;/usr/informix/bin/onstat -
    done


    THIS IS LIST OF MY SCRIPT,
    I donīt know of I SHOULD Set variables at local server or remote?
    (I tried both)

    $DU are servers with Informix, I have .netrc file, with acount
    "zaved", with this acount onstat - works fine

    when I run my script, output is:

    bbbb1s1:
    GLS initialization failed, error -23101


    bbbb2s1:
    GLS initialization failed, error -23101

    what error is it?


    THANX

  11. #11
    Join Date
    Aug 2002
    Location
    Belgium
    Posts
    534
    Ok,
    there seems to be something wrong with your GLS.Could you try

    Why did you set INFORMIXDIR=$DU:/usr/infromix and not /usr/informix? I don't know much about rexec, but do you have to specify the machinename in the path?

    GLS is identified in $INFORMIXDIR/gls.
    Check that this directory is not empty.
    Check the variables CLIENT_LOCALE and DB_LOCALE on your informix machines.
    If they are set, you might want to include them in your script.

    Did you try my script for one server? What was the response?
    rws

  12. #12
    Join Date
    Aug 2002
    Location
    Kurva
    Posts
    10

    onstat

    this is gls dir:

    bbs1 <R> /usr/informix/gls $ lt
    total 24
    drwxr-xr-x 2 informix informix 2560 15 nov 2001 cv9
    drwxr-xr-x 2 informix informix 1024 15 nov 2001 cm3
    drwxr-xr-x 33 informix informix 1024 15 nov 2000 lc11
    bbs1 <R> /usr/informix/gls $


    these are LOCALE variables (are the same everywhere)

    bbs1 <R> /usr/informix/gls $ echo $CLIENT_LOCALE
    en_us.8859-1

    bbs1 <R> /usr/informix/gls $ echo $DB_LOCALE
    en_us.8859-1


    I have tried this script: (without path)

    #!/bin/ksh
    for DU in bbbb1s1 bbbb2s1 bbbrs1 bbfis1 bblcs1 bbrss1 bbtos1 bbvks1
    bbdes1 bbkrs1 bbzvs1 bbbss1 bbnbs1 bbzhs1 keres1
    do
    echo;echo
    echo $DU":"
    INFORMIXSERVER=$DU
    INFORMIXDIR=/usr/informix
    ONCONFIG=/usr/informix/etc/onconfig
    rexec $DU INFORMIXSERVER=$DU;INFORMIXDIR=/usr/informix;ONCONFIG=/usr/informix/et
    c/onconfig;/usr/informix/bin/onstat -
    done


    output is:

    bbbb1s1:
    shared memory not initialized for INFORMIXSERVER 'bbbb1s1'

    it is not true

    so, I dont know...

  13. #13
    Join Date
    Aug 2002
    Location
    Belgium
    Posts
    534
    Is Informix installed on your local machine?
    If so, you can easily change your sqlhosts file and run local onstat -, to check whether distant databases are up.

    Another solution is installing ISA.
    rws

  14. #14
    Join Date
    Aug 2002
    Location
    Belgium
    Posts
    534
    Oeps, I just saw something:
    the variable ONCONFIG can only contain the filename, not the path.
    rws

  15. #15
    Join Date
    Aug 2002
    Location
    Kurva
    Posts
    10

    what about sqlhosts?

    I have checked sqlhosts file, there are written all servers
    I would control

    -I have installed informix on my local machine

    -but how to remotely control those remote machines
    included in sqlhosts, if informix is "up"?

    ThanX

Posting Permissions

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