http://qs321.pair.com?node_id=966007

rbattu has asked for the wisdom of the Perl Monks concerning the following question:

HI, Is it possible to connect to a remote Windows 2008 server from a Linux server? I need to retrieve the information related to the CPU,disk and memory. Win32::OLE might be good if the client is Windows. Is there any module like that to run on Linux machine?

Replies are listed 'Best First'.
Re: How to connect remote Windows from Linux server?
by Sinistral (Monsignor) on Apr 19, 2012 at 16:01 UTC

    What you're describing sounds like network monitoring software. Three free and open source example is Nagios, Zabbix, and Zenoss. All of these have available Windows programs and/or services that capture the information about CPU, disk, and memory. Then you can run the monitoring agent to collect this informaiton on Linux. The tools, services, and programs are available in all of these (and many more listed in the Wikipedia article). Choose one and go with it.

    Update

    You could also use SNMP on the Windows Server and collect the information using Net::SNMP in Perl on your Linux machine

      No , I am not looking for SNMP tools.

      Let me explain you the actual requirement. I have script that creates the windows vms dynamically. I cannot contact these vms from my desktop through the existing script(using Win32::OLE, psinfo,and other WMI protocols), since VMs are behind firewall.So I created a Linux VM in the same subnet. I can talk to the Linux machine through SSH protocol.Now I want a script that can fetch the information like cpucount, memory and disk size of the neighbor Windows VMs. I have the Admin password for these vms.I would want my script to be light weight and easy run on the Linux server.

            No , I am not looking for SNMP tools.

        Neither is Sinistral.

        While I cannot speak to the other tools I know that Nagios allows you to write plugins to do much. If you can write in Perl (or other languages) and the plugin you write returns to the calling environment certain values you can make Nagios do whatever you need.

        I've even seen Nagios used to monitor the temperature of a kegerator.

        Check out the Nagios exchange. What you need may already be written by somebody.


        Peter L. Berghold -- Unix Professional
        Peter -at- Berghold -dot- Net; AOL IM redcowdawg Yahoo IM: blue_cowdawg

        Depending on your VM environment, you might be able to use the native VM API, for example VMware VI API (exposed as a Web service) and VI Perl Toolkit.

        Wouldn't it be much easier to get ssh access to your Windows VM, instead of setting up a Linux VM with ssh access, which then needs access to said Windows VM?