3

Has anyone managed to get wmic installed onto Ubuntu 16.04 LTS Server? These instructions worked on 14.04 (including for people on 14.04) but I'm hitting error after error on 16.04 and wondered if anyone else had success

cd /tmp
mkdir wmic
cd wmic

apt install autoconf gcc libdatetime-perl make build-essential g++ python-dev
wget http://www.opsview.com/sites/default/files/wmi-1.3.16.tar_.bz2
bunzip2 wmi-1.3.16.tar_.bz2
tar -xvf wmi-1.3.16.tar_
cd wmi-1.3.16/

vim Samba/source/pidl/pidl
:583 (to jump to line 583)
remove the word defined before @$pidl
:wq 

export ZENHOME=/usr
make "CPP=gcc -E -ffreestanding"
cp Samba/source/bin/wmic /bin

Many thanks

2

2 Answers 2

5

In the interest of knowledge sharing here is how to get wmic working on Ubuntu 16.04 LTS, the issue was the limit of the number of open files

ulimit -n 100000
cd /tmp
mkdir wmic
cd wmic

apt install autoconf gcc libdatetime-perl make build-essential g++ python-dev
wget http://www.opsview.com/sites/default/files/wmi-1.3.16.tar_.bz2
bunzip2 wmi-1.3.16.tar_.bz2
tar -xvf wmi-1.3.16.tar_
cd wmi-1.3.16/

vim Samba/source/pidl/pidl
:583 (to jump to line 583)
remove the word defined before @$pidl
:wq 

export ZENHOME=/usr
make "CPP=gcc -E -ffreestanding"
cp Samba/source/bin/wmic /bin

Should now be working.

1
3

followed the steps in trevrobwhite's answer and was stuck at this:

Linking bin/wmic
bin/static/libtls.a(tls.o): In function `tls_init_server':
/tmp/wmic/wmi-1.3.16/Samba/source/lib/tls/tls.c:508: undefined reference to `gnutls_transport_set_lowat'
bin/static/libtls.a(tls.o): In function `tls_init_client':
/tmp/wmic/wmi-1.3.16/Samba/source/lib/tls/tls.c:579: undefined reference to `gnutls_certificate_type_set_priority'
/tmp/wmic/wmi-1.3.16/Samba/source/lib/tls/tls.c:587: undefined reference to `gnutls_transport_set_lowat'
collect2: error: ld returned 1 exit status
Makefile:9029: recipe for target 'bin/wmic' failed
make[1]: *** [bin/wmic] Error 1
make[1]: Leaving directory '/tmp/wmic/wmi-1.3.16/Samba/source'

searched a bit for those functions and they seem to be obsolete and can be removed (as seen being done here https://git.kernel.org/pub/scm/network/connman/connman.git/tree/gweb/giognutls.c?id=HEAD )

diff wmi-1.3.16_fixed/Samba/source/lib/tls/tls.c wmi-1.3.16/Samba/source/lib/tls/tls.c
507a508
>   gnutls_transport_set_lowat(tls->session, 0);
577a579
>   gnutls_certificate_type_set_priority(tls->session, cert_type_priority);
584a587
>   gnutls_transport_set_lowat(tls->session, 0);

can now compile and wmic appears to work fine

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.