Difference between revisions of "OCS Inventory"
Unnilennium (talk | contribs) |
|||
(19 intermediate revisions by 5 users not shown) | |||
Line 1: | Line 1: | ||
+ | {{Languages}} | ||
+ | ==Maintainer== | ||
+ | [mailto:stephdl@de-labrusse.fr Stéphane de Labrusse] AKA [[User:Stephdl|Stephdl]] | ||
+ | ===Version=== | ||
+ | {{#smeversion: smeserver-ocsinventory }} | ||
− | + | ==HowTO== | |
− | + | ===Installation=== | |
− | = | + | ====SME8==== |
− | + | yum install smeserver-ocsinventory --enablerepo=smedev,smetest,smecontribs | |
− | |||
− | = | ||
− | |||
− | |||
− | yum install smeserver-ocsinventory --enablerepo=smedev,smetest,smecontribs | ||
then | then | ||
Line 17: | Line 17: | ||
{{Warning box|You must issue first the ocs-update before post-upgrade and reboot}} | {{Warning box|You must issue first the ocs-update before post-upgrade and reboot}} | ||
+ | ====SME9==== | ||
+ | You must first enabled the [[Remi-ocsinventory]] repository, then | ||
+ | yum install smeserver-ocsinventory --enablerepo=remi-ocsinventory,smecontribs | ||
+ | signal-event ocs-update | ||
+ | or if you prefer to reboot your server, then do | ||
+ | signal-event post-upgrade; signal-event reboot | ||
− | after this you should go to http://YOURDOMAIN/ocs/install.php | + | ---- |
+ | after this you can proceed to normal installation according to [[OCS Inventory#Importing ocsagent.exe in MySQL]] should go to http://YOURDOMAIN/ocs/install.php | ||
Line 24: | Line 31: | ||
− | then go to http://YOURDOMAIN/ocs/index.php | + | then do the normal installation following go to http://YOURDOMAIN/ocs/index.php |
do not forget to change the default username and password which are admin /admin | do not forget to change the default username and password which are admin /admin | ||
Line 33: | Line 40: | ||
rm -f /usr/share/ocsinventory-reports/ocsreports/install.php | rm -f /usr/share/ocsinventory-reports/ocsreports/install.php | ||
− | ==Special commands== | + | ===Special commands=== |
To view OCS configuration, you can type the following at the prompt: | To view OCS configuration, you can type the following at the prompt: | ||
config show ocs | config show ocs | ||
Line 44: | Line 51: | ||
# URL | new alias | | Optionnal aliases for ocs and glpi web interfaces | # URL | new alias | | Optionnal aliases for ocs and glpi web interfaces | ||
− | + | ===Client Installation=== | |
− | =Client Installation= | ||
The client side is available [http://www.ocsinventory-ng.org/index.php?page=1-01 on all platforms]. Download the latest client version according to your OS. | The client side is available [http://www.ocsinventory-ng.org/index.php?page=1-01 on all platforms]. Download the latest client version according to your OS. | ||
Line 53: | Line 59: | ||
While you are installing the agent, copy the cacert.pem file, see the SSL section below. | While you are installing the agent, copy the cacert.pem file, see the SSL section below. | ||
− | ==OCS Agent for SME Server== | + | ===OCS Agent for SME Server=== |
If you want to inventory other SME Servers (without installing the server-side and web interfaces) | If you want to inventory other SME Servers (without installing the server-side and web interfaces) | ||
− | + | ====for sme8==== | |
yum install ocsinventory-agent ocsinventory-ipdiscover --enablerepo=smetest,epel | yum install ocsinventory-agent ocsinventory-ipdiscover --enablerepo=smetest,epel | ||
− | |||
{{Warning box|this will issue a warning, which can be ignored, about : rpmts_HdrFromFdno: Entête V3 DSA signature: NOKEY, key ID 00f97f56 | {{Warning box|this will issue a warning, which can be ignored, about : rpmts_HdrFromFdno: Entête V3 DSA signature: NOKEY, key ID 00f97f56 | ||
Public key for ocsinventory-ipdiscover-1.01-2.el5.remi.i386.rpm is not installed | Public key for ocsinventory-ipdiscover-1.01-2.el5.remi.i386.rpm is not installed | ||
}} | }} | ||
− | + | ====for sme9==== | |
+ | yum install ocsinventory-agent ocsinventory-ipdiscover --enablerepo=remi-ocsinventory | ||
+ | ----- | ||
Then edit ''/etc/ocsinventory-agent/ocsinv.conf'' and modify following lines: | Then edit ''/etc/ocsinventory-agent/ocsinv.conf'' and modify following lines: | ||
OCSSERVER=yourdomain.com | OCSSERVER=yourdomain.com | ||
Line 69: | Line 76: | ||
ocsinventory-agent -s yourdomain.com -t your_tag | ocsinventory-agent -s yourdomain.com -t your_tag | ||
− | ==OCS Agent for Windows== | + | ===OCS Agent for Windows=== |
There are 2 differents ways of sending inventories on Windows. Download the latest client software, OCSNG_WIN32_AGENT_1.xx_repack.zip from ocs website. This archive contains 3 executables. | There are 2 differents ways of sending inventories on Windows. Download the latest client software, OCSNG_WIN32_AGENT_1.xx_repack.zip from ocs website. This archive contains 3 executables. | ||
Line 117: | Line 124: | ||
This also allows to update files archived in ''ocsagent.exe'' on your clients (can be service or standalone executable). | This also allows to update files archived in ''ocsagent.exe'' on your clients (can be service or standalone executable). | ||
− | A [ | + | A [https://launchpad.net/ocsinventory-windows-packager/2.1/2.1.1/+download/OCSNG-Windows-Packager-2.1.1.zip packager] is available at ocs website. This will allow you to repackage ''ocsagent.exe'' with your own modifications (i.e. an SSL certificate!) |
[[Image:OCS-packager.png]]<br> | [[Image:OCS-packager.png]]<br> | ||
---- | ---- | ||
Line 140: | Line 147: | ||
If you want to remove ''ocsagent.exe'' from your database, simply delete the file from the server and redo install.php. This will delete the file from the database. | If you want to remove ''ocsagent.exe'' from your database, simply delete the file from the server and redo install.php. This will delete the file from the database. | ||
− | ==OCS Agent for Linux== | + | ===OCS Agent for Linux=== |
Download the generic linux tar.gz, unpack, read the README, and as root, run the setup script. | Download the generic linux tar.gz, unpack, read the README, and as root, run the setup script. | ||
− | You may required additional perl- packages, use | + | You may required additional perl-packages, use your package management tools to search for the missing dependencies based on the README or the error messages. See Section 4.2 in the internal OCS help file. |
To run an inventory | To run an inventory | ||
Line 150: | Line 157: | ||
Check the time (will the PC be on) and command given in | Check the time (will the PC be on) and command given in | ||
/etc/cron.d/ocsinventory-client | /etc/cron.d/ocsinventory-client | ||
− | |||
− | |||
− | |||
− | |||
− | |||
=OCS Inventory NG Usage= | =OCS Inventory NG Usage= | ||
Line 194: | Line 196: | ||
[[Image:OCS-ipdiscover-step4.png]]<br> | [[Image:OCS-ipdiscover-step4.png]]<br> | ||
---- | ---- | ||
− | Add | + | Add your own network/subnet. All fields are mandatory. |
[[Image:OCS-ipdiscover-step5.png]]<br> | [[Image:OCS-ipdiscover-step5.png]]<br> | ||
---- | ---- | ||
Line 244: | Line 246: | ||
---- | ---- | ||
− | ====Building a deployment | + | ====Building a deployment package==== |
− | Deployment packages can be either '''''.zip''''' files (Windows) or '''''tar.gz''''' files (Linux) | + | Deployment packages can be either '''''.zip''''' files (Windows) or '''''tar.gz''''' files (Linux). |
'''Don't try to deploy other file type.''' | '''Don't try to deploy other file type.''' | ||
Line 252: | Line 254: | ||
for an overview see [http://www.ocsinventory-ng.org/index.php?page=package-deployment the ocs website] | for an overview see [http://www.ocsinventory-ng.org/index.php?page=package-deployment the ocs website] | ||
for detail see section 8.3 of the help file, | for detail see section 8.3 of the help file, | ||
− | for [http://alufis35.uv.es/OCS-Deployment-Tips-and-tricks.html Tips and tricks] see Pablo Iranzo's site | + | for [http://alufis35.uv.es/OCS-Deployment-Tips-and-tricks.html Tips and tricks] see Pablo Iranzo's site. |
[[Image:OCS-buildpackage.png]]<br> | [[Image:OCS-buildpackage.png]]<br> | ||
---- | ---- | ||
Line 288: | Line 290: | ||
− | Open the desired computer's inventory on click on ''Config'' icon and add a new package | + | Open the desired computer's inventory on click on ''Config'' icon and add a new package. |
[[Image:OCS-deploy-single-pc1.png]]<br> | [[Image:OCS-deploy-single-pc1.png]]<br> | ||
---- | ---- | ||
− | You should see all activated packages, affect the one you want and confirm changes | + | You should see all activated packages, affect the one you want and confirm changes. |
[[Image:OCS-deploy-single-pc2.png]]<br> | [[Image:OCS-deploy-single-pc2.png]]<br> | ||
---- | ---- | ||
Line 299: | Line 301: | ||
Next time the Agent contacts the server, it is notified of the package, and sometime later should be deployed! As usual, you can manually launch the agent to force the update. | Next time the Agent contacts the server, it is notified of the package, and sometime later should be deployed! As usual, you can manually launch the agent to force the update. | ||
− | See section 8.1 of the help file to understand how download works | + | See section 8.1 of the help file to understand how download works. |
Latest revision as of 19:24, 10 May 2021
Maintainer
Stéphane de Labrusse AKA Stephdl
Version
HowTO
Installation
SME8
yum install smeserver-ocsinventory --enablerepo=smedev,smetest,smecontribs
then
signal-event ocs-update signal-event post-upgrade; signal-event reboot
SME9
You must first enabled the Remi-ocsinventory repository, then
yum install smeserver-ocsinventory --enablerepo=remi-ocsinventory,smecontribs signal-event ocs-update
or if you prefer to reboot your server, then do
signal-event post-upgrade; signal-event reboot
after this you can proceed to normal installation according to OCS Inventory#Importing ocsagent.exe in MySQL should go to http://YOURDOMAIN/ocs/install.php
just answer the questions, mysql database informations will already be there, you do not have to change them, as they were set.
then do the normal installation following go to http://YOURDOMAIN/ocs/index.php
do not forget to change the default username and password which are admin /admin
also do not forget to do :
rm -f /usr/share/ocsinventory-reports/ocsreports/install.php
Special commands
To view OCS configuration, you can type the following at the prompt:
config show ocs
You can change a few parameters:
DB parameter | Options | Default | Explanation # MaxUpload | xM | 100M | Max uploadable file size # InventoryAccess | local/global | global | Accessibility of OCS Server (to receive inventories) # InventoryDelay | >1 | 600 | Time to wait (sec) to avoid server overload (Agent cron) # URL | new alias | | Optionnal aliases for ocs and glpi web interfaces
Client Installation
The client side is available on all platforms. Download the latest client version according to your OS.
After installing the Agent, you should launch it manually to upload your first inventory (as it's updated once per day by default)
While you are installing the agent, copy the cacert.pem file, see the SSL section below.
OCS Agent for SME Server
If you want to inventory other SME Servers (without installing the server-side and web interfaces)
for sme8
yum install ocsinventory-agent ocsinventory-ipdiscover --enablerepo=smetest,epel
for sme9
yum install ocsinventory-agent ocsinventory-ipdiscover --enablerepo=remi-ocsinventory
Then edit /etc/ocsinventory-agent/ocsinv.conf and modify following lines:
OCSSERVER=yourdomain.com OCSTAG=your_tag
And finally launch the first inventory manually:
ocsinventory-agent -s yourdomain.com -t your_tag
OCS Agent for Windows
There are 2 differents ways of sending inventories on Windows. Download the latest client software, OCSNG_WIN32_AGENT_1.xx_repack.zip from ocs website. This archive contains 3 executables.
See Section 4.1 in the internal OCS help file.
Service use
Using OCS as a service is what you will probably need.
Launch the install of OcsAgentSetup.exe and provide default settings of the service.
Then launch the first inventory by typing the following in the 'execute box':
"C:\Program Files\OCS Inventory Agent\OCSInventory.exe" /server:yourdomain.com /np /debug /tag:your_tag
Wait a few seconds and go to http://your-server/ocs, you should see your computer's inventory.
By default, Agent will contact the Server once a day.
You can override this default behaviour in ocs web interface options. Your changes will be applied next time the Agent contacts the Server.
For troubleshooting, look at the log file in C:\Program Files\OCS Inventory Agent\COMPUTER_NAME.log
Standalone use
You can also make inventories on Windows without installing the service.
OCS standalone client is cut into 2 executables:
- ocsagent.exe - This file contains all needed files for the launcher
- OcsLogon.exe - This file is the standalone executable (launcher)
Of course, ocsagent.exe must be uncompressed before launching the standalone executable.
This can be done by executing directly ocsagent.exe: files will uncompress in c:\ocs-ng.
You can also import this file into ocs' MySQL database so that the standalone executable can download it if needed. This is documented in section MySQL importation.
The command line is the same as for the service:
"C:\Path_to_file\OcsLogon.exe" /server:yourdomain.com /np /debug /tag:your_tag
For easier and faster inventorying, you can also rename this standalone executable to your domain name (don't forget .exe):
"C:\Path_to_file\yourdomain.com.exe" /np /debug /tag:your_tag
For troubleshooting, look at the log file in C:\ocs-ng\COMPUTER_NAME.log
Importing ocsagent.exe in MySQL
The main advantage of this method is that you can send the standalone executable by Internet very quickly or even put the standalone executable on a floppy disk as it's only 65KB! How powerful looks your old floppy disk drive now?
This also allows to update files archived in ocsagent.exe on your clients (can be service or standalone executable).
A packager is available at ocs website. This will allow you to repackage ocsagent.exe with your own modifications (i.e. an SSL certificate!)
1st thing you need is to copy ocsagent.exe (modified or not) in /usr/share/ocsinventory-reports/ocsreports/files/.
Then, you can import this file in the database. Go to http://yourdomain.com/ocs/install.php
Use the pre-configured account 'ocs' for that:
If you get a warning message (cannot alter database), refresh the page and you should see a successful import.
ocsagent.exe is now in the database!
You can now use OcsLogon.exe alone, it will download/update ocsagent.exe if needed!
If you want to remove ocsagent.exe from your database, simply delete the file from the server and redo install.php. This will delete the file from the database.
OCS Agent for Linux
Download the generic linux tar.gz, unpack, read the README, and as root, run the setup script.
You may required additional perl-packages, use your package management tools to search for the missing dependencies based on the README or the error messages. See Section 4.2 in the internal OCS help file.
To run an inventory
ocsinventory-client.pl -server=server.net -tag=network3
Check the time (will the PC be on) and command given in
/etc/cron.d/ocsinventory-client
OCS Inventory NG Usage
Full documentation can be found in the ocs help file, the help icon in ocs interface.
Access
OCS Reports' web interface can be reached at http://your-server/ocs
Before login, please choose your language (flags on the top right corner)
Login : admin
Password: admin
Inventories can be done from WAN but the web interface is only available from inside your network for security reasons by default. See Sections 5 & 6 in the internal OCS help file for Reporting and Administration help.
IP discovery
IP discovery feature allow OCS Inventory NG to discover all network connected devices on the network. For this, Communication server asks a number of most “active” computers running OCS Inventory NG agent to scan for MAC addresses in their sub network at each run. See Section 7 in the internal OCS help file.
Modifying default behaviour
You may want to override the default IP Discovery behaviour.
To force a computer to ipdiscover, simply open its inventory. Click on Customization icon and update the ipdiscover behaviour.
Now choose the IP of selected computer and save your changes.
You should now see your modifications.
At this point, ipdiscover will run next time with the agent!
Manually launch the inventory to force ipdiscover or wait a day for the next inventory.
Adding networks and devices categories
Now click on Security and go to Config
Add your own network/subnet. All fields are mandatory.
We can also add categories. Let's do that! Click on 'Network devices types'
Usage
Go back to Security and click on Network information. Now that your network is created, you should see ipdiscover working...
Click on non-inventoried devices.
Now all you have to do is registering new devices!
Deploying packages
OCS Inventory NG includes package deployment feature on client computers. From the central management server, you can upload packages which will be downloaded through HTTP/HTTPS and launched by agent on client computer. See Section 8 in the internal OCS help file.
This feature is LAN ONLY
SSL certificate
Deployment feature uses SSL to authenticate Agents.
To allow the Agent to authenticate with the Server, you need to copy the cacert.pem file in your agents' installation directory
This file is located in /home/e-smith/ssl.crt/
Using default cacert.pem
If the file /home/e-smith/ssl.crt/cacert.pem can not be found, the RPM install will create it by copying your original SME certificate into this file. This is a quick and a simple method.
Copy the cacert.pem file in your agents' installation directory. Skip to next section!
Using a custom certificate
If you've followed this howto to create a valid certificate, you can use this certificate with OCS Deployment feature.
Download cacert.org certificate with the following command:
wget http://www.cacert.org/certs/root.crt
And replace the old file with the following command:
cp root.crt /home/e-smith/ssl.crt/cacert.pem
Copy this file into your agents' installation directory.
Open OCS' web interface and click on Deployment icon.
Building a deployment package
Deployment packages can be either .zip files (Windows) or tar.gz files (Linux).
Don't try to deploy other file type.
There are many options to deploy packages,
for an overview see the ocs website
for detail see section 8.3 of the help file,
for Tips and tricks see Pablo Iranzo's site.
After creating the deployment package, you should get this successful screen:
Activating deployment packages
Once a package is added, you need to activate it.
Provide paths to download folder. As this feature is LAN ONLY, provide internal name or IP address for both fields.
Be careful, this path will be resolved by the agent (value localhost forbidden here!)
Don't pay attention to the warning messages when activating, Just click Yes.
You can also ignore any warning messages when deleting a package, the package is removed.
Activated deployment packages
Here you will be able to see activated packages...
Deploying your packages
All should be ready to go now!
The final step is to affect the created package to computers...
Here's a quick howto for deploying the package on a single computer.
To learn how to deploy on multiple computers, see section 8.5 of the help file.
Open the desired computer's inventory on click on Config icon and add a new package.
You should see all activated packages, affect the one you want and confirm changes.
Back at Config page, you should now see affected packages and their states.
Next time the Agent contacts the server, it is notified of the package, and sometime later should be deployed! As usual, you can manually launch the agent to force the update.
See section 8.1 of the help file to understand how download works.