Re: WMI in Python
In message <210f30c4-22da-405f-ad4b-cc46841ca...@p22g2000pre.googlegroups.com>, alex23 wrote: > Lawrence D'Oliveiro wrote: > >> Because machine-generated >> code has no place in a source file to be maintained by a human. > > Endlessly repeating your bigotry doesn't make it any more true. The point is that it is machine-generated from an input command, therefore it makes sense from a maintenance viewpoint to keep the input command, not the machine-generated output, in the source file, and simply generate the latter from the former as part of the build process. -- http://mail.python.org/mailman/listinfo/python-list
Re: WMI in Python
Lawrence D'Oliveiro wrote: > Because machine-generated > code has no place in a source file to be maintained by a human. Endlessly repeating your bigotry doesn't make it any more true. -- http://mail.python.org/mailman/listinfo/python-list
Re: WMI in Python
In message <257b2d99-03d4-491b-8f8b-dccd2bc10...@p22g2000pre.googlegroups.com>, alex23 wrote: > Lawrence D'Oliveiro wrote: > >> Why not just call Scriptomatic directly from within the Python script, >> then? > > Because Scriptomatic _generates scripts to access WMI_, that's what it > _does_. Precisely why I suggested running it on the fly. Because machine-generated code has no place in a source file to be maintained by a human. > Are you _seriously_ advocating writing Python code to fire up > a Windows application, programmatically manipulating a GUI to generate > more Python code for your original script to import or exec? If that’s the only way you can use Scriptomatic, then the stupidity lies with the one who suggested using such a brain-dead tool in the first place. > As you've made your disdain for Windows _perfectly_ clear through your > incessant sniping on this list, I think I'm pretty safe in saying you > have no idea of the quality of Scriptomatic's output. The quality of the output is not at issue here. The point is that it is machine-generated from an input command, therefore it makes sense from a maintenance viewpoint to keep the input command, not the machine-generated output, in the source file, and simply generate the latter from the former as part of the build process. Unfortunately, as you have made abundantly clear above, Scriptomatic is a GUI-only tool, totally unsuited to this sort of use. -- http://mail.python.org/mailman/listinfo/python-list
Re: WMI in Python
On Sep 16, 12:39 pm, alex23 wrote: > Lawrence D'Oliveiro wrote: > > Why not just call Scriptomatic directly from within the Python script, then? > > Because Scriptomatic _generates scripts to access WMI_, that's what it > _does_. Are you _seriously_ advocating writing Python code to fire up > a Windows application, programmatically manipulating a GUI to generate > more Python code for your original script to import or exec? > > For your question to make any real sense, you'd want to ask "Why not > access WMI directly...", which you might notice was the first > recommendation I made. > > > Machine-generated code has no place in a source file to be maintained by a > > human. > > As you've made your disdain for Windows _perfectly_ clear through your > incessant sniping on this list, I think I'm pretty safe in saying you > have no idea of the quality of Scriptomatic's output. I don't > understand what possibly makes you believe you're qualified to make > such a statement. Thank you all looks I got lot of reading to be done now based on all your suggestions. -- http://mail.python.org/mailman/listinfo/python-list
Re: WMI in Python
Lawrence D'Oliveiro wrote: > Why not just call Scriptomatic directly from within the Python script, then? Because Scriptomatic _generates scripts to access WMI_, that's what it _does_. Are you _seriously_ advocating writing Python code to fire up a Windows application, programmatically manipulating a GUI to generate more Python code for your original script to import or exec? For your question to make any real sense, you'd want to ask "Why not access WMI directly...", which you might notice was the first recommendation I made. > Machine-generated code has no place in a source file to be maintained by a > human. As you've made your disdain for Windows _perfectly_ clear through your incessant sniping on this list, I think I'm pretty safe in saying you have no idea of the quality of Scriptomatic's output. I don't understand what possibly makes you believe you're qualified to make such a statement. -- http://mail.python.org/mailman/listinfo/python-list
Re: WMI in Python
In message , alex23 wrote: > However, for a quick & ready solution, have you looked at Microsoft's > Scriptomatic?[2] It's a handy little tool that lets you specify the > WMI query you want and produces code for you, with Python being one of > the targets. Why not just call Scriptomatic directly from within the Python script, then? Machine-generated code has no place in a source file to be maintained by a human. -- http://mail.python.org/mailman/listinfo/python-list
Re: WMI in Python
KING LABS wrote: > The following information is exactly what I am trying to collect for > the inventory. I can find vb scripts with googling. I want to do the > same with Python & Win32. Use Server/Client architecture . > Client(agent) updates the information to server. I highly agree with the recommendations for Tim Golden's WMI library. I once used it during an MS VBScript course for sys admins to produce python equivalents of the VBS code; it was far, _far_ easier to componentise & reuse python code than VBS. However, for a quick & ready solution, have you looked at Microsoft's Scriptomatic?[2] It's a handy little tool that lets you specify the WMI query you want and produces code for you, with Python being one of the targets. It _should_ be able to handle most of everything you're after, with the exception of Software Information (from memory that's not something WMI covers?). Once Scriptomatic has generated the bulk of the WMI code, that's the payload of your client-side script. There are many many many ways of doing simple client/server set ups in python, just google and pick one that works at a suitable abstraction level for you. Here's a straightforward sockets-based approach[3] (that I've never used but looks okay). 1: http://timgolden.me.uk/python/wmi/index.html 2: http://www.microsoft.com/downloads/en/details.aspx?FamilyID=09dfc342-648b-4119-b7eb-783b0f7d1178&displaylang=en 3: http://wdvl.internet.com/Authoring/python/client/watts06152009.html -- http://mail.python.org/mailman/listinfo/python-list
Re: WMI in Python
On Sep 14, 7:46 am, KING LABS wrote: > On Sep 14, 10:39 am, KING LABS wrote: > > > > > > > > > > > On Sep 13, 8:31 pm, Jerry Hill wrote: > > > > On Mon, Sep 13, 2010 at 8:45 AM, KING LABS wrote: > > > > Hi All, > > > > > I am new to programming and python, Being a system administrator I > > > > have chose Inventory (Software & Hardware ) as my first project. > > > > You'll probably want to look at the python WMI > > > module:http://timgolden.me.uk/python/wmi/index.html > > > > as well as the pywin32 module:http://sourceforge.net/projects/pywin32/ > > > > IIRC, there's been quite a bit of discussion about inventorying > > > installed software on the pywin32 mailing > > > list:http://mail.python.org/mailman/listinfo/python-win32 > > > > -- > > > Jerry > > > Thank you all, I will go through the links provided and suggestions. > > Shall get back to you on this soon. > > The following information is exactly what I am trying to collect for > the inventory. I can find vb scripts with googling. I want to do the > same with Python & Win32. Use Server/Client architecture . > Client(agent) updates the information to server. > > > > BIOS: > > System serial number, manufacturer, and model > Bios manufacturer, version, and date > > Processors: > > Type, count (how many of them), manufacturer, speed, and cache > > Memory: > > Physical memory type, manufacturer, capacity, and slot number > Total physical memory > Total swap/paging memory > > Video: > > Video adapter: Chipset/model, manufacturer, memory size, speed, and > screen resolution > > Display monitor: Manufacturer, description, refresh rate, type, serial > number, and caption > > Storage/removable devices: > > Manufacturer, model, size, type, speed( all when applicable) > > Drive letter, filesystem type, partition/volume size, free space > > Network adapters/telephony: > > Manufacturer, model, type, speed, and description > MAC and IP address, mask and IP gateway, DHCP server used > > Miscellaneous hardware: > > Input devices: Keyboard, mouse, and pointing device > Sound devices: Manufacturer name, type, and description > System slots: Name, type, and designation > System ports: Type, name, caption, and description > > Software Information: ( from registry & add/remove program ) > > Operating system: Name, version, comments, and registration info > Installed software: Name, publisher, version (from Add / Remove > software or Programs and Features menu) > Custom-specified registry queries (applicable to Windows OS) > > -- when I found Python :-) I downloaded from a Ms site many (+- 120) py programs for hardware and os stuff and collated them into one script. Astonishing amount of data in the innards of a computer, do not print some of the...@#! I meant to wrap it in a neat menu (any time now), but it is easy to use as is. A few of the options : 102 --- -List Terminal Services Terminals- 103 --- -List Terminal Services Permissions- 104 --- -List Terminal Services Session Settings- 105 --- - List Terminal Services Session Directory Settings- 106 --- - List Terminal Services Network Adapter- 107 --- -List Terminal Services Environment Settings- 108 --- -List Terminal Services Logon Settings- 109 --- -List Terminal Services General Settings- 110 --- -List Terminal Services Client Settings- 111 --- -List Terminal Services Terminal Settings- 112 --- -List Terminal Service Service Properties- 113 --- -List Info about Binary Files used on Computer- 114 --- -List Info about CODECS on this computer- 115 --- -List Installed Software- 116 --- -List Installed Software Features- Happy to send to you, will post it somewhere soon. -- http://mail.python.org/mailman/listinfo/python-list
Re: WMI in Python
On Sep 14, 10:39 am, KING LABS wrote: > On Sep 13, 8:31 pm, Jerry Hill wrote: > > > On Mon, Sep 13, 2010 at 8:45 AM, KING LABS wrote: > > > Hi All, > > > > I am new to programming and python, Being a system administrator I > > > have chose Inventory (Software & Hardware ) as my first project. > > > You'll probably want to look at the python WMI > > module:http://timgolden.me.uk/python/wmi/index.html > > > as well as the pywin32 module:http://sourceforge.net/projects/pywin32/ > > > IIRC, there's been quite a bit of discussion about inventorying > > installed software on the pywin32 mailing > > list:http://mail.python.org/mailman/listinfo/python-win32 > > > -- > > Jerry > > Thank you all, I will go through the links provided and suggestions. > Shall get back to you on this soon. The following information is exactly what I am trying to collect for the inventory. I can find vb scripts with googling. I want to do the same with Python & Win32. Use Server/Client architecture . Client(agent) updates the information to server. BIOS: System serial number, manufacturer, and model Bios manufacturer, version, and date Processors: Type, count (how many of them), manufacturer, speed, and cache Memory: Physical memory type, manufacturer, capacity, and slot number Total physical memory Total swap/paging memory Video: Video adapter: Chipset/model, manufacturer, memory size, speed, and screen resolution Display monitor: Manufacturer, description, refresh rate, type, serial number, and caption Storage/removable devices: Manufacturer, model, size, type, speed( all when applicable) Drive letter, filesystem type, partition/volume size, free space Network adapters/telephony: Manufacturer, model, type, speed, and description MAC and IP address, mask and IP gateway, DHCP server used Miscellaneous hardware: Input devices: Keyboard, mouse, and pointing device Sound devices: Manufacturer name, type, and description System slots: Name, type, and designation System ports: Type, name, caption, and description Software Information: ( from registry & add/remove program ) Operating system: Name, version, comments, and registration info Installed software: Name, publisher, version (from Add / Remove software or Programs and Features menu) Custom-specified registry queries (applicable to Windows OS) -- -- http://mail.python.org/mailman/listinfo/python-list
Re: WMI in Python
On Sep 13, 8:31 pm, Jerry Hill wrote: > On Mon, Sep 13, 2010 at 8:45 AM, KING LABS wrote: > > Hi All, > > > I am new to programming and python, Being a system administrator I > > have chose Inventory (Software & Hardware ) as my first project. > > You'll probably want to look at the python WMI > module:http://timgolden.me.uk/python/wmi/index.html > > as well as the pywin32 module:http://sourceforge.net/projects/pywin32/ > > IIRC, there's been quite a bit of discussion about inventorying > installed software on the pywin32 mailing > list:http://mail.python.org/mailman/listinfo/python-win32 > > -- > Jerry Thank you all, I will go through the links provided and suggestions. Shall get back to you on this soon. -- http://mail.python.org/mailman/listinfo/python-list
Re: WMI in Python
Very true most systems admins requirement range from : knoowing the Service tag for a given IP to knowing the system harware details such as RAM sizes etc. This is where Remote Inventory Management comes in handy. There is vault of already existing vb scripts/perl scripts and batch files. To me it looks fine if one can create a common interface and link the preexistant scripts. Else, wmi command line can be directly implemented in python through os.system("COMMAND WMI") so that redistributable python exe be created through py2exe Regards Prakash -- http://mail.python.org/mailman/listinfo/python-list
Re: WMI in Python
On Mon, Sep 13, 2010 at 8:45 AM, KING LABS wrote: > Hi All, > > I am new to programming and python, Being a system administrator I > have chose Inventory (Software & Hardware ) as my first project. You'll probably want to look at the python WMI module: http://timgolden.me.uk/python/wmi/index.html as well as the pywin32 module: http://sourceforge.net/projects/pywin32/ IIRC, there's been quite a bit of discussion about inventorying installed software on the pywin32 mailing list: http://mail.python.org/mailman/listinfo/python-win32 -- Jerry -- http://mail.python.org/mailman/listinfo/python-list
Re: WMI in Python
In article , KING LABS wrote: > >I would like to collect the complete information of system hardware & >and also software installed from registry and add/remove program and >feed this data into database. You should subscribe to the win32 mailing list: http://mail.python.org/mailman/listinfo/python-win32 Before you ask questions there, do a bit of searching first -- there are lots of examples. -- Aahz (a...@pythoncraft.com) <*> http://www.pythoncraft.com/ [on old computer technologies and programmers] "Fancy tail fins on a brand new '59 Cadillac didn't mean throwing out a whole generation of mechanics who started with model As." --Andrew Dalke -- http://mail.python.org/mailman/listinfo/python-list
Re: WMI in Python
On Sep 13, 2010, at 9:51 AM, KING LABS wrote: > I am trying to learn Python programming. Since I need a custom > inventory management tool for my work place. I am considering it as a > project in the process of learning Python. > > I am not looking for easiest way of doing things. > I am considering using Python . Also I would need to build a setup of > the tool for easy installation. > > Hope I am clear this time If you're looking for a rich client (i.e., desktop) application, and not a web app, you should check out Dabo: http://dabodev.com. We have hundreds of developers around the world using Dabo to build many different kinds of business applications. -- Ed Leafe -- http://mail.python.org/mailman/listinfo/python-list
Re: WMI in Python
On Sep 13, 6:42 pm, Rodrick Brown wrote: > The easiest way to do this is to use the native OS tools readily available to > do the collection and log to a central location or if possible shared > location accessible by all systems, once you have all the data you want to > feed into your RDBMS you could easily parse these logs using python and the > native db access module. > > I hope this give you a pointer. > > Sent from my iPhone 4. > > On Sep 13, 2010, at 8:45 AM, KING LABS wrote: > > > > > Hi All, > > > I am new to programming and python, Being a system administrator I > > have chose Inventory (Software & Hardware ) as my first project. > > > I would like to know experts advice on the best way to build the same > > using python. I would like to this tool to evolve into full fledge > > application. > > > I would like to collect the complete information of system hardware & > > and also software installed from registry and add/remove program and > > feed this data into database. > > > Regards, > > KINGLABS > > -- > >http://mail.python.org/mailman/listinfo/python-list I am trying to learn Python programming. Since I need a custom inventory management tool for my work place. I am considering it as a project in the process of learning Python. I am not looking for easiest way of doing things. I am considering using Python . Also I would need to build a setup of the tool for easy installation. Hope I am clear this time Regards, KINGLABS -- http://mail.python.org/mailman/listinfo/python-list
Re: WMI in Python
The easiest way to do this is to use the native OS tools readily available to do the collection and log to a central location or if possible shared location accessible by all systems, once you have all the data you want to feed into your RDBMS you could easily parse these logs using python and the native db access module. I hope this give you a pointer. Sent from my iPhone 4. On Sep 13, 2010, at 8:45 AM, KING LABS wrote: > Hi All, > > I am new to programming and python, Being a system administrator I > have chose Inventory (Software & Hardware ) as my first project. > > I would like to know experts advice on the best way to build the same > using python. I would like to this tool to evolve into full fledge > application. > > I would like to collect the complete information of system hardware & > and also software installed from registry and add/remove program and > feed this data into database. > > Regards, > KINGLABS > -- > http://mail.python.org/mailman/listinfo/python-list -- http://mail.python.org/mailman/listinfo/python-list
WMI in Python
Hi All, I am new to programming and python, Being a system administrator I have chose Inventory (Software & Hardware ) as my first project. I would like to know experts advice on the best way to build the same using python. I would like to this tool to evolve into full fledge application. I would like to collect the complete information of system hardware & and also software installed from registry and add/remove program and feed this data into database. Regards, KINGLABS -- http://mail.python.org/mailman/listinfo/python-list