Need to Automatically stop a thread at given time once a wk

Homepage Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Need to Automatically stop a thread at given time once a wk

  • Creator
    Topic
  • #52571
    derek march
    Participant

    There is an ADT thread that I need to stop at 11:30pm on saturdays, and then bring back up again at 11:35pm.  We do weekly fail-overs and this particular thread has problems in the first moments as everything is coming back up.

    I have been trying to issue the stop command via an alert but can’t seem to get the alert to fire no matter how I configure it.  

    I assume I need some type of time setting in the time window field.  It is possible I am configuring that incorrectly but it seems I have it right.  If I have a time window set I assume that means the alert will attempt to trigger during that time frame?

    I have tried setting it to protocol or thread only.

    I have tried setting it as anytime thread status does not equal down, anytime the .msg file is greater than 0 bytes and when the last received was within the last 24 hours.  

    Basically what I have been going for is making the alert run one minute per week with an entry that is always true.  Is this not possible or is there a much easier way to achieve what I am trying to do?

    my alert action is

    THREADCTL pstop THREADNAME_adt

    ECHO stopping THREADNAME_adt

    I have tried setting that as exec and as tcl

    Thanks

Viewing 4 reply threads
  • Author
    Replies
    • #74722
      Russ Ross
      Participant

      We use cron to stop and start our interface threads during known maintenance windows.

      Here is a particulary interesting example of a cron entry that also illustrates how to start/stop an interface during the maintenance window on the first Thursday of each month:

      Code:

      #
      #   ****************************************************************************
      #   Turn off Caisis ADT interface and alerts during maintenance periods ********
      #   ****************************************************************************
      #
      #      ————————–
      #      Daily backup window
      #      7:30 PM – 9:30 PM everyday
      #      ————————–
      #
      #
      30 19 * * * /bin/ksh -c ‘eval . ~/.profile.cron /quovadx/qdx5.6/integrator p_caisis_adt; touch $HCISITEDIR/Alerts/hs_odb_caisis_adt_32006.off $HCISITEDIR/Alerts/hr_odb_caisis_adt_32006.off; hcicmd -p p_odbc_caisis_adt -c “hs_odb_caisis_adt_32006 pstop”‘
      #
      30 21 * * * /bin/ksh -c ‘eval . ~/.profile.cron /quovadx/qdx5.6/integrator p_caisis_adt; hcicmd -p p_odbc_caisis_adt -c “hs_odb_caisis_adt_32006 pstart”‘
      40 21 * * * /bin/ksh -c ‘eval . ~/.profile.cron /quovadx/qdx5.6/integrator p_caisis_adt; rm -f $HCISITEDIR/Alerts/hs_odb_caisis_adt_32006.off $HCISITEDIR/Alerts/hr_odb_caisis_adt_32006.off’
      #
      #      ———————————————–
      #      Monthly maintenance window
      #      4:30 PM – 7:30 AM first Thursday of every month
      #      ———————————————–
      #
      #
      30 04 1-7 * * test `date +%w` = 4 && /bin/ksh -c ‘eval . ~/.profile.cron /quovadx/qdx5.6/integrator p_caisis_adt; touch $HCISITEDIR/Alerts/hs_odb_caisis_adt_32006.off; hcicmd -p p_odbc_caisis_adt -c “hs_odb_caisis_adt_32006 pstop”‘
      #
      30 07 1-7 * * test `date +%w` = 4 && /bin/ksh -c ‘eval . ~/.profile.cron /quovadx/qdx5.6/integrator p_caisis_adt; hcicmd -p p_odbc_caisis_adt -c “hs_odb_caisis_adt_32006 pstart”‘
      40 07 1-7 * * test `date +%w` = 4 && /bin/ksh -c ‘eval . ~/.profile.cron /quovadx/qdx5.6/integrator p_caisis_adt; rm -f $HCISITEDIR/Alerts/hs_odb_caisis_adt_32006.off’
      #

      Personally, I’m used to doing it this way and would opt to continue using a scheduling method like cron instead of a cloverleaf alert.

      I suppose a cloverleaf alert could do the same thing but could be tricky if you aren’t fully aware of how alerts only fire once and not again until you kick them in the seat of the pants.

      That is why we touch all our default.alrt files once an hour so every alert will be on watch at least once an hour even if they got triggered the prior hour.

      Russ Ross
      RussRoss318@gmail.com

    • #74723
      Chris Williams
      Participant

      Take Russ’s advice. It’s simple and uncomplicated. We do the same thing here. Trying to set this up with an Alert is like taking an airplane to cross the street.

      Chris

    • #74724
      derek march
      Participant

      Unfortunately I am not much of a coder and at first glance that appears to be German, I will take a closer look tomorrow and see if I can’t figure out where I’m even supposed to run this from.

      Thanks for the response

    • #74725
      derek march
      Participant

      Heh, I was just informed by a colleague that this is a unix/linux solution.  I forget that windows is not the default in this community and that I need to include in all posts that I am unfortunately doing this all from windows.

      Also, unfortunately we aren’t allowed to use task scheduler at this time on the clustered servers, so while that would be a very simple solution, I can’t use it and that’s why I was trying to do this with alerts.

    • #74726
      Dwight Heindel
      Participant

      Derek,

      If the alert log files show they are triggering, but the thread actions are not being performed then you might want to double check the commands being executed for any errors.  I didn’t see any process names listed in your THREADCTL alert actions or which version of Cloverleaf you are currently running, but I believe process name is required:

      THREADCTL pstop THREADNAME_adt

       

      I would also suggest trying to exec the hcicmd versions in the alert definitions to see if those work for you:

      hcicmd -p -c “THREADNAME_adt pstop”

      Hope that helps!

      Dwight

Viewing 4 reply threads
  • The forum ‘Cloverleaf’ is closed to new topics and replies.

Forum Statistics

Registered Users
5,105
Forums
28
Topics
9,278
Replies
34,382
Topic Tags
281