October by Simon Krenger
One excellent tool for Systems Management on Windows is the Windows Management Instrumentation (WMI), which allows remotely execute commands and query parameters on a Windows Host. Of course, all modern Windows systems have the WMI Client installed, but what about the Linux clients?
To get the same functionality on a Linux system (I am using Debian into this example), we need to get the following two pack Ages from this website:libwmiclient1_1.3.14-3_amd64.deb wmi-client_1.3.14-3_amd64.deb
Make sure to the correct packages for your architecture and Linux distribution. Then install these two packages such as:
root@qcore:~# dpkg-i Libwmiclient1_1.3.14-3_amd64.deb
root@qcore:~# dpkg-i Wmi-client_1.3.14-3_amd64.deb
Now we are ready to go. The following example shows the size of the the workingset of the process "Java.exe" running on the remote Host 192.168.20.20:
Wmic-u administrator%mysecret//192.168.20.20 "Select WorkingSetSize from Win32_Process Where CommandLine like '%java.ex E% ' "
Update: I added a set of examples here.
I really like the sql-like syntax (they call it WQL) and the fact, can query virtually any parameter of a Windows Host. In the future, I might create another post and my Nagios scripts this use WMI for monitoring. For the examples and the documentation of WMI, refer to the corresponding Microsoft TechNet site.