Установка ocs inventory agent linux
Welcome to part 3 of the series on Installing OCS Inventory NG. In this part of the series we will cover installing the UNIX Agent on CentOS 6 (RHEL 6.0 based).
Note: OCS Inventory NG Agent for Linux can only be installed locally and cannot be deployed using package manager.
Now let’s get started and download the agent from here.
For Linux / Unix these are the required modules.
- Perl module XML::Simple
- Perl module Compress::Zlib
- Perl module Net::IP
- Perl module LWP::UserAgent
- Perl module Digest::MD5
- Perl Module Net::SSLeay
- Perl Module Mac::SysProfile is need on MacOSX
dmidecode
lspci on Linux and *BSD (pciutils package)
Make utility
C/C++ compiler like GNU GCC
- Perl module Proc::Daemon
- Perl module Proc::PID::File if Proc::Daemon is installed
- Perl module Net::SNMP
- Perl module Nmap::Parser
- Perl module Module::Install
- Perl module Net::CUPS
- Perl module perl-cpan
Now that we know what we need for the installation, let’s get started in getting them installed. As noted in OCS Inventory Ng Part 1 we need to have the EPEL repository installed. If you do not have it installed you can do so by following the following instructions.
Go to http://http://fedoraproject.org/wiki/EPEL and download and install the EPEL release based on your distribution release. In this example we are running 6.0 release, so EL6 is the chosen package. After installing you are ready to proceed.
Open a terminal session and run the following command to install the prerequisites.
$ sudo yum install perl-XML-Simple perl-Compress-Zlib perl-Net-IP perl-libwww-perl perl-Digest-HMAC perl-Digest-SHA1 perl-Net-SSLeay
perl-Crypt-SSLeay perl-Net-SNMP perl-Proc-Daemon perl-Proc-PID-File pciutils smartmontools monitor-edid
We will also need build utilities as well
$ sudo yum groupinstall “Development Tools” # This will ensure that you have all the required tools for the build.
$ sudo yum install ncurses-devel # This is required to enable a make *config command to execute correctly.
$ sudo yum install qt-devel # This is only necessary if you wish to use make xconfig instead of make gconfig or make menuconfig.
Any dependencies needed will be downloaded and installed. Now we are ready to install the agent.
Change to the directory where you downloaded the agent an un-tar it and change into the directory.
$ tar –xvf Ocsinventory-Unix-Agent-2.0.1.tar.gz
$ cd Ocsinventory-Unix-Agent-2.0.1
No lets build and install it using perl
A check for PERL interpreter binary, C/C++ compiler and make utility is made during installation. If one of these components is not found, setup will stop.
- dmidecode binary.
- Compress::Zlib PERL module
- XML::Simple PERL module
- Net::IP PERL module
- LWP::UserAgent PERL module
- Digest::MD5 PERL module
- Net::SSLeay PERL module
If not found, it will ask you if you wish to install it. Enter “y” or validate to enable install of required component. If you enter “n”, setup will stop here.
Configuration begin. Choice to configure agent now or later.
Select the path of configuration file directory
Validation to create the directory, and definition of OCS Inventory NG server address (IP address or hoshtname.domain)
You will then have to choose between 3 methods for generating inventory:
- http: computer is connected to the network and is able to reach the Communication server with HTTP protocol. USED BY DEFAULT
- https: computer is connected to the network and is able to reach the Communication server with HTTPS protocol. You have to configure SSL on your OCS Server and copy the SSL certificate on the agent directory to use this method
- local: computer is not connected to the network and inventory will be generated in a file to manually send to OCS Inventory NG operator. This option must be set manually in ocsinventory-agent.conf like this :
Syntax : http[s]://ocsinventory-ng-server[:port]/ocsinventory
ocsserver.domains.local https://w.x.y.z ocsserver.domains.local:1234 https://ocsserver.domains.local
Choice to use or not apache auth, and possibility to define an administrative tag
Choice to create or not a cron task, definition and validation of agent files directory
Choice to remove or not the old agent version
Choice to use or not software deployment feature, SNMP scans feature and send an inventory
If Accountinfo file doesn’t exist, it will be created, and the inventory will be sent to the server
Now we have a Windows and a Linux agent installed and they have both reported inventory to the management server. Next part we start exploring the interface and some of the features of OCS Inventory NG.
Install the OCSInventory agent on Ubuntu 18.04 / Linux Mint 19?
Recently, I taught you how to install OCSInventory on Debian 10. But as you know, that was the server. Now, I will teach you how to install the OCSInventory agent in Ubuntu 18.04 and how to make the server register it.
Install OCSInventory agent on Ubuntu 18.04 / Linux Mint 19
First of all, the system needs to be upgraded.
Open a terminal session and run the following command:
:~$ sudo apt update :~$ sudo apt upgrade
This step is vital for the agent to do the job properly. It also allows him to gather more and better information from the computer.
This client is also written in Perl language, so we have to install some libraries first:
:~$ sudo apt install libmodule-install-perl dmidecode libxml-simple-perl libcompress-zlib-perl libnet-ip-perl libwww-perl libdigest-md5-perl libdata-uuid-perl
Then, we can install the OCSInventory agent in two ways.
The first is by manually compiling the source code. This option has the advantage that we can get the latest version of it, but it is something more complex and in a business environment may not be suitable.
On the other hand, the program is available from official repositories. This method sacrifices a little bit of the novelties for the sake of stability and ease of installation.
To install it, we will use the second option, therefore, run the following command
:~$ sudo apt install ocsinventory-agent
So, we need to configure it.
Configuring the OCSInventory agent
During installation, a customer configuration screen will be displayed. This first screen asks where the server is.
If the agent is being installed in the same computer where the server is, choose the first option. If not, choose the second one.
Then, you will see another screen where you have to indicate the IP address or the hostname of the computer where the OCSInventory server is installed.
Then the installation will be finished.
In case you make a mistake in this step, do not worry, you can always rectify it by modifying the file /etc/ocsinventory/ocsinventory-agg .
The synchronization with the server is done via crontab daily. However, we can force this synchronization with the following command:
:~$ sudo ocsinventory-agent --server [server]
You’ll see something like this:
Now, access your OCSInventory server and you’ll see that it’s been added correctly.
And that’s it. Now we invite you to explore all the new possibilities with this tool.
Conclusion
Thanks to OCSInventory for the inventory work, and it makes it much easier. And always with a fairly high degree of accuracy. So today, you have learned how to install the OCSInventory agent on Ubuntu 18.04 and Linux Mint 19. So all that remains is for you to get the most out of the tool.
Please share our post and join our Telegram channel.
Установка ocs inventory agent linux
OCS Inventory has now his own repository for Debian based and Redhat based distributions. You will find below how to install OCS Inventory agent unix using our repository
Installing UNIX Agent with APT
On Debian-based distributions you can install the agent with APT
You need to add our repository using the following command
$ curl -sS http://deb.ocsinventory-ng.org/pubkey.gpg | sudo apt-key add - $ echo "deb http://deb.ocsinventory-ng.org/debian/ main" | sudo tee /etc/apt/sources.list.d/ocsinventory.list $ sudo apt update
You will have to replace by one of the following term depending on the installation context :
- bullseye | stable
- buster | oldstable
- stretch | oldoldstable
- sid | unstable
Then install the agent using :
$ sudo apt install ocsinventory-agent
On Ubuntu-based distributions you can install the agent with APT
You need to add our repository using the following commands :
$ curl -sS http://deb.ocsinventory-ng.org/pubkey.gpg | sudo apt-key add -
Note : apt-key is now deprecated as of Ubuntu 22.04, and will issue a warning. We recommend using the below gpg alternative :
$ curl -fsSL http://deb.ocsinventory-ng.org/pubkey.gpg | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/ocs-archive-keyring.gpg
$ echo "deb http://deb.ocsinventory-ng.org/ubuntu/ main" | sudo tee /etc/apt/sources.list.d/ocsinventory.list $ sudo apt update
You will have to replace by one of the following term depending on the installation context :
Then install the agent using :
$ sudo apt install ocsinventory-agent
Installing UNIX Agent with RPM
On Redhat/Centos 7 you can install the unix agent with RPM
You need to have «wget» to download the repo of EPEL and OCS
$ sudo wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm $ sudo wget https://rpm.ocsinventory-ng.org/ocsinventory-release-latest.el7.ocs.noarch.rpm
You can install the repo with «yum»
$ sudo yum install ocsinventory-release-latest.el7.ocs.noarch.rpm epel-release-latest-7.noarch.rpm
To install the unix agent and requirement use this command:
$ sudo yum install ocsinventory-agent
On Redhat/Centos 8 you can install the unix agent with RPM
You need to have «wget» to download the repo of EPEL and OCS
$ sudo wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm $ sudo wget https://rpm.ocsinventory-ng.org/ocsinventory-release-latest.el8.ocs.noarch.rpm
You can install the repo with «dnf»
$ sudo dnf install ocsinventory-release-latest.el8.ocs.noarch.rpm epel-release-latest-8.noarch.rpm
To install the unix agent and requirement use this command:
$ sudo dnf --enablerepo=PowerTools --enablerepo=epel-playground install ocsinventory-agent
On Oracle Linux 8 and superior, you’ll have to enable the CodeReady Builder repository instead of Powertools to install the agent, e.g. for Oracle Linux 8 :
$ sudo dnf --enablerepo=ol8_codeready_builder install ocsinventory-agent
On Rocky/Alma and RHEL 9 you can install the unix agent with RPM
You need to have «wget» to download the repo of EPEL and OCS
$ sudo wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm $ sudo wget https://rpm.ocsinventory-ng.org/ocsinventory-release-latest.el9.ocs.noarch.rpm
You can install the repo with «dnf»
$ sudo dnf install ocsinventory-release-latest.el9.ocs.noarch.rpm epel-release-latest-9.noarch.rpm
To install the unix agent and requirement use this command:
$ sudo dnf install yum-utils $ sudo yum-config-manager --enable crb $ sudo dnf install ocsinventory-agent
On Fedora you can install the unix agent with RPM
You need to have «wget» to download the OCS’s repo
$ export FEDORA_VERSION=$(awk '' /etc/fedora-release) $ sudo wget https://rpm.ocsinventory-ng.org/ocsinventory-release-latest.fc$FEDORA_VERSION.ocs.noarch.rpm
You can install the repo with «dnf»
$ sudo dnf install ocsinventory-release-latest.fc$FEDORA_VERSION.ocs.noarch.rpm
To install the unix agent and requirement use this command:
$ sudo dnf install ocsinventory-agent
Note : The unix agent gonna be installed with default settings.