Learn F5 Technologies, Get Answers & Share Community Solutions Join DevCentral

Filter by:
  • Solution
  • Technology
Clear all filters
Answers

how to judge a net interface is disable(Ethernet cable be pulled out)

I hope to disable a net interface using tmsh::modify /net interface 1.3 disabled,when the other net interface 1.2 is disabled. the question is : how can I judge the net interface 1.2 is disable?

0
Rate this Question

Answers to this Question

placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER

can you use tmsh::show /net interface 1.2 and parse the status in the response...?

0
Comments on this Answer
Comment made 04-Apr-2018 by fengchunlai 2

the following code is right or not?

Script

sys icall script PortCheck.v1.0.0 { app-service none definition {

set dev_objs [tmsh::show /net interface 1.2]

 if {$ dev_objs == " disabled "}{
    tmsh::modify /net interface 1/1.5 disabled

} else { tmsh::modify /net interface 1/1.5 enabled

} } description none events none }

Handler

sys icall handler periodic PortCheck.v1.0.0 { first-occurrence 2018-04-4:11:00:00 interval 10 script PortCheck.v1.0.0 }

0