06-07-2011 03:25 AM - edited 03-17-2019 10:19 PM
Hi All,
Is there an accurate way to check for the number of Movi users that are signed in without having to log into the VCS Control/VCS Expressway?
The problem is that TMS does not report the number of active users accurately, and as we are importing from AD (5000+ users), we cannot tell how many users are signed in. This causes issues regarding licensing and we are unable to identify how many "available movi licenses" there are.
This might be an issue with the version of our software but I couldn't see any updates on the release notes to address these issues (TMS is on 12.6.1 and VCSs are on X5.1.1).
I was looking at a way to interrogate the VCS Control/VCS Expressway to get this. Possibly to develop a program which opens a SSH session to each VCS and then runs a command to get the number of registrations. The program would then filter to find any AOR with .movi in it and sum the number of these registrations up.
Any ideas as the program development won't be easy?
Thanks
Regards
Pinkesh
06-07-2011 11:49 PM
Hi Pinkesh,
if you want to manually check how many Movi registrations a particular VCS has, you can accomplish this using the following command from Linux/Mac OS X:
ssh root@10.10.10.10 "echo "xstat reg" | tsh" | grep VendorInfo | grep MCX | wc -l
The above command assumes that your VCS has an IP address of 10.10.10.10. This command connects to the VCS as root, gets the current 'xstatus registrations' output and searches for registrations where the 'VendorInfo' identifier is 'MCX', which is the identifier that a Movi registration will be listed as, and counts the number of occurences of the 'MCX' identifier with 'wc -l'.
The above command will prompt you for the VCS root password though, so I'd recommend that you run this script from a host which has been set up with public key authentication for your VCS's so that you won't have to type in the password each time the command is run.
Hope this helps,
Andreas
06-08-2011 12:40 AM
Great.... thanks for the help Andreas, i'll try get something automated so it can run every hour or so and note the result in an excel spreadsheet.
Kind Regards
Pinkesh
06-08-2011 09:36 AM
Is this something that I should be able to run through an SSH client, such as PuTTY? I am trying through PuTTY but not getting any output.
06-08-2011 10:27 AM
Andrew,
this would not work from Putty, the command needs to be run from the terminal of a Linux, Mac OS X or similar *nix-based host machine.
Hope this helps,
Andreas
06-08-2011 11:26 AM
Hi,
small addon to Andreas suggestion.
with public key authentication you can also script the command he had given, in theory
to utilize the result to graph it with mrtg and co.
Instead of the ssh connection I would go fot the xmp api, this also gives access to the
registration status, sure some xml parsing is required after that.
If a manual check of "what do I have now" is what you are looking for, you can handle this as well
on the command line of the VCS, as this is a linux system.
As always logging in as root to a system, better not do it if you dont know what you are doing.
If you are logged in as root to the VCS you could also use the following commands:
To show you the same what Andreas mentioned:
echo "xstat reg" | tsh | grep VendorInfo: |grep MCX |wc -l
counting the different movi versions:
echo "xstat reg" | tsh | grep VendorInfo: |grep MCX | sort |uniq -c|sort -nr
couting all different user agents registered to that vcs:
echo "xstat reg" | tsh | grep VendorInfo: | sort|uniq -c|sort -nr
What you filter on at the end is just up to you, with some regex magic you can also show
all movi users registered with a specific version, but like I said in the beginning, for that the
xml api looks like the better choice.
Please remember to rate helpful responses and identify
07-08-2011 11:23 AM
Hi Martin,
Very useful information with the commands you outlined. Are there any other commands that could provide additional detail? Is there a way to find specifics about a single registration for a certain Movi version?
07-11-2011 07:35 AM
Hi Andrew!
The xstatus of the VCS TSH CLI is nice to get a overview, as its more or less a flowing a text output.
If you just need once a while to manually look for something you could log into the vcs as root executing a:
echo "xstat reg" | tsh | less -S
You can search then with /searchword for a specific text string or browse with the cursor keys up and down.
hitting q will exit less (more info about less: http://unixhelp.ed.ac.uk/CGI/man-cgi?less )
Also don't forget the VCS web interface with the registrations and registration history status pages, though
it does not let you search for a specific movi version, but it might give you some easy access to registration
info.
I would not do any deeper matching or trying to further automated parsing of the TSH xstatus output.
For automated processing of the status you should use the http-xml api.
Here an example of the output you would get, some perl or whatever program might nicely show you
whatever you want to see :-)
Please remember to rate helpful responses and identify
07-11-2011 11:55 AM
Thanks for the response, Martin.
To find the 1 Movi user who is still using Movi 4.0, I leveraged the UNIX experience of one of my colleagues to create the following steps to have a file that I can search through.
-) echo "xstat reg" | tsh >> FileName (any name you want)
-) ls -ltr 'filename' (same name as named in step 2)
-) vi 'filename' (same name as named in step 2)
-) :1 (to go to the beginning of the file)
-) /searchtext (in my case I used MCX 4.0 to find the 1 user who was still on Movi 4.0)
07-11-2011 12:40 PM
To find the 1 Movi user who is still using Movi 4.0, I leveraged the UNIX experience of one of my colleagues to create the following steps to have a file that I can search through.-) echo "xstat reg" | tsh >> FileName (any name you want)
-) ls -ltr 'filename' (same name as named in step 2)
-) vi 'filename' (same name as named in step 2)
-) :1 (to go to the beginning of the file)
-) /searchtext (in my case I used MCX 4.0 to find the 1 user who was still on Movi 4.0)
We are working with IT, there are many ways to solve an issue, the most important thing is that it works for you :-)
But some comments. With this procedure you will generate a file on the VCS. I would recomend using a
cd /tmp
upfront, and check that the filename is not in use by something else. So you can be sure you do not mess
with anything.
Using >> will append the new output to the existing file. So if you would execute the exact command again,
you will still find the string from the old run.
Using a > instead might be better.
vi is a text editor, as you see it also uses the slash "/" to start a search.
So in short, you could have directly used the:
echo "xstat reg" | tsh | less -S
as mentioned above to come to the same result, with the same look and feel of the search, without
generating a file on the disk of the vcs :-)
Btw. people might find it hard to get out of vi again, its :q or
A q'n'd version to get to the "which movi uris are registered with 4.0" you coud also use:
echo "xstat reg" | tsh | grep -B9 -A11 -i MCX\ 4.0 | egrep "AOR|Vendor"
But like I said, doing automated or more serious stuff: use the XML-API!
Please remember to rate helpful responses and identify
07-12-2011 07:30 AM
Thanks for the insight, Martin.
This was very helpful and provides the feedback very concisely: echo "xstat reg" | tsh | grep -B9 -A11 -i MCX\ 4.0 | egrep "AOR|Vendor"
06-10-2011 01:01 AM
Thanks for all the help guys..
I tried to automate the process but it went of track so I just left it using ExtraPutty which allows you to run stored scenarios with a few clicks.
I tried to install cygwin so I can emulate a Unix shell on Windows but that always came back with errors when trying to run the commands mentioned above. Because I couldn't get the unix shell to work on Windows correctly, I couldn't really make use of the public key authentication.
The method I use is (on Windows):
- Get Public/Private key pair on local machine
- Copy public key into a authorized_keys2 file on the .ssh folder of the VCS
- Load up ExtraPutty using the public key saved on your local machine, use autologin feature to login as "root"
- When ExtraPutty establishes the connection, it already sends the command to login as root
- Public Key authentication gets me into the box straight away without requesting a password
- run command which is saved on ExtraPutty (
ssh root@10.10.10.10 "echo "xstat reg" | tsh" | grep VendorInfo | grep MCX | wc -l)
- Type in root password (has to be done as I am basically using the vcs as a shell to log back into its self (any implications with doing this?)
- Number of active movi clients is displayed as a number
I might just build a virtual unix machine, but essentially i'm aiming to get it working correctly on windows.
Thanks
Pinkesh
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide