Start a Conversation

Unsolved

This post is more than 5 years old

986

July 20th, 2017 07:00

Clients in VBA

Is there a way to get a count of clients in each VBA?

5 Practitioner

 • 

274.2K Posts

April 13th, 2018 12:00

Yes a small script you can get the count of clients protected by VBA=

1. First get the vcenter name using the below command :-

cat /usr/local/vdr/etc/vcenterinfo.cfg | grep vcenter-hostname | cut -d '=' -f 2

2.Using the output from the above command , use that in below command:-

avmgr getl --path=/$vcenter_name/VirtualMachines | awk '{print $2}' | tail -n+2 | wc -l

==========================================================

To be simplified if you want in a script then :-

1. ssh to vba and then create a file using ==> vi count.sh

2.Paste the below lines in it and save using :wq!

#!/bin/bash

clear

vcenter_name=$(cat /usr/local/vdr/etc/vcenterinfo.cfg | grep vcenter-hostname | cut -d '=' -f 2)

client_count=$(avmgr getl --path=/$vcenter_name/VirtualMachines | awk '{print $2}' | tail -n+2 | wc -l)

echo $client_count

3.After that change the permission of the file using => chmod 755 count.sh

4.Run the script using ==> ./count.sh

====================================

Hope that helps !!

Remember to mark the thread as helpful and resolved if that resolves your query.

Aayush.

No Events found!

Top