If you are behind a proxy
You may need to specify a proxy with -x <proxy>:<port>
, be aware that there are known issues with Squid and possibly other proxies:
pkgadd -x myproxy:3128 -d http://get.opencsw.org/now
If your organization does not use a proxy you can skip to the section “Configure the OpenCSW repo to fetch packages“.
Proxy with a password
You will need to configure /etc/opt/csw/wgetrc
:
proxy_user=<user>
proxy_password=<password>
Configure the OpenCSW repo to fetch packages
pkgadd -d http://get.opencsw.org/now # answer all/yes when asked
Install all the needed packages from OpenCSW
IMPORTANT! The next step may require up to 200MB of disk space available under /opt
. Please make sure you have enough room before running the pkgutil
command.
/opt/csw/bin/pkgutil -y -i CSWpmstringapprox pm_lwp_mediatypes pm_lwp_protocol_https gmake pm_xml_simple pm_net_ip pm_netaddr_ip pm_netaddrip pm_crypt_ssleay pm_net_ssleay pm_netssleay_stub nmap pm_proc_daemon pm_proc_pid_file ;
Now temporarily set PATH to use installed packages. Note that this setting is only needed during this installation and will expire when you close your shell.
export PATH=/opt/csw/bin:$PATH
Extract and Install the ocsinventory-agent
tar -xvf Ocsinventory-Unix-Agent-2.1.1.tar.gz
Note: If the previous command does not work correctly (sometimes in Oracle Solaris 10), just use this variant:
gunzip -c Ocsinventory-Unix-Agent-2.1.1.tar.gz | tar -xvf -
and don’t forget the ending dash (-)
cd Ocsinventory-Unix-Agent-2.1.1
Here starts the real fun:
perl Makefile.PL
you should see an output similar to the following:
Linux::Ethtool::Settings is recommended if you want to retrieve speed and duplex information for network cards.
Nvidia::ml is recommended if you want to retrieve memory, speed, bios information for Nvidia cards.
Checking if your kit is complete...
Looks good
Generating a Unix-style Makefile
Writing Makefile for Ocsinventory::Unix::Agent
Writing MYMETA.yml and MYMETA.json
Usually a warning similar to this is acceptable:
Warning: prerequisite ExtUtils::MakeMaker 6.59 not found. We have 6.5502.
Then run
gmake
gmake install
During the gmake install
answer these questions:
Do you want to configure the agent
Please enter 'y' or 'n'?> [y] y
Where do you want to write the configuration file?
0 -> /etc/ocsinventory
1 -> /usr/local/etc/ocsinventory
2 -> /etc/ocsinventory-agent
?> 0
Do you want to create the directory /etc/ocsinventory?
Please enter 'y' or 'n'?> [y] y
Should the old linux_agent settings be imported ?
Please enter 'y' or 'n'?> [y] y
What is the address of your ocs server?> <Site Controller IP>
Do you need credential for the server? (You probably don't)
Please enter 'y' or 'n'?> [n] n
Do you want to apply an administrative tag on this machine
Please enter 'y' or 'n'?> [y] n
Do yo want to install the cron task in current user crontab ?
Please enter 'y' or 'n'?> [y] n
Where do you want the agent to store its files? (You probably don't need to change it)?> [/var/opt/ocsinventory-agent] <just press Enter>
Do you want to create the /var/opt/ocsinventory-agent directory?
Please enter 'y' or 'n'?> [y] y
Should I remove the old linux_agent
Please enter 'y' or 'n'?> [n] n
Do you want to activate debug configuration option ?
Please enter 'y' or 'n'?> [y] n
Do you want to use OCS Inventory NG UNix Unified agent log file ?
Please enter 'y' or 'n'?> [y] y
Specify log file path you want to use?> /var/log/ocsinventory-agent.log
Do you want disable SSL CA verification configuration option (not recommended) ?
Please enter 'y' or 'n'?> [n] n
Do you want to set CA certificate chain file path ?
Please enter 'y' or 'n'?> [y] n
Do you want to use OCS-Inventory software deployment feature?
Please enter 'y' or 'n'?> [y] n
Do you want to use OCS-Inventory SNMP scans feature?
Please enter 'y' or 'n'?> [y] n
Do you want to send an inventory of this machine?
Please enter 'y' or 'n'?> [y] y
If everything went well you should be able to see a line saying:
Launching OCS Inventory NG Unix Unified agent...
Enabling ocsinventory-agent in crontab
It is usually sufficient to run the agent once a day or even less (once a week maybe?)
Edit your root crontab running the command
crontab -e
and append the following line
0 0 * * * ocsinventory-agent > /dev/null 2&>1
to run ocsinventory-agent daily (at midnight in the example) or
0 0 0 * * ocsinventory-agent > /dev/null 2&>1
to run weekly.
Browse your new asset
With Chrome browser open the url
https://<Site Controller IP>
login with username and password the click on Assets
to view your new asset details