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
------------------------------
Original Message:
Sent: Wed March 15, 2023 10:47 AM
From: Andreas Legner
Subject: InformixHQ run script
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
Original Message:
Sent: Wed March 15, 2023 10:20 AM
From: Alexander Ivanov
Subject: InformixHQ run script
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
Original Message:
Sent: Wed March 15, 2023 06:47 AM
From: Art Kagel
Subject: InformixHQ run script
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
Original Message:
Sent: Wed March 15, 2023 01:56 AM
From: Alexander Ivanov
Subject: InformixHQ run script
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
------------------------------