Informix

 View Only
  • 1.  InformixHQ run script

    Posted Wed March 15, 2023 01:56 AM

    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
    ------------------------------


  • 2.  RE: InformixHQ run script

    IBM Champion
    Posted Wed March 15, 2023 05:37 AM
    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





  • 3.  RE: InformixHQ run script

    Posted Wed March 15, 2023 10:13 AM

    I want recover InformixHQ agent



    ------------------------------
    Alexander Ivanov
    ------------------------------



  • 4.  RE: InformixHQ run script

    IBM Champion
    Posted Wed March 15, 2023 06:47 AM

    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
    ------------------------------



  • 5.  RE: InformixHQ run script

    Posted Wed March 15, 2023 10:20 AM

    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
    ------------------------------



  • 6.  RE: InformixHQ run script

    IBM Champion
    Posted Wed March 15, 2023 10:47 AM

    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
    ------------------------------



  • 7.  RE: InformixHQ run script

    Posted Thu March 16, 2023 02:52 AM

    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
    ------------------------------