How to install SIGAR on Ubuntu-based Linux?
Asked Answered
V

5

7

I am using SIGAR in a java project with Maven and Spring. I have the Maven Dependency and Maven Repository included in my pom.xml file, as described in this link: http://mavenhub.com/mvn/thirdparty-uploads/org.hyperic/sigar/1.6.5.132

Furthermore, I am launching the program using Jetty (which launches the .war file created by mvn install).

However, SIGAR still won't work. Aparently I also need to install libsigar-amd64-linux-1.6.4.

So I downloaded that file, but now I have no idea what to do with it. How do I fix this? Where do I put that file?

Vanillin answered 19/2, 2014 at 22:37 Comment(0)
V
8

Finally found the solution. I had to download SIGAR from the official source.

Then I had to copy/paste the entire "lib" folder (with all the .so and .dll and whatnot) into the folder "main/src/webapp" of the project, which is used by Spring to store needed apps (or so I assume).

Then after running mvn install, checking the "target" folder and running the newly generated .war file, everything runs as expected.

Vanillin answered 23/2, 2014 at 18:52 Comment(1)
and what if the project is not a web project, it's a maven java application only??Accountancy
J
4

I believe it needs to be put into your programs library folder, alongside the "sigar.jar" file.

If you plan to run your program on other OS variants, you should also have a bunch of ".dll", ".so" and ".dylib" files in the same lib folder.

Edit: You can download sigar at the link below, it contains the lib files for all major platforms: http://sourceforge.net/projects/sigar/?source=navbar

Jaynajayne answered 19/2, 2014 at 23:10 Comment(0)
H
4

To install sigar on Linux, here is a copy/paste option:

wget https://netcologne.dl.sourceforge.net/project/sigar/sigar/1.6/hyperic-sigar-1.6.4.tar.gz
tar xvf hyperic-sigar-1.6.4.tar.gz
cd hyperic-sigar-1.6.4

# INSTALL
sudo cp sigar-bin/lib/libsigar-`dpkg --print-architecture`-`uname -s | tr '[:upper]' '[:lower]'`.so /usr/lib
Hanafee answered 27/2, 2018 at 16:48 Comment(1)
aitorhh please check @dambo14 's commentPliocene
E
3

@aitorhh This actually works, **But had some errors in your code, this works:

wget https://netcologne.dl.sourceforge.net/project/sigar/sigar/1.6/hyperic-sigar-1.6.4.tar.gz
tar xvf hyperic-sigar-1.6.4.tar.gz
cd hyperic-sigar-1.6.4

# INSTALL
sudo cp sigar-bin/lib/libsigar-`dpkg --print-architecture`-`uname -s | tr '[:upper:]' '[:lower:]'`.so /usr/lib
Electuary answered 5/2, 2019 at 17:2 Comment(0)
P
3

just install sigar lib:

sudo apt install libhyperic-sigar-java

this works for me.

Pretension answered 3/4, 2020 at 15:49 Comment(1)
This answer worked for me on Ubuntu 20.04. The libhyperic-sigar-java package in the repos is version 1.6.4, which is the latest (there hasn't been an updated release in 10 years).Pokorny

© 2022 - 2024 — McMap. All rights reserved.