Python, unix and mssql

F

francisl

We have to build some script were I work to make a dynamic server inventory.

But, the project team, a windows crew, start it all in vbscript and on
mssql. Note, due to political reason, we can not use mysql or anyother
one that are not *authorize*, it's oracle or mssql. Now we have to make
it work also with our sun and HP unix server(plus one Linux).

So I propose to use python, and after they see my litle python/wxwindow
program, that list windows registry value relate to SUS automatic update
and that let it remotely force a check. They were amaze on how short it
took to make us save a lot of time. - Windows by default put a static
value in its LastWaitTimeout key, in their doc they said 48 hrs. But 48
hrs is to long for a good schedule on production server. Plus it give us
headaches to validate all the update on our network. (~75 winnt/2k/2k3
servers)

back to subject
Question.
Can we, directly from unix select and insert data in a remote mssql
database?

if not, my second though was to put a litle python server on the server
holding the mssql database, which will accept request and insert it in
the database. But is that possible?

Thank you
 
P

Peter Hansen

francisl said:
Can we, directly from unix select and insert data in a remote mssql
database?

Sorry, I can't answer that one.
if not, my second though was to put a litle python server on the server
holding the mssql database, which will accept request and insert it in
the database. But is that possible?

Definitely possible. You could, for example, use Pyro
quite effectively for something like that.

-Peter
 
S

Steve Holden

francisl said:
We have to build some script were I work to make a dynamic server
inventory.

But, the project team, a windows crew, start it all in vbscript and on
mssql. Note, due to political reason, we can not use mysql or anyother
one that are not *authorize*, it's oracle or mssql. Now we have to make
it work also with our sun and HP unix server(plus one Linux).

So I propose to use python, and after they see my litle python/wxwindow
program, that list windows registry value relate to SUS automatic update
and that let it remotely force a check. They were amaze on how short it
took to make us save a lot of time. - Windows by default put a static
value in its LastWaitTimeout key, in their doc they said 48 hrs. But 48
hrs is to long for a good schedule on production server. Plus it give us
headaches to validate all the update on our network. (~75 winnt/2k/2k3
servers)

back to subject
Question.
Can we, directly from unix select and insert data in a remote mssql
database?

if not, my second though was to put a litle python server on the server
holding the mssql database, which will accept request and insert it in
the database. But is that possible?

Thank you

If ODBC access is permissible then you could, for example, use mxODBC on
top of one of the generic ODBC drivers for Unix.

Since Oracle is also an "approved" database you might also want to think
about using the cxOracle module, which AFAIK is available on both
Windows and Unix-like platforms.

There are several ways you could have remote Python processes talking to
each other. Pyro is a package that would let you handle this situation
relatively easily, and I'm sure others will chime in with their favored
solutions.

regards
Steve
 
S

Scott David Daniels

francisl said:
Can we, directly from unix select and insert data in a remote mssql
database?
In some sense you can. I used python and mxODBC to talk ODBC protocol
to DB2 / MS SqlServer / Access. It was quite a while ago, and I may
have had to use an odbc-on-linux piece I don't know about. But the
upshot was that my (large, data and CPU-intensive) program ran portably
on both Win2K and Linux. The mxODBC solution will cost money, but not
a lot (and MAL has done a great job letting you discover things about
the far end of the ODBC connection -- development is simple). The
switch between databases was really minimal effort on my part -- the
sysadmin who had to create and backup the DBs was not as sanguine about
the changes. Check with Marc-Andre about the current state of the art
for linux ODBC drivers.
if not, my second though was to put a litle python server on the server
holding the mssql database, which will accept request and insert it in
the database. But is that possible?
This is also easy, and you can simply design a little socket watcher to
get commands, execute them, and return results.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top