Installation Terminal Session Fedora 33 (Legacy)

This page shows a terminal session that includes:

  • Install and compile of the legacy wmic command line binary
  • wmic testing

This is all performed on a freshly installed Fedora 33 Server virtual machine. This is a minimal installation of Fedora Server that does not even include perl.
Some of the output has been collapsed because it is very large!
Some notes (not part of the original terminal session!) are in blue

Package Installation

Install some packages that we need. There is no Nagios on this machine so we have to install nagios-plugins-perl at the very least to get the Nagios utils.pm

fed33:~# dnf -y install wget time make gcc autoconf nagios-plugins-perl perl-Config-IniFiles perl-DateTime perl-Scalar-List-Utils perl-Number-Format perl-FindBin perl python

Fedora 33 openh264 (From Cisco) – x86_64 2.3 kB/s | 2.5 kB 00:01
Fedora Modular 33 – x86_64 3.2 MB/s | 3.3 MB 00:01
Fedora Modular 33 – x86_64 – Updates 3.5 MB/s | 3.1 MB 00:00
Fedora 33 – x86_64 – Updates 8.2 MB/s | 26 MB 00:03
Fedora 33 – x86_64 9.4 MB/s | 72 MB 00:07
Package wget-1.20.3-8.fc33.x86_64 is already installed.
Package time-1.9-10.fc33.x86_64 is already installed.
Dependencies resolved.

Complete!

Source Extraction

Extract the source (which you already downloaded from this site)

fed33:~# cd /tmp

fed33:/tmp# tar zxvf /opt/nagios/rpm/wmi-1.4.1.tar.gz

wmi-1.4.1/
wmi-1.4.1/config.log
wmi-1.4.1/config.mk


wmi-1.4.1/heimdal_build/err.h
wmi-1.4.1/heimdal_build/roken.h
wmi-1.4.1/pyinclude.py

Compiling

Now compile the source

fed33:/tmp# cd wmi-1.4.1

fed33:/tmp/wmi-1.4.1# make “CPP=gcc -E -ffreestanding”

File “<string>”, line 1

cd Samba/source ; \
cp bin/winexe /bin ; \
cp bin/wmic /bin ; \
cp bin/shared/*async_wmi_lib.so.0* /lib/python
cp: cannot stat ‘bin/shared/*async_wmi_lib.so.0*’: No such file or directory
make: *** [GNUmakefile:42: pywmi-installed] Error 1

Even though there are many warnings and the entire seems to have errored out, it did actually compile and install wmic, which is what we wanted.

Testing

Show the wmic version

fed33:/tmp/wmi-1.4.1# wmic –version

Version 1.4.1tp4-SVN-build-UNKNOWN

Run a generic wmic query

fed33:/tmp/wmi-1.4.1# wmic ‘-U’ ‘USER%PASS’ ‘–namespace’ ‘root/cimv2’ ‘//HOST’ ‘Select BuildNumber,Caption,CreationClassName From Win32_OperatingSystem’

CLASS: Win32_OperatingSystem
BuildNumber|Caption|CreationClassName
19042|Microsoft Windows 10 Pro|Win32_OperatingSystem

Build number 19042 is Windows 10 Version 20H2

Updated: April 2021