Install WMIC on Raspbian to track the performance of Windows Machines
While setting up an Observium Server on a Raspberry Pi (Surprise, Surprise) I noticed that the documentation allowed for the capture of CPU, RAM and MSSQL data via WMIC but lacked a method to get WMIC enabled on Raspbian. No luck with finding a WMIC package with apt-get, but a quick google search brought me to a github page with some code that got WMIC up and running with minimal hassle. I quickly a script using the following method and had WMI up and running in
no time about 25 minutes. Here is how I did it.
- Create the installwmic.sh by running the command “sudo pico installwmic.sh”, copy the following code, paste it, control-x to exit, save and exit. NOTE: I prefer pico as a text editor (Warning: die hard Linux nerds will call you a noob.), but you can also accomplish the same with VI, VIM, NANO, etc. You can learn more about text editors on the Raspberry Pi Homepage.
1234567891011121314#!/bin/bash# compiles WMIC for linuxapt-get install autoconfcd /usr/srcwget http://www.openvas.org/download/wmi/wmi-1.3.14.tar.bz2bzip2 -cd wmi-1.3.14.tar.bz2 | tar xf -cd wmi-1.3.14/make "CPP=gcc -E -ffreestanding"cp Samba/source/bin/wmic /usr/local/binexit 0
- Set proper permissions to the newly created script with the command “sudo chmod 755 ./installwmic.sh”
- Run the the script with “sudo ./installwmic.sh” and wait…
- Watch all the text flow through the terminal as the script works it’s magic.
- Continue to wait.
- Eventually it will finish and WMIC is installed for use in your other Raspberry Pi Projects!
- Confirm by running the command “wmic” in the terminal and you should be greeted with the usage info!