Forum Discussion
Gather a list of virtuals and or pools that are offline state and provide duration
Hi,
I am looking for a way in tmsh to provide a list of offline VIPs/pools. In addition to that, I want to know how long they were offline. I know I can sift through the LTM logs but that will take too long for what I want to accomplish. If I go to the GUI, I can list a set of VIPs/Pools based on 'offline' status, however it does not provide duration, just shows the current state.
Sorry for beeing late to this thread.
Here is a one-liner which lists the availability of all virtuals recursively:
tmsh -q -c 'cd /;show ltm virtual recursive' | grep -iE '(ltm::virtual|availability)' | sed ':a;N;s/\n/ /' | sed -r 's/ltm::virtual server *:? *//I; s/ *availability *:? */ /I'
It starts with printing all virtual servers statistics and filters all lines containing the virtual server names and availabiltity states.
The first sed statement in the pipeline joins the lines of the virtual server and its availability state.
The second sed statement in pipeline does some housekeeping.
- What_Lies_Bene1Cirrostratus
TMOS/LTM does not monitor downtime in any way. I would suggest using some logic with an SNMP tool or a log analysis tool like Splunk would be your only choice here.
- Kevin_StewartEmployee
Node up/down events are usually logged to the Syslog LTM facility. You could use a set of user_alert.conf configurations (or iCalls in 11.4) to track and store this information. Unfortunately user_alert.conf doesn't allow you to consume parameters, so you'd have to have a separate pair of config lines fore every node. You could also probably do the same in Syslog directly.
- ryan_126547NimbostratusIf I go to the GUI local traffic -> virtual servers and select from the drop down box 'offline', I can see all VIPs that are offline, assuming no text is in the search box. So, if I wanted to pull the equivalent data in ltm shell, is this possible? The closest match I could find what list ltm node state. I want to know the states of the VIPs, not nodes.
- What_Lies_Bene1Cirrostratus
Just for listing Virtual Servers that are offline, you should be able to use a combination of the [tmsh] show ltm virtual command and grep to achieve what you want.
- PragathishakartNimbostratus
Syslog Utility would be ideal option. If you have the Splunk configured to for syslog, you can filter the logs for the specific virtual servers and the pool members down.
- VictorCNimbostratus
Did you ever get a solution? I'm looking for the same to perform a huge cleanup. My list of virtuals are over 6000. In the web console, when I pick Offline in the Status column, it shows me that there are 4848 on the bottom right (Show All). However when I copy/paste from the screen, my text editor shows only 3659. It looks like the list in the GUI is truncated perhaps due to some limitation, so I'm hoping to get this via bigpipe or tmsh. I'm running 10.2.4
Thanks.
- ryan_126547Nimbostratus
I haven't implemented anything yet, but probably your best bet is to take the advice above in this thread and maybe put the VIPs or Pools into monitoring and have your monitoring server do the tracking. You will save yourself time by not diff'ing the files. I recommend Nagios.
- VictorCNimbostratus
I just got this tmsh tcl script working on my device: https://devcentral.f5.com/wiki/tmsh.VirtualStat.ashx
I'm not trusting the full list through my web console since it seems to be truncated around the 3600 mark for all the offline virtual servers.
Hope that helps.
- dev_bhusalNimbostratus
you can use
tmsh show ltm virtual /\*/* | egrep 'Virtual Server|Availability'|grep -B1 offline|egrep -v 'offline|--'|sed 's/Ltm::Virtual Server: //'
Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com