OCS Server Installation

  1. Install this on Centos 7
  2. Disable selinux
    setenforce 0
  3. Install wget
    yum install wget -y
4echo “net.ipv6.conf.all.disable_ipv6 = 1” >> /etc/sysctl.conf
5echo “net.ipv6.conf.default.disable_ipv6 = 1” >> /etc/sysctl.conf
6echo 1 > /proc/sys/net/ipv6/conf/all/disable_ipv6
7echo 1 > /proc/sys/net/ipv6/conf/default/disable_ipv6
8yum -y update
9yum -y install httpd mariadb mariadb-server php php-mysql php-fpm
10yum -y install epel-release
11yum -y install php-mbstring php-gd httpd-devel php-mcrypt php-mysql php-ZendFramework-Db-Adapter-Pdo-Mysql sqlite php-mcrypt php-soap
12yum -y install rpm-build redhat-rpm-config
13yum -y install telnet-server telnet nmap
14yum -y install proj
15yum -y install tinyxml
16yum -y install mod_perl perl-Archive-Zip perl-CPAN perl-YAML
17yum -y install perl-Digest-SHA1 php-pecl-zip php-gd php-gd perl-XML-Simple perl-Net-IP perl-SOAP-Lite httpd-devel perl-DBI perl-DBD-MySQL perl-Compress-Zlib perl-Apache-DBI
18yum -y install –enablerepo=epel perl-XML-Entities
19chmod 755 -R /var/www/
20printf “<?php\nphpinfo();\n?>” > /var/www/html/info.php;
21systemctl start mariadb
22systemctl start httpd
23systemctl enable httpd
24systemctl enable mariadb
  1. Launch MySQL Secure Installation script/usr/bin/mysql_secure_installation
  2. Install additional packagecpan XML::Entities cpan Apache::DBI cpan ModPerl::MM cpan Apache2::SOAP cpan Mojolicious::Lite cpan Switch cpan Plack::Handler (or) yum install "perl(XML::Entities)" yum install "perl(Apache::DBI)" yum install "perl(ModPerl::MM)" yum install "perl(Apache2::SOAP)" yum install "perl(Mojolicious::Lite)" yum install "perl(Switch)" yum install "perl(Plack::Handler)"
  3. Exclude ports 80 for Apache, 3306 for MySQL and 25 for SMTP from iptablesfirewall-cmd --zone=public --add-port=80/tcp --permanent firewall-cmd --zone=public --add-port=3306/tcp --permanent firewall-cmd --zone=public --add-port=25/tcp --permanent firewall-cmd --reload
  4. Install and activate the REMI and EPEL RPM Repositorieswget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm && wget http://rpms.famillecollet.com/enterprise/remi-release-7.rpm && rpm -Uvh *.rpm
  5. Update PHPyum update php* --enablerepo=remi -y
  6. Verify the new PHP versionphp -v PHP 5.4.45 (cli) (built: Mar 1 2018 09:57:11) Copyright (c) 1997-2014 The PHP Group Zend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies
  7. Download OCS Inventory and run setupOCS_VER=2.4.1 && cd /var/www/html && wget https://github.com/OCSInventory-NG/OCSInventory-ocsreports/releases/download/2.4.1/OCSNG_UNIX_SERVER_$OCS_VER.tar.gz && tar -xzvf OCSNG_UNIX_SERVER_$OCS_VER.tar.gz && cd OCSNG_UNIX_SERVER_$OCS_VER && ./setup.sh
  8. Increase post_max_size and upload_max_filesize in /etc/php.inipost_max_size = 200M upload_max_filesize = 200M
  9. Restart Apacheservice httpd restart
  10. Add write permission to the directorychmod +w /var/lib/ocsinventory-reports
  11. Run mysql_upgrademysql_upgrade -u root -p[password]
  12. Create OCS user in MySQL and assign privileges for OCSWEB databasemysql -u root -p [password] GRANT ALL PRIVILEGES ON `ocsweb` .* TO 'ocs'@'localhost' IDENTIFIED BY 'ocs' WITH GRANT OPTION; FLUSH PRIVILEGES;
  13. Perform initial OCS config then login to OCSURL: [IP Address]/ocsreports Login: admin Password: admin MySQL login: ocs MySQL password: [your password when setting up MySQL] Name of Database: ocsweb MySQL Hostname: localhost
  14. Change ‘Trace Deleted’ config to ‘ON’ in OCS. Config > Config > Server


  1. Remove install scriptrm -f /usr/share/ocsinventory-reports/ocsreports/install.php

Installation of OCS Agent on Client

Windows

Run “OCS-NG-Windows-Agent-Setup.exe” on client computer..

Icone installer Windows Agent

..and click “Next” button

Start Installation

Validate license agreement by clicking “I agree” button.

Accept Licence

Select the installation type you want:

  • Network inventory: Computer can reach OCS Inventory NG Server through the network, and so, Agent will be launched using either a Windows Service, or a Logon/GPO script.
  • Local inventory: Computer is not connected to a network, or will never be able to reach OCS Inventory NG Server. You can generate an inventory of this computer and save to file to be imported later on server (see chapter Generating inventory of a non network connected Windows computer below).
Choose components

Fill in OCS Inventory NG Communication server URL

Change properties

If needed, select proxy type to use to connect to Communication Server, proxy address and port, and proxy credentials if required (these credentials will be encrypted to be stored into configuration file). Agent support HTTP, SOCKS 4 and SOCKS 5 proxies.

Proxy Properties

By default, OCS Inventory Agent write only few information in log files. You may increase this enabling “Verbose log”. You may also disable TAG question, or specify the TAG value. Last, indicate which level of system integration you need:

  • Do not register service using LocalSystem account (i.e, use standalone agent, which must be launched manually or using login script).
  • Do not configure OCS Inventory NG Systray Applet to start automatically when user log in. This applet allows user to manually run agent, or to display inventory information. Disabling this option does not create shortcut link in “All users” startup menu.
  • Launch inventory just at the end of setup.
Windows Properties

Choose destination folder, “C:\Program Files\OCS Inventory Agent” by default (“C:\Program Files (x86)\OCS Inventory Agent” under Windows 64 bits), and click “Install” button.

Install Location

Click “Finish” button to close OCS inventory NG Agent Setup.

End of the installation

This is the interactive installation setup. However, this process requires that you launch it under all your computers.

Linux

OCS Inventory NG agent for Linux can only be set up locally. You cannot deploy the agent through the network currently as this is possible for Windows agent. However, you can choose during setup to activate auto-update of the agent if you’ve chosen HTTP inventory method.

On Fedora/Redhat/Centos7 like Linux, you can use “yum” tool to set required modules up like following:

$ sudo yum install perl-XML-Simple perl-devel perl-Compress-Zlib perl-Net-IP perl-LWP perl-Digest-MD5 perl-Net-SSLeay perl-Data-UUID

Optional modules: these modules are available on EPEL repository. Don’t forget to add this repository to your system or download each package individually from the repository

$ sudo yum install perl-Crypt-SSLeay perl-Net-SNMP perl-Proc-Daemon perl-Proc-PID-File perl-Sys-Syslog pciutils smartmontools monitor-edid

Installing Linux 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

Here is a sample configuration file for OCS Inventory NG Linux agent.

<CONF>
    <DEVICEID>computer.domain.tld-2006-02-27-13-59-47</DEVICEID>
    <DMIVERSION>2.2</DMIVERSION>
    <IPDISCOVER_VERSION>3</IPDISCOVER_VERSION>
    <OCSFSERVER>my_ocs_com_server.domain.tld:80</OCSFSERVER>
</CONF>

You can choose between 3 methods for sending inventory:

  1. http: computer is connected to the network and is able to reach the Communication server with HTTP protocol USED BY DEFAULT.
  2. 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.
  3. local: computer is not connected to the network and inventory will be generated in a file manually sent to OCS Inventory NG by the operator. This option must be set manually in ocsinventory-agent.conf like this:local=/tmp

For two others methods:

Syntax : http[s]://ocsinventory-ng-server[:port]/ocsinventory

Examples:

ocsserver.domains.local
https://w.x.y.z
ocsserver.domains.local:1234
https://ocsserver.domains.local

Mac OS

Download OCS MacOSX agent from OCS Inventory NG website download page(http://www.ocsinventory-ng.org/en/#home-en ), unzip the file and double click “Ocsinventory_Agent_MacOSX.pkg”.

Mac OSX Icon

Click “Continue”.

Ocs agent installation on Mac OSX

Validate license agreement by clicking “Continue” and “Agree”.

Accept licence

If you already made an OCS MacOSX agent installation, you may be asked if you want to launch OCS MacOSX configuration. Click on “Yes” to launch configuration panel or “No” to skip this step.

Warning: message=If you click on "Yes", /etc/ocsinventory-agent/ocsinventory-agent.cfg file content will be erased !

Ocs agent already exist

Set your OCS MacOSX agent configuration by choosing several options: Http or https for MacOSX agent communication to OCS server (“http” by default). OCS server server name (“ocsinventory-ng” by default). MacOSX agent TAG value (optional). Log file path for OCS MacOSX agent (“/var/log/ocsng.log” by default). Activate or Unactivate OCS MacOSX agent debug mode for logs (activated by default). Activate or Unactivate OCS MacOSX agent packages download feature (activated by default). Activate or Unactivate OCS MacOSX agent SSL certificate feature (activated by default). Certificate file path (mandatory if you activate OCS MacOSX agent packages download feature). Certificate file must be named as “cacert.pem”.

Click on “Continue” to validate configuration.

Ocs agent configuration

If you activate OCS MacOSX agent packages download feature and SSL feature without specifying a certificate file path, you may have this warning.

Warning: message=If you activate OCS MacOSX agent packages download feature without specifying a certificate file path, OCS MacOSX agent packages download feature won't work !!!

No folder specify

Set how OCS MacOSX agent will be launched by MacOSX Launchd daemon by choosing several options: Periodicity for OCS MacOSX agent to be launched by Launchd daemon (5 hours by default).Activate or Unactivate OCS MacOSX agent launch at Launchd daemon start (activated by default). * Activate or Unactivate OCS MacOSX agent launch, using Launchd daemon, after installation (inactivated by default)

Daemon Option

Select hard drive where you want to install OCS MacOSX agent and click “Continue”.

Select Destination

Click “Install”.

Installation Type

Click “Close” to end installation.

End of the installation

Launch MacOSX agent

To launch MacOSX agent, open a new Finder window, go to Applications and then double click on OCSNG.app.

Agent OCS's icon

A new window appears and click Yes to launch agent or No to cancel.

Launch window

During agent launch you will see an icon in your Dock and this will disappear when agent launch will be ended.

Android

Installation of Android Agent

2 solutions to install Android agent.

From OCS repository on Github : Download and decompress the lastestversion of Android Agent from download page of our website.

Place this file on SDCARD and launch it.

  • From PlayStore : Download application and launch installation.
Download of android agent

At the end of installation, icon is created on desktop, and a message prevents your application was installed correctly. Click on Open to quit the playstore and launch application.

Windows agent installed

Note: On android v6.0 and more when you launch the app you can authorize the application to access to the different information and data on your device

Authorize appli to acces
Authorize appli to acces
Authorize appli to acces

Now you see the main screen of the application, which allows you to:

  • send an inventory (you will have to fix the configuration before)
  • display inventory (section by section)
  • store inventory on your SDCARD (/mnt/sdcard/ocs/inventory.xml)
  • edit the configuration, using configuration standard menu of Android
Homescreen of android agent

Configuration of Agent

By clicking on configuration standard button of Android (different depending on the device), 4 menus are available:

  • Configuration : Access to agent configuration
  • About : About OCS Inventory NG agent installed
  • Import configuration : Import a configuration file if present in directory ocs
  • Export configuration : Export the configuration to backup or using on others devices
Options of android agent

General Configuration of agent

General configuration of android agent
  • TAG : Cathegory TAG in OCS
  • DEBUG : possible to generate a trace file in the ocslog.txt agent directory
  • AUTOMATIC : define if agent works as a service or a standalone application
  • DEPENDING ON NETWORK STATUS : Define using mobile internet connection or Wifi
  • INVENTORY FREQUENCY : define frequency between 2 inventories (in hours)
  • WAKE FREQUENCY : define time between 2 verifications of time since last inventory
  • CACHE : possible to recordd inventory cache on device
  • CACHE LIFETIME : define cache timelife (in minutes)
  • SYSTEM SOFTWARE : Exclude or include software like clock
  • USERAGENT COMPATIBILITY : Active this option for old OCS Inventory Server under 2.X
  • HIDE NOTIFICATION : Show off or on the notification from OCS android agent

Configuration concerning server

Server's configuration of android agent
  • SERVER URL : define URL address of OCS Inventory NG server

Leave a Reply

Your email address will not be published. Required fields are marked *