You are not logged in.

Announcement

 Téléchargez la dernière version stable de GLPI      -     Et vous, que pouvez vous faire pour le projet GLPI ? :  Contribuer
 Download last stable version of GLPI                      -     What can you do for GLPI ? :  Contribute

#1 2021-11-17 23:16:18

WebGreg
Member
Registered: 2020-02-27
Posts: 729

How agent update Windows version?

Hi

I ask because I changed C:\Program Files\FusionInventory-Agent\perl\agent\FusionInventory\Agent\Task\Inventory\Win32\OS.pm

    # Support ReleaseID as Operating system version for Windows 10
    my $DisplayVersion = getRegistryValue(
        path => 'HKEY_LOCAL_MACHINE/Software/Microsoft/Windows NT/CurrentVersion/DisplayVersion'
    );
    $os->{VERSION} = $DisplayVersion if $DisplayVersion;

I forced an inventory and... nothing has changed:

KERNEL_VERSION: 10.0.19043
NAME: Windows
SERVICE_PACK:
TIMEZONE: HASH(0x8c83c70)
VERSION: 2009

Version is still from

    # Support ReleaseID as Operating system version for Windows 10
    my $releaseid = getRegistryValue(
        path => 'HKEY_LOCAL_MACHINE/Software/Microsoft/Windows NT/CurrentVersion/ReleaseId'
    );
    $os->{VERSION} = $releaseid if $releaseid;

--
GLPI 10.0.7
GLPI-Inventory 1.2.1
Ubuntu Server 20.04 LTS

Offline

#2 2021-11-18 11:24:43

gbougard
Moderator
From: Montpellier, France
Registered: 2021-07-21
Posts: 534
Website

Re: How agent update Windows version?

Hi WebGreg,

is it me or your last comment on issue #925 has been deleted ? Did you delete it by yourself ?

In that comment, you told the GLPI Agent is still doing the right thing. You should probably better forget to use FusionInventory Agent on Windows as nobody is seriously maintaining it for now and GLPI Agent like FIA is still fully opensource but officially maintained by GLPI Team.

Anyway here is what is doing GLPI Agent in the same case:

    # Support ReleaseID as Operating system version for Windows 10
    my $releaseid = getRegistryValue(
        path => 'HKEY_LOCAL_MACHINE/Software/Microsoft/Windows NT/CurrentVersion/ReleaseId'
    );

    # Support DisplayVersion as Operating system version from Windows 10 20H1
    my $displayversion = getRegistryValue(
        path => 'HKEY_LOCAL_MACHINE/Software/Microsoft/Windows NT/CurrentVersion/DisplayVersion'
    );
    if ($displayversion) {
        $os->{VERSION} = $displayversion;
    } elsif ($releaseid) {
        $os->{VERSION} = $releaseid;
    }

FusionInventory Agent on its side is only checking ReleaseId key which has been obsoleted by Microsoft and is stuck to 2009.

About your code, are you sure to set VERSION with $DisplayVersion after it has been set by $releaseid ?


GLPI-Agent developer from Teclib' and GLPI-Network team
Previously FusionInventory-Agent maintainer

Offline

#3 2021-11-18 13:07:34

WebGreg
Member
Registered: 2020-02-27
Posts: 729

Re: How agent update Windows version?

Hi gbougard.

Yes, I have deleted it because I started to be confused. At first I thought it worked (he changed my version for a test machine), but then it didn't work anymore. I don't know why it was good before. I made too many changes and I got lost which was effective.

I have read all these posts but version with $displayversion + $releaseid didn't work for me. Therefore, I decided to try only with $displayversion variant. And here's my confusion - it still doesn't work. That's why started this thread. Maybe this script is not running with every inventory. Or something else is going on?

Why OS.pm with

path => 'HKEY_LOCAL_MACHINE/Software/Microsoft/Windows NT/CurrentVersion/DisplayVersion'
    );
    $os->{VERSION} = $DisplayVersion if $DisplayVersion;

still reading ReleaseId which I deleted? After all, there are no miracles here - if there is something in the code, it has no right to work. Is something in some cache?


Thanks for the advice about the GLPI agent. I guess I have finaly to go check it. Apart from the reinstallation, something do I have to change in the plugin configuration? The first test went well and I don't seem to need to change anything, but I'd rather not be surprised in a while. There are many different options and dependencies smile

Last edited by WebGreg (2021-11-18 14:16:46)


--
GLPI 10.0.7
GLPI-Inventory 1.2.1
Ubuntu Server 20.04 LTS

Offline

Board footer

Powered by FluxBB