cancel
Showing results for 
Search instead for 
Did you mean: 

Display current connection table via SOAP / CLI

SOLVED
mattwater
Contributor

Display current connection table via SOAP / CLI

Guys I’m trying to flesh out whether there is a way to extract the current connection table via SOAP and or some other method.

Ideally I would like to do this remotely by issuing a command to fetch the current connections but redirect the output to a file.

connections.JPG.jpg

Any ideas?

1 ACCEPTED SOLUTION

Accepted Solutions
markbod
Contributor

Re: Display current connection table via SOAP / CLI

Hi Mathew,

Ahhh a new problem... A step closer though :-)

A 401 indicates that the STM is rejecting your credentials. You should verify that the username/password you are providing in the $admin_server scalar are correct, and that the user has permission to use the SOAP API. The format of the $admin_server should be "https://userSmiley Tongue[email protected]:9090"

I would try to access the API using the "admin" user and if that works, then check that the user you want to use has the correct group permisions under System -> Users -> Permission Groups in the UI.

Cheers,

Mark

View solution in original post

9 REPLIES 9
edwin_groothuis
New Contributor

Re: Display current connection table via SOAP / CLI

Check your browser web console, you will see it retrieves the page and a data file.

It's not SOAP, you will need a cookie but you will get the data.

Edwin

edwin_groothuis
New Contributor

Re: Display current connection table via SOAP / CLI

Doh.

I thought this was about the Steelhead appliance.

Edwin

owen
Frequent Contributor

Re: Display current connection table via SOAP / CLI

Hi Matt - this article - Tech Tip: Using Perl/SOAP to list recent connections in Stingray Traffic Manager - describes how to use SOAP to retrieve the current and recent connections table from a traffic manager

Best regards

Owen

mattwater
Contributor

Re: Display current connection table via SOAP / CLI

Owen I'm having trouble getting the script working, I'm recieving the following error. Any ideas?

500 Can't connect to myhost:9090 (certificate verify failed) at C:\Users\XXXXXXX\Desktop\Work Folders\Scripts\Perl\My Scripts\Stingray\getConnectionSummary.pl line 28

owen
Frequent Contributor

Re: Display current connection table via SOAP / CLI

Hi Mathew,

Perl and LWP can be picky about self-signed SSL certificates, and I think that might be the root of your problem.

Could you try either or both of:

#1: set an environment variable at the top of your script:

$ENV{PERL_LWP_SSL_VERIFY_HOSTNAME}=0;

#2: set an SSL option after you create your $conn SOAP::Lite object:

$conn->proxy->ssl_opts( SSL_verify_mode => 0 );

These two steps are illustrated by this article: Tech Tip: Reading Stingray's internal diagnosis report using Perl and SOAP and I have found that one or other of them address most SSL certificate problems (it seemed to depend on the precise version of LWP)

regards

Owen

mattwater
Contributor

Re: Display current connection table via SOAP / CLI

Thanks for the follow up Owen.

I updated the script as per your recommendation but am still receiving the same error.

401 Unauthorised at C:\Users\auser\Desktop\Scripts\Stingray\getConnectionSummary.pl line 32.

error.JPG.jpg

Also placed $ENV{PERL_LWP_SSL_VERIFY_HOSTNAME}=0; at the top of the script as advised

Info.JPG.jpg

markbod
Contributor

Re: Display current connection table via SOAP / CLI

Hi Mathew,

Ahhh a new problem... A step closer though :-)

A 401 indicates that the STM is rejecting your credentials. You should verify that the username/password you are providing in the $admin_server scalar are correct, and that the user has permission to use the SOAP API. The format of the $admin_server should be "https://userSmiley Tongue[email protected]:9090"

I would try to access the API using the "admin" user and if that works, then check that the user you want to use has the correct group permisions under System -> Users -> Permission Groups in the UI.

Cheers,

Mark

mattwater
Contributor

Re: Display current connection table via SOAP / CLI

Thanks for the input Mark, and you were right I had the wrong user set.

That said......................... now I'm getting this

Can't locate object method "struct" via package "System" (perhaps you forgot to load "System"?) at

C:\Users\auser\Desktop\\Stingray\getConnectionSummary.pl line 50.

error2.JPG.jpg

mattwater
Contributor

Re: Display current connection table via SOAP / CLI


*BUMP*

Thanks for the input Mark, and you were right I had the wrong user set.

That said......................... now I'm getting this

Can't locate object method "struct" via package "System" (perhaps you forgot to load "System"?) at

C:\Users\auser\Desktop\\Stingray\getConnectionSummary.pl line 50.