InformixHQ run script
Answered: red (hollow confidence) — Suggestions (Task Scheduler, alarmprogram, a stored procedure using SYSTEM) were given, but the asker's SYSTEM procedure fails with error -668 on Windows and the cause is not found.
Advisory only.
Posted in 2023
Alexander Ivanov wanted to auto-restart a failing InformixHQ agent on Windows servers (14 FC8). Marcus Haarmann suggested a scheduled check or alarmprogram; Art Kagel suggested a stored procedure using SYSTEM. Ivanov's procedure failed with error -668 (and 'Not the owner'); Andreas Legner asked about /bin/sh. Unresolved.
Topics: Platform-Specific Issues
Hello. I have informix 14 FC8 on windows servers. For some reason the agent sometimes fails on my servers and now I find a way to restart it without manually connecting to those machines. Is there a way by which the TaskSheduler user in InformixHQ can run some kind of script on the servers? ------------------------------ Alexander Ivanov ------------------------------
Hello, can you please specify what kind of agent you are trying to recover ? I suspect this is a backup agent ? Windows has a builtin scheduler, so you could run a script periodically which controls the presence of the service. Or you could add a check in alarmprogram, which should be executed whenever some events occur (like logfile full). (Have not worked with Windows installations, but I assume the concept of alarmprogram is present). Best, Marcus Haarmann
You could create a stored procedure that uses the SYSTEM command to execute a shell/batch script that will restart the agent. Then you could execute that script from SQL remotely or schedule a task manager task to do that and have it test for the agent first. ------------------------------ Art S. Kagel, President and Principal Consultant ASK Database Management Corp. www.askdbmgt.com ------------------------------
I want recover InformixHQ agent ------------------------------ Alexander Ivanov ------------------------------
Thanks for idea.
I tried to create a procedure like
CREATE PROCEDURE run_HQagent() SYSTEM 'echo 1>>1.txt'; END PROCEDURE;Procudure created but when I EXECUTE PROCEDURE run_HQagent();
I have an error "
-668: The system command cannot be executed or it exited with a non-zero status."My user informix is now registered on the server and I am connecting to InformixHQ with that user.
------------------------------
Alexander Ivanov
------------------------------
I'd first suggest to change 'echo 1>>1.txt' into 'echo 1 >>1.txt' if you really want to see "1" in that file. But that's not your main problem, I guess. Does your system have /bin/sh ? If not, can you - temporarily - provide one, simply as a symbolic link to /bin/bash or /bin/ksh, just to prove this is what's behind this -668? ------------------------------ Andreas Legner ------------------------------
I have a windows host for Infomix and according to
Executing the SYSTEM statement on Windows - IBM Documentation
I can use the system command.
What I don't quite understand is
"The database server must have a password and login username in order to execute a command as that user."
I am logged into the server with my local informix user, the Informix server service is running under this user.
When I try execute the procedure with the SYSTEM command from dbaccess I have the same error
"-668: The system command could not be executed or terminated with a non-zero status."
And additionally the error "1: Not the owner"
------------------------------
Alexander Ivanov
------------------------------