Forum Discussion

nbel_66078's avatar
nbel_66078
Icon for Nimbostratus rankNimbostratus
Oct 19, 2009

getting ltm status active/standby

Hi

 

I'm trying to find a solution in order to avoid LTM redundant pair to both execute an Irule that log VS client connection information to our syslog.

 

The fact is when a client connect to the VS with the following associated Irule both LTM send the same message to our syslog... (probably due to the connection mirroring option).

 

 

So I wonder if there is a solution to obtain the ltm status in order to make the logging only from the active ltm ?

 

 

fyi we are using v10 LTM

 

 

 

if [?getstatuscommand?] = 1 then ...

 

 

 

when RULE_INIT {

 

Activate logging on internal network syslog ?

 

set ::log_debug 1

 

}

 

when CLIENT_ACCEPTED {

 

log -noname 192.168.12.12:514 local0.info "Client [IP::remote_addr]:[TCP::remote_port] connected to Virtual Server: [virtual] ([IP::local_addr]:[TCP::local_port])"

 

if {$::log_debug==1}{

 

log -noname 192.168.13.13:514 local0.info "Client [IP::remote_addr]:[TCP::remote_port] connected to Virtual Server: [virtual] ([IP::local_addr]:[TCP::local_port])"

 

}

 

}

 

endif

8 Replies

  • The iRule shouldn't run on the standby unit. Are you seeing a problem where it is running?

     

     

    Aaron
  • i'm surprised too but the fact is that i've got on my syslog server always the same couple of message for the same event: one from the active ltm and the other from the standby ltm. The only problem is these redundant messages are polluting the log file..

     

  • Just for information, i've made a test and remove the Connection Mirror in the VS settings and so only the active ltm send messages to the syslog. But we would like to use the connection mirror function, so if you have an idea to identify the active/standby ltm in a irule ... or maybe an other way to avoid sending duplicate message to the syslog
  • That makes a bit more sense. I'm not sure if there is a way to determine whether the current unit the iRule is running on is active though. I suppose you could use a shell script which runs ps1 to get the current state and updates a datagroup or an iRule with a global variable--but I'm not sure that's the cleanest solution.

     

     

    Does anyone have any idea whether there is any iRule command which could be used to determine if the current unit is active?

     

     

    Aaron
  • Ah, I know this post is pretty old at this point, but I'm seeing the same behaviour with 11.2HF3, and I'm wondering if anyone ever found a resolution for this problem?
  • Hi Mike,

     

     

    I do not believe that there is a way to determine the Active Device in an iRule (since iRules normally only run on the Active Unit). This sounds very much like an edge case that is specifically caused when Connection Mirroring is enabled.

     

     

    This does sound like a good RFE (Request For Enhancement) opportunity though. I would suggest opening a case with F5.
  • We've submitted an RFE and the bugid to track is ID370181. "It is supposed to have commands showing a device status in traffic group when it processes mirrored traffic".