Skip to content
This repository has been archived by the owner on Feb 20, 2021. It is now read-only.

running ./check_azure_sql.py #3

Open
wakarere opened this issue May 21, 2014 · 6 comments
Open

running ./check_azure_sql.py #3

wakarere opened this issue May 21, 2014 · 6 comments

Comments

@wakarere
Copy link

Hi
Could you please leave an example of how to run ./check_azure_sql.py? (all that need to be parameters that need to be parsed?)

Trying to check my test azure sql as a service

I have tried different variation but I am failing - this is what I am trying
./check_azure_sql.py vg78ixd54w -d testSql -u test -p Test8934 -k ??? dbsize -vv!

(not sure how to parse the key here? not sure where the key is - here is some of it in my azureProfile.json file)

would like to see something similar to what you have said here on a different issue -
check_azure_paas.py -p </path/to/psfile.publishsettings> -s <storage_account_name> <cloud_service> -vvv

@jeffmendoza
Copy link
Contributor

Ah, I believe the issue is that the keys are not listed in the README or the help output. You can see them here: https://github.com/MSOpenTech/wamo/blob/master/check_azure_sql.py#L399

So, something like

check_azure_sql.py  <my_server> -u <user> -d <database> -k dbsize

@wakarere
Copy link
Author

Hi Jeff,
I have tried few more time with different parameters - still not
connecting. There is a screenshot attached with the results.
Any other idea on what I might be doing wrong?

I appreciate your time/help.

[image: Inline image 1]

On Thu, May 22, 2014 at 5:17 AM, Jeff Mendoza [email protected]:

Ah, I believe the issue is that the keys are not listed in the README or
the help output. You can see them here:
https://github.com/MSOpenTech/wamo/blob/master/check_azure_sql.py#L399

So, something like

check_azure_sql.py <my_server> -u -d -k dbsize


Reply to this email directly or view it on GitHubhttps://github.com//issues/3#issuecomment-43787223
.

@jeffmendoza
Copy link
Contributor

I'm not seeing the image, can you copy&paste?

@wakarere
Copy link
Author

I have spent more time on it today - two steps forward, one step back. I have telnet into 1433 and that works. I have tried tsql - and this is failing as well. I believe it is not related to ./check_azure_sql.py but to a certificate. (what do you think?)

./check_azure_sql.py jgxxxx5kw.database.windows.net -d Mxxxxql -u xxxx@jgxxxx5kw -p xxxx -k dbsize
--I get this error:
'port' is not a string or unicode value'
Error connecting to database

image

when I try tsql I get ...
image

I am wondering if this is somehow related to a certificate of some kind. (I have install and can use the azure CLI but have not created and uploaded any certificates to azure.
here is from the freetds log: I guess the answer is staring me in the face...

image

Please let me know if I am missing something obvious and/or if there is something I can try...
Thank you

@wakarere
Copy link
Author

I was able to resolve my tsql issue - I am now able to connect.
image

I am still not successful using ./check_azure_sql.py - is there a way to enable logging so I am able to see where/why it is failing? - it is failing with 'port' is not a string or unicode value' (I am not sure where is this being parsed from)
image

@v4li
Copy link

v4li commented Sep 5, 2014

I was facing the same issue, first FreeTDS issue (showed up that it was issue of FreeTDS ODBC driver - I have added the driver
In /etc/odbcinst.ini:

[FreeTDS]
Description=FreeTDS Driver
Driver=/usr/lib/odbc/libtdsodbc.so
Setup=/usr/lib/odbc/libtdsS.so
Driver64=/usr/lib64/libtdsodbc.so
Setup64=/usr/lib64/libtdsS.so
(the path depends on your OS and ODBC version - if you have just lib64 drivers, create a symb. link to them also in /usr/lib/)

Afterwards i faced also the same problem as you, getting the port is not a string..
I have checked the code - especially the connection string and I found out that the 1433 port number commes here without apostrofs, so I have modified the value to
port = '1433' and it worked for me like a charm

There would be another way how to get the connection string from freetds.conf file, but it is more complicated solution.

Also than I had a problem connection to db with non-administrator user. Error that I got was - cannot connect to Master database. This problem disappeared when I have used the administrator user (this is the only one who can access master database)

I hope I saved some of your time.. ;)

Bye

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants