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 > "onstat -" remote execution

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-26-02, 03:22
Steve Steve is offline
Registered User
 
Join Date: Aug 2002
Location: Kurva
Posts: 10
"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
Reply With Quote
  #2 (permalink)  
Old 08-26-02, 04:46
Roelwe Roelwe is offline
Registered User
 
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
Reply With Quote
  #3 (permalink)  
Old 08-28-02, 06:43
Steve Steve is offline
Registered User
 
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
Reply With Quote
  #4 (permalink)  
Old 08-28-02, 06:52
Roelwe Roelwe is offline
Registered User
 
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
Reply With Quote
  #5 (permalink)  
Old 08-28-02, 06:55
Roelwe Roelwe is offline
Registered User
 
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
Reply With Quote
  #6 (permalink)  
Old 08-28-02, 06:57
Steve Steve is offline
Registered User
 
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
Reply With Quote
  #7 (permalink)  
Old 08-28-02, 07:03
Roelwe Roelwe is offline
Registered User
 
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
Reply With Quote
  #8 (permalink)  
Old 08-28-02, 07:06
Steve Steve is offline
Registered User
 
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?
Reply With Quote
  #9 (permalink)  
Old 08-28-02, 07:12
Roelwe Roelwe is offline
Registered User
 
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
Reply With Quote
  #10 (permalink)  
Old 08-28-02, 08:18
Steve Steve is offline
Registered User
 
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
Reply With Quote
  #11 (permalink)  
Old 08-28-02, 08:32
Roelwe Roelwe is offline
Registered User
 
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
Reply With Quote
  #12 (permalink)  
Old 08-28-02, 09:12
Steve Steve is offline
Registered User
 
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...
Reply With Quote
  #13 (permalink)  
Old 08-28-02, 09:16
Roelwe Roelwe is offline
Registered User
 
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
Reply With Quote
  #14 (permalink)  
Old 08-28-02, 09:18
Roelwe Roelwe is offline
Registered User
 
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
Reply With Quote
  #15 (permalink)  
Old 09-05-02, 02:29
Steve Steve is offline
Registered User
 
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
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