Seite 1 von 1
PC-Hersteller in LocalBoot-Paket abfragen
Verfasst: 13 Okt 2015, 10:34
von dark alex
Hallo,
ich brauche für ein LocalBoot-Paket die Information, welcher Hersteller den PC gebaut hat.
Hier reicht natürlich die Info aus dem hwinvent (byAudit-Treiberpfad) aus (betroffene Rechner werden ausschließlich per OPSI installiert).
Ich habe shcon die Doku gewälzt und dneke ich bin mit OpsiServiceCall auf dem richtigen Weg.
Allerdings stecke ich da bereits fest... Welche Methode gibt mir denn jetzt die gewünschte Info zurück?
Wird wohl irgendwie mit auditHardwareOnHost gehen. Aber wie?
Ich blicke da noch nicht wirklich durch...
Re: PC-Hersteller in LocalBoot-Paket abfragen
Verfasst: 13 Okt 2015, 14:10
von Konstantin
Hi,
aus dem opsi-Script etwa so:
[Aktionen]
requiredWinstVersion >= "4.11.3"
DefStringlist $computerclass$
defvar $vendor$
set $computerclass$ = splitString(takeFirstStringContaining(getReturnListFromSection ("opsiservicecall_auditHardwareOnHost_getObjects"), "vendor"), ",")
set $vendor$ = stringReplace (getValueBySeparator ('"vendor"', ":", $computerclass$ ), '"', '')
[opsiservicecall_auditHardwareOnHost_getObjects]
"method":"auditHardwareOnHost_getObjects"
"params":[
'[]',
'{"hostId" : "$clientid$","hardwareClass" : "COMPUTER_SYSTEM"}'
]
Meiner Meinung nach, sind solche Werte per WMI oder Registry viel komfortabler auszulesen.
Gruß
Konstantin
Re: PC-Hersteller in LocalBoot-Paket abfragen
Verfasst: 13 Okt 2015, 19:30
von SisterOfMercy
Uh what about this?
This gives resuls like this:
Code: Alles auswählen
;[7] [Jan 20 15:15:32:805] [openvpn-client] (string 1)bios.Version=1.50
;[7] [Jan 20 15:15:32:805] [openvpn-client] (string 9)bios.OEM String[1]=PSC1QE-03HLDU,SSC1Q03HLDU
;[7] [Jan 20 15:15:32:805] [openvpn-client] (string 13)bios.System Config String[1]=SMI:00B202
;[7] [Jan 20 15:15:32:805] [openvpn-client] (string 14)bios.System Config String[2]=DSN:0520B6A340A7A4
;[7] [Jan 20 15:15:32:805] [openvpn-client] (string 15)bios.System Config String[3]=DSN:M471B527H0-CH9 B14533CC
;[7] [Jan 20 15:15:32:805] [openvpn-client] (string 17)sysinfo.Manufacter=TOSHIBA
;[7] [Jan 20 15:15:32:805] [openvpn-client] (string 18)sysinfo.Product Name=SATELLITE C660
;[7] [Jan 20 15:15:32:805] [openvpn-client] (string 19)sysinfo.Version=PSC1QE-03HLDU
;[7] [Jan 20 15:15:32:805] [openvpn-client] (string 20) sysinfo.Serial Number=8B0542K
;[7] [Jan 20 15:15:32:805] [openvpn-client] (string 21)sysinfo.UUID=78CC1365B8DE118D5B870F4CA4719
;[7] [Jan 20 15:15:32:805] [openvpn-client] (string 22)sysinfo.SKU Number=PSC1QE-03H0DU
;[7] [Jan 20 15:15:32:805] [openvpn-client] (string 23)sysinfo.Family=ABCDEFGHIJKLMNOPQRSTUVWXYZ
;[7] [Jan 20 15:15:32:805] [openvpn-client] (string 24)board.Manufacter=TOSHIBA
;[7] [Jan 20 15:15:32:805] [openvpn-client] (string 25)board.Product=PWWHA
;[7] [Jan 20 15:15:32:805] [openvpn-client] (string 26)board.Version=1.00
;[7] [Jan 20 15:15:32:805] [openvpn-client] (string 27)board.Serial Number=0123456789AB
;[7] [Jan 17 00:46:28:427] [openvpn-client] (string 1)bios.Version=F14
;[7] [Jan 17 00:46:28:427] [openvpn-client] (string 5)sysinfo.Manufacter=Gigabyte Technology Co., Ltd.
;[7] [Jan 17 00:46:28:427] [openvpn-client] (string 6)sysinfo.Product Name=P35-DS4
;[7] [Jan 17 00:46:28:427] [openvpn-client] (string 7)sysinfo.Version=
;[7] [Jan 17 00:46:28:427] [openvpn-client] (string 8)sysinfo.Serial Number=
;[7] [Jan 17 00:46:28:427] [openvpn-client] (string 9) sysinfo.UUID=00000000000000000001A4D7013
;[7] [Jan 17 00:46:28:427] [openvpn-client] (string 10)sysinfo.SKU Number=
;[7] [Jan 17 00:46:28:427] [openvpn-client] (string 11)sysinfo.Family=
;[7] [Jan 17 00:46:28:427] [openvpn-client] (string 12)board.Manufacter=Gigabyte Technology Co., Ltd.
;[7] [Jan 17 00:46:28:427] [openvpn-client] (string 13)board.Product=P35-DS4
It would be great if you could somehow modify those fields permanently. For instance, to set a serial number for that Gigabyte thing. And the things asus fills in are mostly crap.

Re: PC-Hersteller in LocalBoot-Paket abfragen
Verfasst: 23 Okt 2015, 12:44
von n.wenselowski
Hi,
SisterOfMercy hat geschrieben:It would be great if you could somehow modify those fields permanently. For instance, to set a serial number for that Gigabyte thing. And the things asus fills in are mostly crap.

You know of opsihwaudit.conf?
-N
Re: PC-Hersteller in LocalBoot-Paket abfragen
Verfasst: 23 Okt 2015, 13:04
von SisterOfMercy
n.wenselowski hat geschrieben:You know of opsihwaudit.conf?
No, I did not. But I meant to permanently set fields for only some clients.
This asus thing has no serial number filled in, it would be nice to be able to set that to the correct serial. Of course, this is not really an issue with OPSI, more with the client itself.
Re: PC-Hersteller in LocalBoot-Paket abfragen
Verfasst: 23 Okt 2015, 13:09
von n.wenselowski
Ah, Problem erkannt.
Wenn du irgendwie an die richtigen Werte kommst, kannst du die Werte des Clients mittels opsiServiceCall berichtigen.
Gruß
Niko
Re: PC-Hersteller in LocalBoot-Paket abfragen
Verfasst: 29 Okt 2015, 11:20
von dark alex
Konstantin hat geschrieben:Hi,
aus dem opsi-Script etwa so:
[Aktionen]
requiredWinstVersion >= "4.11.3"
DefStringlist $computerclass$
defvar $vendor$
set $computerclass$ = splitString(takeFirstStringContaining(getReturnListFromSection ("opsiservicecall_auditHardwareOnHost_getObjects"), "vendor"), ",")
set $vendor$ = stringReplace (getValueBySeparator ('"vendor"', ":", $computerclass$ ), '"', '')
[opsiservicecall_auditHardwareOnHost_getObjects]
"method":"auditHardwareOnHost_getObjects"
"params":[
'[]',
'{"hostId" : "$clientid$","hardwareClass" : "COMPUTER_SYSTEM"}'
]
Meiner Meinung nach, sind solche Werte per WMI oder Registry viel komfortabler auszulesen.
Gruß
Konstantin
Hallo Konstantin,
leider klappt das so nicht
Code: Alles auswählen
[...]
(162) [5] [Okt 27 12:55:15:812] [test] Set $hersteller$ = stringReplace (getValueBySeparator ('"vendor"', ":", $computerclass$ ), '"', '')
(163) [6] [Okt 27 12:55:15:817] [test] retrieving strings from $computerclass$ [switch to loglevel 7 for debugging]
(164) [6] [Okt 27 12:55:15:817] [test] The value of the variable "$hersteller$" is now: "NULL"
[...]
//Edit:
Sorry meine Schuld! Tippfehler

Re: PC-Hersteller in LocalBoot-Paket abfragen
Verfasst: 04 Nov 2015, 12:42
von Konstantin
[Aktionen]
requiredWinstVersion >= "4.11.3"
setloglevel=9
DefStringlist $computerclass$
defvar $vendor$
DefVar $OpsiPath$
DefVar $IniCfg$
DefVar $ClientId$
DefVar $Password$
DefVar $OpsiUrl$
Set $OpsiPath$ = ExtractFilePath (GetRegistryStringValue("[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\opsiclientd] ImagePath" ))
if FileExists($OpsiPath$ + "\opsiclientd\opsiclientd.conf")
Set $IniCfg$ = $OpsiPath$ + "\opsiclientd\opsiclientd.conf"
Else
comment "error"
isFatalError
EndIf
Set $ClientID$ = GetValueFromIniFile($IniCfg$, "global", "host_id","")
Set $Password$ = GetvalueFromInifile($IniCfg$, "global", "opsi_host_key", "")
Set $OpsiUrl$ = GetvalueFromInifile($IniCfg$, "config_service", "url", "")
If Not (($ClientID$ = "") AND NOT ($Password$ = "") AND NOT ($OpsiUrl$ = ""))
set $computerclass$ = splitString(takeFirstStringContaining(getReturnListFromSection ("opsiservicecall_auditHardwareOnHost_getObjects /username $ClientId$ /password $Password$ /serviceurl $OpsiUrl$"), "vendor"), ",")
set $vendor$ = stringReplace (getValueBySeparator ('"vendor"', ":", $computerclass$ ), '"', '')
Else
comment "error"
isFatalError
EndIf
[opsiservicecall_auditHardwareOnHost_getObjects]
"method":"auditHardwareOnHost_getObjects"
"params":[
'[]',
'{"hostId" : "$clientid$","hardwareClass" : "COMPUTER_SYSTEM"}'
]