Tiny Core Linux

Tiny Core Extensions => TCE Talk => Topic started by: Rabie on January 30, 2023, 12:02:42 AM

Title: OCS Inventory on TC 13.x
Post by: Rabie on January 30, 2023, 12:02:42 AM
Hi There,

i am trying to install OCS Inventory NG Agent 2.x  https://wiki.ocsinventory-ng.org/03.Basic-documentation/Setting-up-the-UNIX-agent-manually-on-client-computers/

I don't think that all the Requirements are in the repository.


PERL 5.8 and higher                      -->  perl5.tcz ?
Perl module XML::Simple               -->  perl_xml_simple.tcz ?
Perl module Compress::Zlib           --> zlib_base-dev.tcz ?
Perl module Net::IP                       --> ?
Perl module LWP::UserAgent          --> ?
Perl module Digest::MD5               --> ?
Perl module Net::SSLeay               --> ?
Perl module Data::UUID                --> ?
dmidecode                                    --> dmidecode.tcz
lspci on Linux and *BSD (pciutils package)   --> libpci.tcz ?
Make utility                                               --> make.tcz
C/C++ compiler like GNU GCC                     --> gcc.tcz


the installed Modules right now:

Code: [Select]
instmodsh
Available commands are:
   l            - List all installed modules
   m <module>   - Select a module
   q            - Quit the program
cmd? l
Installed modules are:
   Bundle::NetSNMP
   Perl

thank you for helping
Title: Re: OCS Inventory on TC 13.x
Post by: Juanito on January 30, 2023, 12:16:43 AM
As per the info file the perl5 extension in tc-13.x is 5.32.0

For the missing perl modules, you can either compile them or install them using cpan
Title: Re: OCS Inventory on TC 13.x
Post by: Rabie on January 30, 2023, 02:44:15 AM
Hi Juanito,

when i try to install a Module i get the error "Make -- not ok"

Code: [Select]
install local::lib

Reading '/home/tc/.cpan/Metadata'
  Database was generated on Mon, 30 Jan 2023 08:54:00 GMT
Running install for module 'local::lib'
CPAN: Digest::SHA loaded ok (v6.02)
CPAN: Compress::Zlib loaded ok (v2.093)
Checksum for /opt/Scripts/cpan_sources/authors/id/H/HA/HAARG/local-lib-2.000029.tar.gz ok
Scanning cache /home/tc/.cpan/build for sizes
............................................................................DONE
local-lib-2.000029/
local-lib-2.000029/inc/
local-lib-2.000029/README
local-lib-2.000029/Changes
local-lib-2.000029/MANIFEST
local-lib-2.000029/LICENSE
local-lib-2.000029/t/
local-lib-2.000029/xt/
local-lib-2.000029/META.yml
local-lib-2.000029/META.json
local-lib-2.000029/lib/
local-lib-2.000029/maint/
local-lib-2.000029/eg/
local-lib-2.000029/Makefile.PL
local-lib-2.000029/eg/scripted_install.pl
local-lib-2.000029/maint/Makefile.PL.include
local-lib-2.000029/lib/POD2/
local-lib-2.000029/lib/local/
local-lib-2.000029/lib/lib/
local-lib-2.000029/lib/lib/core/
local-lib-2.000029/lib/lib/core/only.pm
local-lib-2.000029/lib/local/lib.pm
local-lib-2.000029/lib/POD2/DE/
local-lib-2.000029/lib/POD2/PT_BR/
local-lib-2.000029/lib/POD2/PT_BR/local/
local-lib-2.000029/lib/POD2/PT_BR/local/lib.pod
local-lib-2.000029/lib/POD2/DE/local/
local-lib-2.000029/lib/POD2/DE/local/lib.pod
local-lib-2.000029/xt/install.t
local-lib-2.000029/xt/cpan-bootstrap.t
local-lib-2.000029/xt/author/
local-lib-2.000029/xt/bootstrap.t
local-lib-2.000029/xt/release/
local-lib-2.000029/xt/cpan-bootstrap.pl
local-lib-2.000029/xt/lib/
local-lib-2.000029/xt/lib/dist_util.pm
local-lib-2.000029/xt/release/no-tabs.t
local-lib-2.000029/xt/release/eol.t
local-lib-2.000029/xt/author/pod-syntax.t
local-lib-2.000029/xt/author/cpan-changes.t
local-lib-2.000029/t/shell.t
local-lib-2.000029/t/bad_variables.t
local-lib-2.000029/t/carp-mismatch.t
local-lib-2.000029/t/subroutine-in-inc.t
local-lib-2.000029/t/taint-mode.t
local-lib-2.000029/t/stackable.t
local-lib-2.000029/t/lib/
local-lib-2.000029/t/pipeline.t
local-lib-2.000029/t/classmethod.t
local-lib-2.000029/t/de-dup.t
local-lib-2.000029/t/lib-core-only.t
local-lib-2.000029/t/lib/TempDir.pm
local-lib-2.000029/t/lib/ENVDumper.pm
local-lib-2.000029/inc/CheckVersion.pm
local-lib-2.000029/inc/CPANBootstrapper.pm
'YAML' not installed, will not store persistent state
CPAN: CPAN::Meta::Requirements loaded ok (v2.140)
CPAN: Parse::CPAN::Meta loaded ok (v2.150010)
CPAN: CPAN::Meta loaded ok (v2.150010)
Configuring H/HA/HAARG/local-lib-2.000029.tar.gz with Makefile.PL
Checking if your kit is complete...
Looks good
Generating a Unix-style Makefile
Writing Makefile for local::lib
Writing MYMETA.yml and MYMETA.json
  HAARG/local-lib-2.000029.tar.gz
  /usr/local/bin/perl Makefile.PL -- OK
Running make for H/HA/HAARG/local-lib-2.000029.tar.gz
CPAN: Module::CoreList loaded ok (v5.20200620)
make: Warning: File 'Makefile.PL' has modification time 87561258 s in the future
Makefile out-of-date with respect to Makefile.PL /usr/local/lib/perl5/5.32/core_perl/Config.pm /usr/local/lib/perl5/5.32/core_perl/CORE/config.h
Cleaning current config before rebuilding Makefile...
make -f Makefile.old clean > /dev/null 2>&1
"/usr/local/bin/perl" Makefile.PL
Checking if your kit is complete...
Looks good
Generating a Unix-style Makefile
Writing Makefile for local::lib
Writing MYMETA.yml and MYMETA.json
==> Your Makefile has been rebuilt. <==
==> Please rerun the make command.  <==
false
make: *** [Makefile:812: Makefile] Error 1
  HAARG/local-lib-2.000029.tar.gz
  /usr/local/bin/make -- NOT OK
Failed during this command:
 HAARG/local-lib-2.000029.tar.gz              : make NO
Title: Re: OCS Inventory on TC 13.x
Post by: Juanito on January 30, 2023, 02:58:07 AM
It looks like you need to set your machine to the correct time/date and load the compiletc extension.
Title: Re: OCS Inventory on TC 13.x
Post by: Rabie on January 30, 2023, 10:20:52 PM
thank you very much, you were right :)
Title: Re: OCS Inventory on TC 13.x
Post by: Rabie on January 30, 2023, 10:50:08 PM
can you tell me how to keep all modules i installed persistent even after reboot ?
Title: Re: OCS Inventory on TC 13.x
Post by: Juanito on January 30, 2023, 11:10:41 PM
I would presume the modules are installed under /usr/local/lib/perl5/5.32/site_perl with perhaps some files under /usr/local/bin - I wouldn't advise adding these files to a backup though as it would slow down booting.
Title: Re: OCS Inventory on TC 13.x
Post by: Rabie on January 31, 2023, 12:07:21 AM
but when i install OCS Iventory with " sudo make install"

doesn't i need all mudoles to be installed to use the Program OCS? Or i need them just to install the Program and then i can use it without the modules ?
Title: Re: OCS Inventory on TC 13.x
Post by: Juanito on January 31, 2023, 12:20:21 AM
I don't know.

You can try installing ocs inventory with "sudo make DESTDIR=/tmp/pkg install" and then look at /tmp/pkg to see what is installed.
Title: Re: OCS Inventory on TC 13.x
Post by: Rabie on February 06, 2023, 04:27:00 AM
Hi Juanito,

with instmodsh i can create a tar file from the installed Modules.

do you know if i can install the module from the created tar file without using cpan ?

Code: [Select]
instmodsh
Available commands are:
   l            - List all installed modules
   m <module>   - Select a module
   q            - Quit the program
cmd? l
Installed modules are:
   Bundle::NetSNMP
   Ocsinventory::Unix::Agent
   Perl
cmd? m Bundle::NetSNMP
Available commands are:
   f [all|prog|doc]   - List installed files of a given type
   d [all|prog|doc]   - List the directories used by a module
   v                  - Validate the .packlist - check for missing files
   t <tarfile>        - Create a tar archive of the module
   h                  - Display module help
   q                  - Quit the module
Bundle::NetSNMP cmd?

Title: Re: OCS Inventory on TC 13.x
Post by: Juanito on February 06, 2023, 04:38:03 AM
I assume you can, but I’ve never tried.
Title: Re: OCS Inventory on TC 13.x
Post by: Rabie on February 06, 2023, 04:41:27 AM
would you tell me a way to try ?
Title: Re: OCS Inventory on TC 13.x
Post by: Juanito on February 06, 2023, 04:53:36 AM
I guess it depends on how the tar archive was created - if you list the contents, do they include the full path?

For example: usr/local/lib/perl5/5.32/site_perl/XML/Parser/Expat.pm

..or do they contain: XML/Parser/Expat.pm
Title: Re: OCS Inventory on TC 13.x
Post by: Rabie on February 06, 2023, 05:13:01 AM
yes the include the full path when i extract the tar file like

Code: [Select]
tar xvpf Proc_Daemon.tar
tar: removing leading '/' from member names
usr/local/share/man/man3/Proc::Daemon.3
usr/local/lib/perl5/site_perl/Proc/Daemon.pm
usr/local/lib/perl5/site_perl/Proc/Daemon.pod



Title: Re: OCS Inventory on TC 13.x
Post by: Juanito on February 06, 2023, 05:20:31 AM
You should be able to test by extracting it in the root directory:
Code: [Select]
cp module.tcz.gz /
cd /
sudo tar xf module.tar.gz

..and then see if the module works.
Title: Re: OCS Inventory on TC 13.x
Post by: Rabie on February 06, 2023, 10:53:26 PM
It worked!
thank you very much!
Title: Re: OCS Inventory on TC 13.x
Post by: Juanito on February 06, 2023, 11:11:10 PM
In that case you should be able to make an extension out of the modules tar archive that will use much less ram.

Code: [Select]
mkdir /tmp/pkg
cp modules.tar.gz /tmp/pkg
cd /tmp/pkg
sudo tar xf modules.tar.gz
cd ../
sudo mksquashfs pkg/ modules.tcz

Title: Re: OCS Inventory on TC 13.x
Post by: Rabie on February 06, 2023, 11:43:13 PM
thanks i will work on that.

do you know by any chance how to get the Serial number from the connected Monitors ? I need that for the OCS Agent
Title: Re: OCS Inventory on TC 13.x
Post by: Juanito on February 06, 2023, 11:50:17 PM
The edid data might be available under /sys/class/drm.

Otherwise you might need to compile edid-decode or read-edid.
Title: Re: OCS Inventory on TC 13.x
Post by: Juanito on February 07, 2023, 02:06:58 AM
I get this:
Code: [Select]
$ edid-decode < /sys/devices/pci0000:00/0000:00:02.0/drm/card0/card0-eDP-1/edid
edid-decode (hex):

00 ff ff ff ff ff ff 00 09 e5 da 05 00 00 00 00
01 17 01 04 95 1c 10 78 02 b0 90 97 58 54 92 26
1d 50 54 00 00 00 01 01 01 01 01 01 01 01 01 01
01 01 01 01 01 01 64 1b 56 77 50 00 13 30 30 20
44 00 15 9c 10 00 00 1a 84 17 56 80 51 00 5c 30
64 64 44 05 15 9c 10 00 00 1a 00 00 00 fe 00 33
31 52 37 30 80 48 42 31 32 31 30 30 00 00 00 00
00 00 41 01 94 01 10 00 00 09 01 0a 20 20 00 f9

----------------

Block 0, Base EDID:
  EDID Structure Version & Revision: 1.4
  Vendor & Product Identification:
    Manufacturer: BOE
    Model: 1498
    Made in: week 1 of 2013
  Basic Display Parameters & Features:
    Digital display
    Bits per primary color channel: 6
    DisplayPort interface
    Maximum image size: 28 cm x 16 cm
    Gamma: 2.20
    Supported color formats: RGB 4:4:4
    First detailed timing includes the native pixel format and preferred refresh rate
  Color Characteristics:
    Red  : 0.5917, 0.3466
    Green: 0.3281, 0.5703
    Blue : 0.1503, 0.1142
    White: 0.3125, 0.3281
  Established Timings I & II: none
  Standard Timings: none
  Detailed Timing Descriptors:
    DTD 1:  1366x768    59.998545 Hz 683:384   47.219 kHz     70.120000 MHz (277 mm x 156 mm)
                 Hfront   48 Hsync  32 Hback   39 Hpol P
                 Vfront    4 Vsync   4 Vback   11 Vpol N
    DTD 2:  1366x768    40.000000 Hz 683:384   34.400 kHz     60.200000 MHz (277 mm x 156 mm)
                 Hfront  100 Hsync 100 Hback  184 Hpol P
                 Vfront   20 Vsync  20 Vback   52 Vpol N
    Alphanumeric Data String: '31R70'
    Manufacturer-Specified Display Descriptor (0x00): 00 00 00 00 41 01 94 01 10 00 00 09 01 0a 20 20 '....A.........  '
Checksum: 0xf9

..maybe Alphanumeric Data String: '31R70' is the serial number?
Title: Re: OCS Inventory on TC 13.x
Post by: Rabie on February 07, 2023, 02:52:23 AM
Yes i had to compile edid-decode from  http://archive.ubuntu.com/ubuntu/ubuntu/pool/universe/e/edid-decode/

and i get the serial number like you said:

Code: [Select]
sudo find / -name "edid"
/sys/devices/pci0000:00/0000:00:02.0/drm/card0/card0-HDMI-A-1/edid
/sys/devices/pci0000:00/0000:00:02.0/drm/card0/card0-eDP-1/edid
/sys/devices/pci0000:00/0000:00:02.0/drm/card0/card0-DP-2/edid
/sys/devices/pci0000:00/0000:00:02.0/drm/card0/card0-DP-1/edid


Code: [Select]
edid-decode /sys/devices/pci0000:00/0000:00:02.0/drm/card0/card0-eDP-1/edid
edid-decode (hex):

00 ff ff ff ff ff ff 00 09 d1 a6 78 45 54 00 00
16 1c 01 04 0e 35 1e 78 2e ba 45 a1 59 55 9d 28
0d 50 54 a5 6b 80 81 00 81 c0 81 80 a9 c0 b3 00
d1 c0 01 01 01 01 02 3a 80 18 71 38 2d 40 58 2c
45 00 13 2a 21 00 00 1e 00 00 00 ff 00 5a 35 4a
30 36 35 39 38 30 31 39 0a 20 00 00 00 fd 00 32
4c 1e 53 11 00 0a 20 20 20 20 20 20 00 00 00 fc
00 42 65 6e 51 20 47 4c 32 34 35 30 48 0a 00 9f

----------------

Block 0, Base EDID:
  EDID Structure Version & Revision: 1.4
  Vendor & Product Identification:
    Manufacturer: BNQ
    Model: 30886
    Serial Number: 21573
    Made in: week 22 of 2018
  Basic Display Parameters & Features:
    Analog display
    Signal Level Standard: 0.700 : 0.300 : 1.000 V p-p
    Blank level equals black level
    Sync: Separate Composite SyncOnGreen
    Maximum image size: 53 cm x 30 cm
    Gamma: 2.20
    DPMS levels: Off
    RGB color display
    Default (sRGB) color space is primary color space
    First detailed timing includes the native pixel format and preferred refresh rate
  Color Characteristics:
    Red  : 0.6308, 0.3505
    Green: 0.3339, 0.6152
    Blue : 0.1572, 0.0507
    White: 0.3134, 0.3291
  Established Timings I & II:
    IBM     :   720x400    70.081663 Hz   9:5     31.467 kHz     28.320000 MHz
    DMT 0x04:   640x480    59.940476 Hz   4:3     31.469 kHz     25.175000 MHz
    DMT 0x06:   640x480    75.000000 Hz   4:3     37.500 kHz     31.500000 MHz
    DMT 0x09:   800x600    60.316541 Hz   4:3     37.879 kHz     40.000000 MHz
    DMT 0x0b:   800x600    75.000000 Hz   4:3     46.875 kHz     49.500000 MHz
    Apple   :   832x624    74.551266 Hz   4:3     49.726 kHz     57.284000 MHz
    DMT 0x10:  1024x768    60.003840 Hz   4:3     48.363 kHz     65.000000 MHz
    DMT 0x12:  1024x768    75.028582 Hz   4:3     60.023 kHz     78.750000 MHz
    DMT 0x24:  1280x1024   75.024675 Hz   5:4     79.976 kHz    135.000000 MHz
    Apple   :  1152x870    75.061550 Hz 192:145   68.681 kHz    100.000000 MHz
  Standard Timings:
    DMT 0x1c:  1280x800    59.810326 Hz  16:10    49.702 kHz     83.500000 MHz
    DMT 0x55:  1280x720    60.000000 Hz  16:9     45.000 kHz     74.250000 MHz
    DMT 0x23:  1280x1024   60.019740 Hz   5:4     63.981 kHz    108.000000 MHz
    DMT 0x53:  1600x900    60.000000 Hz  16:9     60.000 kHz    108.000000 MHz (RB)
    DMT 0x3a:  1680x1050   59.954250 Hz  16:10    65.290 kHz    146.250000 MHz
    DMT 0x52:  1920x1080   60.000000 Hz  16:9     67.500 kHz    148.500000 MHz
  Detailed Timing Descriptors:
    DTD 1:  1920x1080   60.000000 Hz  16:9     67.500 kHz    148.500000 MHz (531 mm x 298 mm)
                 Hfront   88 Hsync  44 Hback  148 Hpol P
                 Vfront    4 Vsync   5 Vback   36 Vpol P
    Display Product Serial Number: 'Z5J06598019'
    Display Range Limits:
      Monitor ranges (GTF): 50-76 Hz V, 30-83 kHz H, max dotclock 170 MHz
    Display Product Name: 'BenQ GL2450H'
Checksum: 0x9f


thank you very much for helping  :)  :)