ocsinventory-ng / unixagent Goto Github PK
View Code? Open in Web Editor NEWThis is the OCS unified agent for Unix operating systems
Home Page: http://www.ocsinventory-ng.org/en/
License: GNU General Public License v2.0
This is the OCS unified agent for Unix operating systems
Home Page: http://www.ocsinventory-ng.org/en/
License: GNU General Public License v2.0
Hey,
i installed the agent in the OCS Server which works. Also inventory work fine so far but everytime i do an inventory i get an error "lspci: Unable to load libkmod resources: error -12".
Inventory is transmittet and i didn´t found any missing data.
you now how to solve this error?
Server is a Ubuntu 16.04 and OCS is 2.3 on erver and agent.
PHP 7.0.13-0ubuntu0.16.04.1 (apache2handler)
WebServer Apache/2.4.18 (Ubuntu)
DatabaseServer (Ubuntu) version 5.7.17-0ubuntu0.16.04.1
OCS Version 2.3
Hi Team,
Current Unix OCS agent need "ifconfig" command to be present/installed in system for ocs agent to get IP details but with RedHat7 ifconfig is not a part of network management commands and we can get the IP details with "ip" command. we need to install RPM "net-tools" to have ifconfig command so that OCS agent can collect IP details. Is there a new release or patch to existing agent which use "ip" command instead of ifconfig so that we dont have to install additional RPM. Also ifconfig will not be supported by RedHat.
Thanks,
Jitendra
If the older OCS-NG_unified_unix_agent_v2.1.1 is used, then OS is displayed as "CentOS Linux release 7.3.1611 (Core)".
If the newest OCS-NG_unified_unix_agent_v2.3 is used, then OS is displayed as "CentOS".
Why is it so?
Bonjour,
J'ai récemment installé l'agent OCS pour Windows. La version est la 2.3.0.0 et je ne parviens pas à me connecter au serveur ocs. Les journaux d'événements me donnent l'erreur suivante "Service encounter error <Failed to load/parse last inventory state>". J'ai réinstallé plusieurs fois l'agent mais j'ai pas réussi à corriger le problème. Mon OS c'est Windows 10 et je ne sais où trouver le fichier ocsinventory.ini
Hi, i am receiving this error when i execute a perl Makefile.PL:
Warning: the following files are missing in your kit: lib/Ocsinventory/Agent/Modules/Processes.pm README Please inform the author.
what did i miss?
thanks in advice.
Hi,
Linux agent doesn't discover secondary ip addresses, added using 'ip addr add ...' command, for example
ip a a 100.100.100.100 dev lo
ip -o a s dev lo
1: lo inet 127.0.0.1/8 scope host lo\ valid_lft forever preferred_lft forever
1: lo inet 100.100.100.100/32 scope global lo\ valid_lft forever preferred_lft forever
1: lo inet6 ::1/128 scope host \ valid_lft forever preferred_lft forever
I'd be nice if the agent would collect and display all secondary IPs on all interfaces.
Keep up the good work!
Daniel
package Ocsinventory::Agent::Backend::OS::MacOS::Video rely on the "strings" command (at line 34) though this command is only available when xcode is installed.
So, when you run the UnixAgent on Mac OSX where Xcode isn't installed, you get the following error:
The "strings" command requires the command line developer tools. Would you like to install the tools now?
Choose Install to continue. Choose Get Xcode to install xcode and the command line developer tools from the App Store.
It's hard to solve a problem when important details are missing, that why we added this template, to help you and us.
Operating system : Ubuntu 16.04.2
Perl version : 5.22.1-9
Unix agent version : 2.0.5-1
None of my ubuntu servers can download packages info files: Server answers with HTTP result 400 "Bad request"
Change line my $http_request = "GET $server_dir".$fileid."/info HTTP/1.0\n\n";
to my $http_request = "GET $server_dir".$fileid."/info HTTP/1.1\r\nHost: acme.org\r\nUser-Agent: OCS-NG\r\nAccept: */*\r\n\r\n";
Hey,
now with two unix agent i get the error above. But what i read out of the logs communication works.
Server activity.log:
Fri Jan 27 09:18:23 2017;3424;103;ittst-nb096-2017-01-27-09-07-31;10.40.10.73;OCS-NG_unified_unix_agent_v2.3;prolog;new_deviceid
Fri Jan 27 09:18:23 2017;3424;104;ittst-nb096-2017-01-27-09-07-31;10.40.10.73;OCS-NG_unified_unix_agent_v2.3;snmp;error: agent must have a deviceid in database !!
Fri Jan 27 09:18:23 2017;3424;100;ittst-nb096-2017-01-27-09-07-31;10.40.10.73;OCS-NG_unified_unix_agent_v2.3;prolog;accepted
Fri Jan 27 09:18:23 2017;3424;311;ittst-nb096-2017-01-27-09-07-31;10.40.10.73;OCS-NG_unified_unix_agent_v2.3;session;started
Fri Jan 27 09:18:25 2017;3424;319;ittst-nb096-2017-01-27-09-07-31;10.40.10.73;OCS-NG_unified_unix_agent_v2.3;session;found
Fri Jan 27 09:18:25 2017;3424;104;ittst-nb096-2017-01-27-09-07-31;10.40.10.73;OCS-NG_unified_unix_agent_v2.3;inventory;incoming
Fri Jan 27 09:18:25 2017;3424;528;ittst-nb096-2017-01-27-09-07-31;10.40.10.73;OCS-NG_unified_unix_agent_v2.3;accountinfos;missing
Apache error.log:
[Fri Jan 27 09:18:25.592592 2017] [perl:error] [pid 3424] [client 10.40.10.73:41836] Not a HASH reference at /usr/local/share/perl/5.22.1/Apache/Ocsinventory/Server/Inventory/Data.pm line 126.\n
Agent log (not debug but i can also post it if you want):
[Fri Jan 27 09:18:25 2017][error] Cannot establish communication : 500 Internal Server Error
We use OCS Server and client 2.3 , also client and server are both Ubuntu 16.04.
We also have working unix clients also with OCS Agent 2,3 and Ubuntu 16.04
Fri Jan 27 09:39:51 2017;31625;100;rmvm052-2017-01-24-09-38-38;10.10.2.53;OCS-NG_unified_unix_agent_v2.3;prolog;accepted
Fri Jan 27 09:39:51 2017;31625;311;rmvm052-2017-01-24-09-38-38;10.10.2.53;OCS-NG_unified_unix_agent_v2.3;session;started
Fri Jan 27 09:39:53 2017;31625;319;rmvm052-2017-01-24-09-38-38;10.10.2.53;OCS-NG_unified_unix_agent_v2.3;session;found
Fri Jan 27 09:39:53 2017;31625;104;rmvm052-2017-01-24-09-38-38;10.10.2.53;OCS-NG_unified_unix_agent_v2.3;inventory;incoming
Fri Jan 27 09:39:53 2017;31625;113;rmvm052-2017-01-24-09-38-38;10.10.2.53;OCS-NG_unified_unix_agent_v2.3;inventory;u:drives
Fri Jan 27 09:39:53 2017;31625;320;rmvm052-2017-01-24-09-38-38;10.10.2.53;OCS-NG_unified_unix_agent_v2.3;session;end
Fri Jan 27 09:39:53 2017;31625;101;rmvm052-2017-01-24-09-38-38;10.10.2.53;OCS-NG_unified_unix_agent_v2.3;inventory;transmitted
Any ideas what went wrong? You need any other information?
I'm getting this:
Redundant Argument in sprintf at /usr/share/perl5/site_perl/Ocs.../Agen../Bakc.../OS/Linux/Network/Networks.pm line 29.
Perl version: 5.24.0
Arch Linux.
It's hard to solve a problem when important details are missing, that why we added this template, to help you and us.
Operating system : OSX 10.12
Perl version : na
Unix agent version : 2.1.1
When an Apple Macbook is connected to an Apple screen it gets an additional Ethernet adapter added. This adapter is not showing up in the inventory. Only the macbook's Ethernet and WiFi Mac addresses are there. Not the one from the Apple screen.
Does anyone have the same issue?
Use github cloud or trusted upload website
Operating system :
Unix agent version : 2.3.1 (unreleased)
In the first place this behavior can be seen on Mac but I think it's more related to the LWP library.
By default, the agent is using LWP library when Crypt::Ssleay is not available but when using LWP the SSL certificate validation is different and can lead to inventory error (SSL Certificate verify failed)
The problem can only be seen when using a self signed certificate.
I made 3 different servers with SSL self signed and try to use the https inventory and each time the inventory fail on the SSL certificate verify failed.
After doing some research I saw that self signed certificate validation with LWP can be a bit tricky. Newer versions of LWP has change how to behave with SSL. (6.0 and newer only)
Here is some sources :
The solution would be to set theses 2 variables when using LWP :
Thunderbolt to Gigabit Ethernet Adapter detected but Interface missing in NETWORKS
debug.txt
There's no addCamera()
function defined in Agent/Common.pm, though there's a call to such a function in Agent/Backend/OS/MacOS/Camera.pm
Unix agent version : 2.3
For both module, recommend to add perl regex to remove extra CR LF after chomp of the output.
$binpath =~ s/\R//g;
Unsuccessful stat on filename containing newline at .../Ocsinventory/Agent/Common.pm line 1090
Unsuccessful stat on filename containing newline at .../Ocsinventory/Agent/Backend.pm line 33.
can_run => sub {
my $binary = shift;
my $calling_namespace = caller(0);
chomp(my $binpath=`which $binary 2>/dev/null`);
$binpath =~ s/\R//g;
return unless -x $binpath;
$self->{logger}->debug(" - $binary found");
1
},
It's hard to solve a problem when important details are missing, that why we added this template, to help you and us.
Operating system :
Perl version :
Unix agent version :
Describe your problem here
Use github cloud or trusted upload website
Add plugin TypeMateriel into the agent. http://wiki.ocsinventory-ng.org/index.php?title=Plugins:TypeMateriel
Operating system : CentOS 7.4 (64bit)
Perl version : perl5.16.3
Unix agent version : 2.3
The RPM present at https://www.ocsinventory-ng.org/en/rpm-repository-is-available-for-rhelcentosfedora/ lacks of SSL perl dependecy
Describe your problem here
Using ocs-server over https is not possible without installing some other packages:
yum install perl-LWP-Protocol-https perl-Crypt-SSLeay
PHP Warning: mysqli_fetch_object() expects parameter 1 to be mysqli_result, boolean given in /usr/share/ocsinventory-reports/ocsreports/install.php on line 113, referer: https://ocs.andersenlab.com/ocsreports/install.php
[client 127.0.0.1:48899] PHP Warning: Invalid argument supplied for foreach() in /usr/share/ocsinventory-reports/ocsreports/plugins/main_sections/ms_export/ms_csv.php on line 93, referer: https://ocs.andersenlab.com/ocsreports/?function=visu_repart_tag
PHP Warning: Invalid argument supplied for foreach() in /usr/share/ocsinventory-reports/ocsreports/plugins/main_sections/ms_export/ms_csv.php on line 93, referer: https://ocs.andersenlab.com/ocsreports/?function=visu_repart_tag
DBD::mysql::st execute failed: Table 'ocs_db.usbdevices' doesn't exist at /usr/local/share/perl/5.18.2/Apache/Ocsinventory/Server/Inventory/Update.pm line 171.
DBD::mysql::db DESTROY failed: MySQL server has gone away at /usr/share/perl5/Apache/DBI.pm line 212.
DBD::mysql::db DESTROY failed: MySQL server has gone away at /usr/share/perl5/Apache/DBI.pm line 212.
Operating system : Mac OS El Captain And Newer
Perl version : All
Unix agent version : All
Hi,
Recently, we made a lot of change on the Mac packaging to make it more up to date and work better with newer operating systems. ( Thx to @StCyr which started all the update process )
However, the create-darwin-perl-lib_fromCPAN.pl file has not been updated.
This file's role is to update and install dependencies and package them in a folder so the Mac agent have all the dependencies packaged in the app.
This script need to be updated a lot of things can be simplified, it need a partial rewrite (I think)
It's not an important issue but it could be nice to rewrite the script on the next months.
Regards,
Gilles Dubois.
[resources/ipdiscover/ipdiscover.c:100]: (style) A pointer can not be negative so it is either pointless or an error to check if it is.
Source code is
*sd = socket( PF_PACKET, SOCK_RAW, htons( ETH_P_ARP ) );
// ...
if( sd < 0 ){
perror("Socket creation problem");
exit(1);
}
Suggest new code
*sd = socket( PF_PACKET, SOCK_RAW, htons( ETH_P_ARP ) );
// ...
if (*sd < 0 ){
perror("Socket creation problem");
exit(1);
}
Hi,
With the use of thunderbolt display or ethernet adapter, we really need to inventory network interface from en0 to en5.
Thanks.
In file : lib/Ocsinventory/Agent/Backend/OS/MacOS/Networks.pm
-- next unless(/^en(0|3)/); # darwin has a lot of interfaces, for this purpose we only want to deal with eth0 and eth1
++ next unless(/^en(0|5)/); # darwin has a lot of interfaces, but with thunderbolt we need en0 to en5
Hi,
I have OCSInventory server 2.1.2 and i use OCS-NG_unified_unix_agent_v2.0.5. Agent see only one monitor Iiyama but i have one more monitor LG and agent can not see this.
I have installed get-edid 3.0.1 and parse-edid
Can i do something to see more?
Operating system : Debian Jessie (8.7)
Perl version : 5.20.2
Unix agent version : 2.3.0
Error into log file :
Failed to load Ocsinventory::Agent::Modules::Snmp::If_Mib: Missing right curly or square bracket at /usr/local/share/perl/5.20.2/Ocsinventory/Agent/Modules/Snmp/If_Mib.pm line 178, at end of line
syntax error at /usr/local/share/perl/5.20.2/Ocsinventory/Agent/Modules/Snmp/If_Mib.pm line 178, at EOF
Compilation failed in require at (eval 244) line 2.
Indeed it misses a bracket at the end of this file
Linux Agent does not report disk devices and the log at the output file in debug mode, says:
runWithTimeout(): unexpected error: Can't call method "can_run" on an undefined value at /usr/share/perl5/Ocsinventory/Agent/Backend/OS/Linux/Storages.pm line 280.
The problem is solved when adding the $params variable to the argument list, when calling functions at the following lines
foreach my $device (getFromSmartctl($params, $devices)) {
foreach my $device (getFromuDev2($params, $devices)) {
foreach my $device (getFromLshw($params)) {
foreach my $device (getFromLsblk($params)) {
foreach my $device (getFromLsscsi($params)) {
The OS Agent is Ubuntu 16.04, using UnixAgent-2.3
Why depend Crypt::SSLeay perl module, this module is not default installed in Mac OS X 10.10 and above. Manual install it so hard to normal user.
It's hard to solve a problem when important details are missing, that why we added this template, to help you and us.
Operating system : Debian jessie
Perl version : v5.20.2
Unix agent version : OCS-NG_unified_unix_agent_v2.3
When I try to teledeploy a bash script like:
#! /bin/bash
exit 17
In OCS inventory I see : SUCCESS_4352 and no ERR_EXIT_CODE_17 like should have.
In agent log I see:
[download] Sending message for 1489074110, code=SUCCESS_4352.
Use github cloud or trusted upload website
Operating system : OSX 10.11 and up
Perl version : 5.18
Unix agent version : none
No agent 2.3 for OSX. I have seen v 2.1.1 packaged for OSX. Can we get 2.3 packaged and available on github too?
a) The following module have no exception handling if VM does not setup usb on starting ocs service.
thus getting "unable to initialize libusb: -99" (lsusb.pm, usb.pm)
b) "USBDEVICES" and fields are not found to be setup in latest Server's Map.pm and Table.
common.pm (sub addUsb)
Unix agent version : 2.3
With relation to the following change, Unix agent 2.3 modules should also be updated as below
fe049ff
my $params = shift;
my $common = $params->{common};
$common->can_run();
$common->can_read();
$common->can_load();
[debug] runWithTimeout(): unexpected error: Undefined subroutine &Ocsinventory::Agent::Backend::OS::Solaris::Drives::can_run called at Ocsinventory/Agent/Backend/OS/Solaris/Drives.pm line 12.
[debug] Ocsinventory::Agent::Backend::OS::Solaris::Drives ignored
Ocsinventory\Agent\Backend\OS\Solaris\CPU.pm
Line 38: if ( $OSLevel =~ /5.8/ || !can_run("zoneadm")){
Ocsinventory\Agent\Backend\OS\Linux\Domains.pm
Line 9: return 1 if @Domain || can_read ("/etc/resolv.conf");
Ocsinventory\Agent\Backend\OS\Solaris\Drives.pm
Line 12: sub check { can_run ("df") }
Ocsinventory\Agent\Backend\OS\AIX\Videos.pm
Line 7: can_run("lsdev")
Ocsinventory\Agent\Backend\OS\MacOS\Mem.pm
Line 6: return (undef) unless can_load("Mac::SysProfile");
Line 551: # if (can_run("smartctl")){
It's hard to solve a problem when important details are missing, that why we added this template, to help you and us.
Operating system : Debian jessie
Perl version : v5.20.2
Unix agent version : OCS-NG_unified_unix_agent_v2.3
When I try to update my tag with:
/usr/local/bin/ocsinventory-agent --tag=TOTO
The tag is not updated.
In /etc/apache2/conf-enabled/z-ocsinventory-server.conf OCS_OPT_ACCEPT_TAG_UPDATE_FROM_CLIENT is setup to 1 and apache have bin allready restarted.
[Tue Mar 7 13:45:25 2017][debug] Ocsinventory unified agent for UNIX, Linux and MacOSX 2.3
[Tue Mar 7 13:45:25 2017][debug] Log system initialised (File)
[Tue Mar 7 13:45:25 2017][debug] --scan-homedirs missing. Don't scan user directories
[Tue Mar 7 13:45:25 2017][debug] Accountinfo file: /var/lib/ocsinventory-agent/https:__ocsinv.somtest.tld_ocsinventory/ocsinv.adm
[Tue Mar 7 13:45:25 2017][debug] A TAG seems to already exist in the ocsinv.adm file. The -t parameter will be ignored. Don't forget that the TAG value will be ignored by the server unless it has OCS_OPT_ACCEPT_TAG_UPDATE_FROM_CLIENT=1.
[Tue Mar 7 13:45:25 2017][debug] OCS Agent initialised
Bonjour,
La taille totale d'un disque dur de 1 To s'inscrit 1 MB dans la base de données "ocsweb" et dans l'affichage "ocsreports" comme le montre le fichier "export.txt" ci-joint.
Est-il possible de corriger ce problème ?
Environnement:
#1 SMP Debian 3.16.36-1+deb8u1 (2016-09-03) x86_64 GNU/Linux
OCSNG_UNIX_SERVER-2.2.1
Ocsinventory-Unix-Agent-2.1.1
Cordialement.
Bonjour,
Je suis en train de travailler sur la détection de CPU sous linux i386 pour notre parc serveurs (je m'attaquerai à l'avenir peut-être à celle d'AIX et de Solaris, si besoin).
L'objectif premier de mon employeur est d'avoir un décompte de CPU(socket)/Core/Logical_CPU fiable, car ces informations sont stratégiques vis-à-vis des licences facturées par Core (par exemple Oracle).
Pour nous, le reste des infos (voltage, type de socket, etc...) est donc vu comme facultatif, car non utilisé par nos service IT.
Nous avons donc choisi de refondre et simplifier le code lié au CPU (d'abord parce que je n'ai pas fait de Perl depuis 15 ans et aussi que je ne suis pas expert system Unix) avant de l'enrichir en fonctionnalités et converger vers une version qui serait acceptable par l'équipe projet OCS.
Je suis partis de la version de @MikkelPaulson : https://github.com/MikkelPaulson/OCSInventory-NG-UnixAgent/blob/2886b41203ef27e202cf3219fbb649ed64e9364a/lib/Ocsinventory/Agent/Backend/OS/Linux/Archs/i386/CPU.pm
Après l'analyse du code de l'agent, il semble que 2 propriétés gérées par le serveur OCS ne le sont pas pour l'instant par l'agent UNIX :
LOGICAL_CPU et CURRENT_ADDRESS_WIDTH ne sont en effet pas remontés par l'agent Unix.
L'info LOGICAL_CPU correspond, selon ma compréhension des choses, à l'info "siblings" de /proc/cpuinfo
Par contre, je me demande ce qui doit être remonté dans CURRENT_ADDRESS_WIDTH ? Sous Linux i386, est-on toujours avec DATA_WIDTH = CURRENT_ADDRESS_WIDTH, et sinon, où est-on susceptible de trouver cette info ?
Je vous remercie de vos éléments de réponses éventuels, cela me permettra de continuer de travailler sur les fichiers CPU.pm et Common.pm de l'agent Unix et de contribuer plus efficacement.
Mes travaux sont ici : master...Bexounet:master
I'm working on CPU detection on Linux i386. (Next investigation will be Solaris and AIX).
The first aim of my corporation is to have a trustable count of CPU(socket)/Core/Logical_CPU. This information is strategic because of software licence (like Oracle).
For my corporation other information (voltage, Socket type, ...) are optional or irrelevant (because nobody use these information in our IT services).
We choose to simplify the code (because I’m a newbie in Perl and I’m not an expert in Unix System admin) , and then add the functionality to be able to merge our code with the code of the OCS team.
I started with @MikkelPaulson ‘s code. : https://github.com/MikkelPaulson/OCSInventory-NG-UnixAgent/blob/2886b41203ef27e202cf3219fbb649ed64e9364a/lib/Ocsinventory/Agent/Backend/OS/Linux/Archs/i386/CPU.pm
After an analyse of the agent’s code, it seems that 2 property the OCS server manage aren’t managed by the Unix Agent.
LOGICAL_CPU and CURRENT_ADDRESS_WIDTH aren’t managed by the Unix agent
LOGICAL_CPU seems to be the "siblings" information of the /proc/cpuinfo
But, what about CURRENT_ADDRESS_WIDTH ? On Linux i386, is DATA_WIDTH equal to CURRENT_ADDRESS_WIDTH ? And if not, where the information is available ?
Thanks for your answers; they will allow me to contribute and improve the CPU.pm and Common.pm.
My work is here : master...Bexounet:master
Hey,
i tried to install the unix client on a ubuntu 16.04. so i downloaded the Ocsinventory-Unix-Agent-2.3RC from Release here.
After some problems with installation in finally got the client work. But the Client is not able to communicate with the OCS Server (Server is OCS 2.3 Ubuntu 16.04).
Output of the client Log:
[Fri Jan 6 14:25:06 2017][debug] Ocsinventory unified agent for UNIX, Linux and MacOSX 2.2
[Fri Jan 6 14:25:06 2017][debug] Log system initialised (File)
[Fri Jan 6 14:25:06 2017][debug] --scan-homedirs missing. Don't scan user directories
[Fri Jan 6 14:25:06 2017][debug] Accountinfo file: /var/lib/ocsinventory-agent/http:__ocs_ocsinventory/ocsinv.adm
[Fri Jan 6 14:25:06 2017][debug] OCS Agent initialised
[Fri Jan 6 14:25:06 2017][debug] Turns hooks on for /etc/ocsinventory/modules.conf
[Fri Jan 6 14:25:06 2017][debug] Ocsinventory unified agent for UNIX, Linux and MacOSX 2.2
[Fri Jan 6 14:25:06 2017][debug] Log system initialised (File)
[Fri Jan 6 14:25:06 2017][debug] Ocsinventory unified agent for UNIX, Linux and MacOSX 2.2
[Fri Jan 6 14:25:06 2017][debug] Log system initialised (File)
[Fri Jan 6 14:25:06 2017][debug] Calling handlers : `start_handler'
[Fri Jan 6 14:25:06 2017][debug] [snmp] Calling snmp_start_handler
[Fri Jan 6 14:25:06 2017][debug] - Net::SNMP loaded
[Fri Jan 6 14:25:06 2017][debug] [download] Calling download_start_handler
[Fri Jan 6 14:25:06 2017][debug] - LWP loaded
[Fri Jan 6 14:25:06 2017][debug] - LWP::Protocol::https loaded
[Fri Jan 6 14:25:06 2017][debug] Compress::Zlib is available.
[Fri Jan 6 14:25:06 2017][debug] Calling handlers : `prolog_writer'
[Fri Jan 6 14:25:06 2017][debug] sending XML
[Fri Jan 6 14:25:06 2017][debug] sending: <?xml version="1.0" encoding="UTF-8"?>
<REQUEST>
<DEVICEID>pg1042-vm001-38314443-4437-4633-2D44-3639312D3333</DEVICEID>
<QUERY>PROLOG</QUERY>
</REQUEST>
[Fri Jan 6 14:25:06 2017][error] Cannot establish communication : 400 Bad Request
Output of Server log:
Fri Jan 6 13:25:07 2017;2018;502;pg1042-vm001-38314443-4437-4633-2D44-3639312D3333;10.30.10.124;OCS-NG_unified_unix_agent_v2.2;inventory;Bad deviceid
Fri Jan 6 13:25:07 2017;2018;515;pg1042-vm001-38314443-4437-4633-2D44-3639312D3333;10.30.10.124;OCS-NG_unified_unix_agent_v2.2;end;bad_request
I´m wondering why there is agent 2.2? I double checked that i downloaded 2.3RC from this link:
https://github.com/OCSInventory-NG/UnixAgent/releases/download/2.3RC/Ocsinventory-Unix-Agent-2.3RC.tar.gz
You have any suggestions what i have to or what i do wrong?
Operating system : Ubuntu 16.04
Unix agent version : 2.3
Trying to inventory this client with a 2.3 version server. The server uses a wildcard cert, so we have ssl=0
in the config file. We don't use self signed cert, just a username, password and realm. And the server communication is over https.
All requirements are met too:
~/Downloads/Ocsinventory-Unix-Agent-2.3$ perl Makefile.PL
Nvidia::ml is recommended if you want to retrieve memory, speed, bios information for Nvidia cards.
Generating a Unix-style Makefile
Writing Makefile for Ocsinventory::Unix::Agent
Writing MYMETA.yml and MYMETA.json
And I have LWP::Protocol::https
> 6 installed.
$ cpan -l | grep LWP::Protocol::https
LWP::Protocol::https 6.06
Can't stat /usr/local/lib/site_perl: No such file or directory
at /usr/share/perl/5.22/App/Cpan.pm line 1331.
[Fri Feb 24 15:44:54 2017][debug] OCS Agent initialised
[Fri Feb 24 15:44:54 2017][debug] Turns hooks on for /etc/ocsinventory/modules.conf
[Fri Feb 24 15:44:54 2017][debug] Calling handlers : `start_handler'
[Fri Feb 24 15:44:54 2017][debug] Compress::Zlib is available.
[Fri Feb 24 15:44:54 2017][debug] Calling handlers : `prolog_writer'
[Fri Feb 24 15:44:54 2017][debug] sending XML
[Fri Feb 24 15:44:54 2017][debug] sending: <?xml version="1.0" encoding="UTF-8"?>
<REQUEST>
<DEVICEID>labs-044-2017-02-24-14-47-00</DEVICEID>
<QUERY>PROLOG</QUERY>
</REQUEST>
[Fri Feb 24 15:44:54 2017][error] Cannot establish communication : 500 SSL_verify_mode must be a number and not a string
Hi,
I have a issue with a server with 32 GB RAM modules. dmidecode in
Agent/Backend/OS/Generic/Dmidecode/Memory.pm does not differ by MB or
GB.
dmidecode Example:
Handle 0x1103, DMI type 17, 28 bytes
Memory Device
Array Handle: 0x1000
Error Information Handle: Not Provided
Total Width: 72 bits
Data Width: 64 bits
Size: 16384 MB
Form Factor: FB-DIMM
Set: 4
Locator: PROC 1 DIMM 4A
Bank Locator: Not Specified
Type: DDR3
...
Handle 0x1102, DMI type 17, 34 bytes
Memory Device
Array Handle: 0x1000
Error Information Handle: Not Provided
Total Width: 72 bits
Data Width: 64 bits
Size: 32 GB
Form Factor: DIMM
Set: 1
Locator: DIMM_A3
Bank Locator: Not Specified
Type: DDR3
...
Bonjour,
L'inventaire ne reporte pas la deuxième carte réseau : la carte réseau wifi "wlp4s0" est bien listée dans ocsreports mais la carte réseau filaire "enp5s0f2" ne l'est pas.
Matériel :
sans-fil : wlp4s0 : Intel Corporation Wireless 7260 [8086:08b1](rev 73)
filaire : enp5s0f2 : Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller [10ec:8168](rev 0a)
UnixAgent :
OCS-NG_unified_unix_agent_v2.2 (version de l'agent (master) du 17/10/2016 20:01 UTC+2)
Environnement :
Distribution : LinuxMint 18
Kernel : Linux 4.4.0-21-generic #37-Ubuntu SMP Mon Apr 18 18:33:37 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
Log (debug=2) :
Est-il possible de corriger ce problème ?
Cordialement.
Hello,
the memory configuration in VMware virtual machines is listed as both DMI type 6 and type 17.
As the current version of the agent checks for both types, we have a memory duplication in the inventory for all VMware virtual machines.
I don't know if there is a bare metal with both types available and if it is OK to just use one of both (first come first serve) or if it is more save to check if we are in a vm.
Attached is a example output of a vm with 1 GB of memory.
dmidecode_output.txt
Best regards
Operating system : Ubuntu 16.04
Perl version : v5.22.1
Unix agent version : 2.3
ssl=1
config options enforces agent to use SSL client certificate. If you want to use HTTP basic authentication over HTTPS connection, without SSL client certificate, you have to set ssl
option to 0
.
If you don't have cacert.pem
file, agent is printing following error:
[Wed Feb 8 12:47:11 2017][error] Cannot establish communication : 500 SSL_ca_file /var/lib/ocsinventory-agent/https:__inventory.local_ocsinventory/cacert.pem can't be used: No such file or directory
This creates a security problem, because ssl=0
skips SSL server certificate checking.
Extend ssl
and ca
options to options wildly used in other software which is using SSL (X.509 in general) certificates.
Config options which should be exposed:
ssl_verify_peer
- to set up the level of verification.
ssl_ca_cert
- to be able to use self-signed certificate with local CA certificate.
ssl_client_cert
- to specify client certificate used for authentication
ssl_client_key
- optional, if client certificate uses key file (recommended)
Also, I think that setting ssl=0
should't be used with server
option using HTTPS protocol.
Bonjour,
je rencontre un problème lors du premier lancement de l'agent UNIX à la fin de l'installation et j'obtiens, ces messages d'erreur
Launching OCS Inventory NG Unix Unified agent...
Use of uninitialized value $leasepath in open at /usr/local/share/perl/5.22.1/Ocsinventory/Agent/Backend/OS/Linux/Network/Networks.pm line 55.
Use of uninitialized value $leasepath in concatenation (.) or string at /usr/local/share/perl/5.22.1/Ocsinventory/Agent/Backend/OS/Linux/Network/Networks.pm line 73.
Can't open
-> Failed!
Es ce normal?
Merci
File is : lib/Ocsinventory/Agent/Backend/OS/Generic/Packaging/Deb.pm
Goal : the algorithm in this file lists all the packages to add them to the list of softwares. When a packages matches a defined pattern, then it is added to the software list. And if a package does not have a size, then 'Unknown size' is set for the size attribute.
Problem : when a package does not have a size, it does not match the pattern, so it is not added and the 'Unknown size' is never set.
Solution : fix the regex to match packages with no size.
---if (/^(\S+)---(\S+)---(\S+)---(.*)/) {
+++if (/^(\S+)---(\S+)---(\S*)---(.*)/) {
Bonjour,
J'ai effectué une mise à jour de l'agent Ocs Unix de la version 2.1RC1 vers la version 2.2RC1.
Maintenant je dispose d'un affichage différent dans le champ operating system, sur mon interface web ocsreports. Auparavant, j'avais le détail de version de ma distribution linux (example: Debian GNU/Linux 7.2 wheezy). Maintenant j'ai juste Debian d'affiché.
Savez-vous comment je peux faire pour revenir avec un affichage correspondant à la version 2.1RC1.
Merci.
Bonjour,
J'ai essayé de modifier le fichier LSB.pm pour faire remonter des valeurs dans le champ "OSVERSION" et mettre plus d'informations dans le champ "OSNAME". J'ai 2 machines Debian sur lesquelles ça a fonctionné. Par contre, pour les autres machines Debian ça ne fonctionne pas. J'ai pourtant renseigné le même fichier LSB.pm.
Sauriez-vous d'où peut venir le problème ?
Merci,
Bonjour,
Je voudrais ajouter des plugins dans la version standalone de l'agent OCS pour Unix, mais où faut-il les ajouter ?
J'utilise la version 2.1.1 sous CentOS 6 64Bits
Pour la version "installée" il faut ajouter les fichiers dans /usr/local/share/perl5/Ocsinventory/Agent/Modules puis renseigner le fichier /etc/ocsinventory-agent/modules.conf
Pour la version standalone :
Quand je lance la génération de l’exécutable, je vois bien entre autres les modules que j'ai ajouté :
/usr/local/bin/pp: ... adding as lib/Ocsinventory/Agent/Modules/Antivirus.pm
Par contre quand j’exécute le binaire ocsinventory-agent.bin, les modules ne s'executent pas (Ils fonctionnent correctement dans la version installée et je n'utilise pas de module perl additionnel dans mes modules).
Dans le fichier de log en mode debug, je n'ai pas la trace des plugins.
Comment faut-il faire pour ajouter les plugins et de faire en sorte qu'ils s’exécutent avec le binaire ocsinventory-agent.bin ?
Merci par avance
Operating system : Ubuntu 16.04.3 LTS
Perl version : 5.22.1-9
Unix agent version : 2:2.0.5-1 (but analysis of master branch makes me think it is also applicable to all further versions 'til now)
Look at those logs:
debug] [download] Download of 1503329931... Finished.
[debug] [download] Execute orders for package 1503329931.
[info] [download] Building package for 1503329931.
[info] [download] Checking signature for ./1503329931/tmp/build.tar.gz.
[debug] [download] Digest format: Hexadecimal
[debug] [download] Digest algo: MD5
[debug] [download] Digest OK...
=> retrieving tar...
=> tar is at /bin/tar
latest-pure64.a
[debug] [download] Building of 1503329931... Success.
[debug] [download] Launching latest-pure64.a --mode unattended...
[error] [download] Cannot find latest!
[debug] [download] Sending message for 1503329931, code=ERR_EXECUTE.
[info] [download] Cleaning 1503329931 package.
The Download module tries to launch "latest-pure64.a --mode unattended" but says it can't find "latest".
Here's the part of the code concerned (file ./lib/Ocsinventory/Agent/Modules/Download.pm
):
if($packages->{$id}->{'ACT'} eq 'LAUNCH'){
$logger->debug("Launching $packages->{$id}->{'NAME'}...");
my $exe_line = $packages->{$id}->{'NAME'};
$packages->{$id}->{'NAME'} =~ s/^([^ -]+).*/$1/;
# Exec specified file (LAUNCH => NAME)
if(-e $packages->{$id}->{'NAME'}){
chmod(0755, $packages->{$id}->{'NAME'}) or die("Cannot chmod: $!");
$exit_code = system( "./".$exe_line );
}else{
$logger->error("Cannot find $packages->{$id}->{'NAME'}!");
die();
}
Operating system : Linux
Perl version : -
Unix agent version : latest master
The Linux backend uses the "route" tool from the outdated net-tools package to gather certain network information. It already checks for the "ip" tool and, if found, uses it in favor of the "ifconfig" tool from the same package, but it still relies on "route". If "ip" is available, "ip route" should be used instead to make it work on systems without the net-tools package.
Is this repo's source code is same for OCS Inventory NG agent for MacOS X ?
and how to build a pkg installer for MacOS X?
I have a server with four 1 TB drives connected to a megaraid hardware RAID controller. I see that there are modules for various other RAID controllers, but I'm not sure how to integrate support for a new controller nor how to identify that /dev/sda
and /dev/sdb
are actually the same controller.
# smartctl -i /dev/sda
smartctl 5.41 2011-06-09 r3365 [x86_64-linux-3.2.0-23-generic] (local build)
Copyright (C) 2002-11 by Bruce Allen, http://smartmontools.sourceforge.net
Smartctl open device: /dev/sda failed: DELL or MegaRaid controller, please try adding '-d megaraid,N'
# smartctl -i /dev/sda -d megaraid,0 #other connected drives are found on megaraid,1-3
smartctl 5.41 2011-06-09 r3365 [x86_64-linux-3.2.0-23-generic] (local build)
Copyright (C) 2002-11 by Bruce Allen, http://smartmontools.sourceforge.net
/dev/sda [megaraid_disk_00] [SAT]: Device open changed type from 'megaraid' to 'sat'
=== START OF INFORMATION SECTION ===
Model Family: Seagate Constellation ES (SATA)
Device Model: ST31000524NS
Serial Number: XXXXXXXX
LU WWN Device Id: 5 000c50 01fb34d68
Firmware Version: KA02
User Capacity: 1,000,204,886,016 bytes [1.00 TB]
Sector Size: 512 bytes logical/physical
Device is: In smartctl database [for details use: -P show]
ATA Version is: 8
ATA Standard is: ATA-8-ACS revision 4
Local Time is: Wed Aug 26 17:32:03 2015 UTC
SMART support is: Available - device has SMART capability.
SMART support is: Enabled
# smartctl -i /dev/sdb -d megaraid,0 #this is the same drive as above (same serial)
smartctl 5.41 2011-06-09 r3365 [x86_64-linux-3.2.0-23-generic] (local build)
Copyright (C) 2002-11 by Bruce Allen, http://smartmontools.sourceforge.net
/dev/sdb [megaraid_disk_00] [SAT]: Device open changed type from 'megaraid' to 'sat'
=== START OF INFORMATION SECTION ===
Model Family: Seagate Constellation ES (SATA)
Device Model: ST31000524NS
Serial Number: XXXXXXXX
LU WWN Device Id: 5 000c50 01fb34d68
Firmware Version: KA02
User Capacity: 1,000,204,886,016 bytes [1.00 TB]
Sector Size: 512 bytes logical/physical
Device is: In smartctl database [for details use: -P show]
ATA Version is: 8
ATA Standard is: ATA-8-ACS revision 4
Local Time is: Wed Aug 26 17:36:44 2015 UTC
SMART support is: Available - device has SMART capability.
SMART support is: Enabled
Operating system : AIX 7.1
Perl version : 5.10.1.250
Unix agent version : 2.3
Hi,
We encounter an issue with OCS Unix agent concerning the networks and disks informations.
Below the related log :
-------------8<------------------------------------------
0516-306 : Unable to find 4 in the Device
Configuration Database.
0516-306 : Unable to find 3 in the Device
Configuration Database.
0516-306 : Unable to find 4 in the Device
Configuration Database.
0516-306 : Unable to find 4 in the Device
Configuration Database.
0516-306 lslv: Unable to find 4 in the Device
Configuration Database.
0516-306 lslv: Unable to find 3 in the Device
Configuration Database.
0516-306 lslv: Unable to find 4 in the Device
Configuration Database.
0516-306 lslv: Unable to find 4 in the Device
Configuration Database.
0516-306 : Unable to find volume group 1 in the Device
Configuration Database.
0516-306 : Unable to find volume group 1 in the Device
Configuration Database.
-------------8<------------------------------------------
Can you help me to resolve this stuff ?
P.S : I can provide more logs if you need...
Regards,
Loïc BRONDIN
Bonjour,
selon les logs coté Agent le scan de ipdiscover se passe bien mais ne remonte pas au serveur OCS
Serveur:
Nom du système : Linux x86_64
Version : 3.10.0-693.2.2.el7.x86_64
Distribution : CentOS Linux 7 (Core)
Logiciel
Version de PHP : 5.4.45
Serveur Web : Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/5.4.45 mod_perl/2.0.10 Perl/v5.16.3
Serveur SQL : MariaDB Server version 5.5.56-MariaDB
Version OCSReports: 2.3.1
Operating system : Debian
Perl version : This is perl 5, version 20, subversion 2 (v5.20.2)
Unix agent version : 2.3.1
Bonjour,
selon les logs coté Agent le scan de ipdiscover se passe bien mais ne remonte pas au serveur OCS
<IPDISCOVER>
<H>
<I>10.x.x.1</I>
<M>00:00:5e:00:01:01</M>
<N>-</N>
</H>
<H>
<I>10.x.x.2</I>
<M>ec:e5:55:53:ca:23</M>
<N>-</N>
</H>
<H>
<I>10.x.x.3</I>
<M>ec:e5:55:53:d0:23</M>
<N>-</N>
</H>
<H>
<I>10.x.x.16</I>
<M>ec:e5:55:f3:4d:05</M>
<N>-</N>
</H>
<H>
<I>10.x.x.18</I>
<M>ec:e5:55:f3:4c:f0</M>
<N>-</N>
</H>
</CONTENT>
<DEVICEID>AgentOcs-2017-10-17-06-59-22</DEVICEID>
<QUERY>INVENTORY</QUERY>
</REQUEST>
[Wed Oct 18 10:22:41 2017][debug] =BEGIN=SERVER RET======
[Wed Oct 18 10:22:41 2017][debug] $VAR1 = '<?xml version=\'1.0\' encoding=\'UTF-8\'?>
<REPLY>
<RESPONSE>NO_ACCOUNT_UPDATE</RESPONSE>
</REPLY>
';
[Wed Oct 18 10:22:41 2017][debug] =END=SERVER RET======
[Wed Oct 18 10:22:41 2017][debug] Calling handlers : `end_handler'
[Wed Oct 18 10:22:41 2017][debug] [download] Calling download_end_handler
[Wed Oct 18 10:22:41 2017][debug] [snmp] Calling snmp_end_handler
[Wed Oct 18 10:22:41 2017][info] [download] Beginning work. I am 2174.
[Wed Oct 18 10:22:41 2017][info] [download] Option turned off. Exiting.
[Wed Oct 18 10:22:41 2017][debug] [download] End of work...
The code that parses /proc/cpuinfo
and dmidecode
is flawed, iterating line by line through file/command output rather than reading CPU by CPU. Mostly this won't be noticeable on a system with only one CPU, or where all CPUs are identical, but some stats for CPU 1 will be taken from CPU 0 (and CPU 0 will be empty) because the record submits prematurely. As well, the core count for dmidecode
improperly falls back on /proc/cpuinfo
, and reports my dual 12-core Intel Xeon E5-2680 system as having 24 cores on each processor.
I'll fork and attempt a fix myself. It's likely that this problem affects other architectures as well, but I'll leave that code as-is since I have no way of testing it.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.