Ajout du paramètre userAgent pour distinguer la source de mise à jour de l'inventaire
This commit is contained in:
@ -28,7 +28,8 @@ settingsDefault = {
|
||||
"glpiServer":"http://127.0.0.1/glpi/",
|
||||
"glpiAppToken":"GLPIAppToken",
|
||||
"glpiUserToken":"GLPIUserToken",
|
||||
"stagingUser":"staging-pr"
|
||||
"stagingUser":"staging-pr",
|
||||
"userAgent":"Airwatch Synchronizer"
|
||||
}
|
||||
|
||||
settings = None
|
||||
@ -320,7 +321,7 @@ for device in devices:
|
||||
"accesslog":{
|
||||
"logdate": datetime.strptime(device["LastSeen"], "%Y-%m-%dT%H:%M:%S.%f").strftime("%Y-%m-%d %H:%M:%S")
|
||||
},
|
||||
"versionclient":"Airwatch Synchronizer",
|
||||
"versionclient":settings["userAgent"],
|
||||
"users":[
|
||||
{
|
||||
"login": device["UserName"]
|
||||
@ -388,7 +389,7 @@ for device in devices:
|
||||
|
||||
headers = {
|
||||
"Content-Type":"Application/x-compress",
|
||||
"user-agent":"Airwatch Synchronizer"
|
||||
"user-agent":settings["userAgent"]
|
||||
}
|
||||
if(debug):
|
||||
print(f"Updating {device_id} on GLPI")
|
||||
|
||||
Reference in New Issue
Block a user