Translating with DrWatson… this can take a few seconds the first time.
This is a genuine, complex translation. DrWatson protects commands, error codes, and log output while naturally translating the surrounding text. It’s translated once and saved.
Malc asked how to get instance names and status from running Informix instances. Jack Parker offered a shell wrapper; Malc posted his own shell loop over onconfig files that sets INFORMIXSERVER and ONCONFIG and checks onstat output for On-Line or not initialized. Superboer explained shared memory keys from ipcs -m differ by servernum (base 0x52564801, see onstat -g seg).
Auto-generated by Claude from the posts below — may be imperfect; read the full thread.
Jack Parker — — source: Usenet: comp.databases.informix
If you like, I have a shell wrapper that loops through all active instances setting up environment variables for each subsequent instance.
j.
On Apr 21, 2011, at 10:14 AM, Jack Parker wrote:
>
> Although I've noted that the "up" / "down" indicator is not always accurate, and should be taken with a grain of salt.
>
> j.
> On Apr 21, 2011, at 9:55 AM, Malc wrote:
>
>> On Apr 21, 2:45 pm, Jack Parker <jack.park...@verizon.net> wrote:
>>> onstat -g dis>>>
>>
>> doh <facepalm>
>> _______________________________________________
>> Informix-list mailing list
>> Informix-list@iiug.org
>> http://www.iiug.org/mailman/listinfo/informix-list
>
> _______________________________________________
> Informix-list mailing list
> Informix-list@iiug.org
> http://www.iiug.org/mailman/listinfo/informix-list
Jack kindly sent me some pretty awk.
Here's some NASTY shell I just put together:
cd ${INFORMIXDIR}/
etc
for file in `ls
onconfig.*"`
do
SERVERNAME=`grep DBSERVERNAME $file|awk '{print $2}
`
if [ "${SERVERNAME}" != "#" -a "${SERVERNAME}" !=
"" ];then
export INFORMIXSERVER=${SERVERNAME}
export ONCONFIG=${file}
onstat -|grep -q "On-
Line"
[ $? -eq 0 ] && echo "${SERVERNAME} is
Up"
onstat -|grep -q "not
initialized"
[ $? -eq 0 ] && echo "${SERVERNAME} is
Down"
fi
done
Yuk.
Hello Malc,
ipcs -m with servernum 0
is 0x52564801 -->> see onstat -g seg.
where 0x56 is used to differ between servers using servernum
ex servernum = 7
shm is:
0x525d4801
so add 0x56 + 0x(servernum).
Superboer.
We use strictly necessary cookies to make this site work. With your
consent we’d also use optional cookies for analytics and marketing. You can accept all,
reject all, or choose. Read our Cookie Policy.