Forum Discussion

Boris_Rousseau_'s avatar
Boris_Rousseau_
Icon for Nimbostratus rankNimbostratus
Jul 01, 2010

How to schedule a "Forced Offline" on node with condition

Hello,

 

 

I need to do as following:

 

 

Automaticly "Force Offline" a Node, at 1Am, IF there is no user connexion.

 

IF there is user connexion ( on that node), then wait 5 min and try again.

 

IF there is still user connexion at 1:30am, force offline anyway.

 

 

Any idea ?

 

Best regards

 

3 Replies

  • Hamish's avatar
    Hamish
    Icon for Cirrocumulus rankCirrocumulus
    I'd do this in iControl (And perl) myself. You could do this in an iRule as well, but it's best to keep those simple and stable, because they run inline, and any problems means dropped connections.

     

     

    Others will undoubtedly say tmsh, or something, but there's at least half a dozen choices... PIck the one you feel most comfortable with putting in place and supporting.

     

     

    The codeshare has several perl examples for dealing with poolmembers. Grab one & just modify it for your requirements. Kick off with cron at 01:00 and put the check, sleep, loop and force offline in the script.

     

     

    H
  • George_Watkins_'s avatar
    George_Watkins_
    Historic F5 Account
    Hi Boris,

    I agree with Hamish that iControl is the way to go on this. I wish we would just include atd with default installs of BIG-IP. There are number of times it would have been useful to me. That being said, if you are calling the script remotely I would use at to execute the command that way it only executes once. If you put it in cron and forget about it, it could come back to bite you later on. The command sequence would probably look something like this:

    
    % export TZ=UTC (or whatever applicable timezone it should be executed in, this has bitten me by not setting the correct timezone)
    
    % at 01:00 July 2
    
    at> /usr/local/bin/.pl
    at> 
    job 5 at Fri Jul  2 01:00:00 2010
     

    If you need to look at scheduled jobs, run 'atq'. If you want to cancel the job, run 'atrm '.

    Hope this helps,

    George