How to install SIGAR on Ubuntu-based Linux?

后端 未结 5 759
温柔的废话
温柔的废话 2021-01-18 08:23

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 lin

相关标签:
5条回答
  • 2021-01-18 08:27

    just install sigar lib:

    sudo apt install libhyperic-sigar-java
    

    this works for me.

    0 讨论(0)
  • 2021-01-18 08:42

    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

    0 讨论(0)
  • 2021-01-18 08:44

    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
    
    0 讨论(0)
  • 2021-01-18 08:48

    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.

    0 讨论(0)
  • 2021-01-18 08:54

    @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
    
    0 讨论(0)
提交回复
热议问题