reticentrobot / snipeagent Goto Github PK
View Code? Open in Web Editor NEWThis project forked from mike1002/snipeagent
Windows Agent for Snipe-IT Open Source Asset Management
License: Apache License 2.0
This project forked from mike1002/snipeagent
Windows Agent for Snipe-IT Open Source Asset Management
License: Apache License 2.0
Have option for Agent to grab Asset Tag from BIOS.
Will this agent function with the cloud hosted version of the SnipeIT application versus the self hosted, on site enviornment?
When I check dashboard, or asset, it is not updated. However, when I look at output, there are not errors:
HTTP 200: Connection to Snipe-IT instance succeded.
Attempting to create type: SnipeSharp.Endpoints.Models.Manufacturer
Instance name: ********
Already exists in DB
Attempting to create type: SnipeSharp.Endpoints.Models.Category
Instance name: Desktop
Already exists in DB
Attempting to create type: SnipeSharp.Endpoints.Models.Model
Instance name: **********
Already exists in DB
Attempting to create type: SnipeSharp.Endpoints.Models.Company
Instance name: ************
Already exists in DB
Attempting to create type: SnipeSharp.Endpoints.Models.StatusLabel
Instance name: in production
Already exists in DB
Attempting to create type: SnipeSharp.Endpoints.Models.Location
Instance name: **********
Already exists in DB
Asset already exists in db. Checking for consistency.
Changes in asset detected. Updating:
Total program execution time 1334ms.
3/31/2022 12:05:31 PM: Exiting application.
Can anybody provide me with a bit of clarification/documentation about how the OU setting work in the config. I'm trying to debug an issue where the Location is being reported from a child OU rather than the parent. I've got the following (see below) set as part of my config but i'm unclear if the 'OULevel key' needs to be changed or if there's something else causing this odd location issue.
As title states I'm getting this error when running the SnipeAgent. Anyone else having this issue?
EDIT: This occurred on both HP and a Lenovo device.
It would be handy that devices would be added with their correct warranty period.
There are several API's available for this part. Maybe a good idea to include it in the agent?
E.g.:
Dell: https://techdirect.dell.com/portal/AboutAPIs.aspx
HP: https://developers.hp.com/hp-client-management/doc/device-warranty
Lenovo: http://supportapi.lenovo.com/Documentation/Index.html
Cisco: https://developer.cisco.com/docs/support-apis/#!serial-number-to-information/cisco-serial-number-to-information-api-reference
See also #snipe/snipe-it#7326
Personally I would be helped with the HP warranty check, but other users might benefit from other.
Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly 'SnipeSharp, Version=0.3.1.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
at SnipeAgent.SnipeAgent.Main(String[] args)
The above exception is thrown when I try to run the exe after editing the config file as instructed.
Hello!
I have been installing this into the PC's where I work, and the agent runs at every boot to pick up on any changes that may be present. But when it runs at boot, a CMD window pops up, and when a user logs on, that may scare them, or they may thing the PC is broken. Is there any way to hide this so it will still run, but not show? Preferably this would be a setting in the config, since the "run at boot" registry key that is set will just execute the EXE without any parameters.
Hey Guys,
so the Agent its Working but the problem is.
When I get the data
Adjust as soon as you are in SnipeIt. The agent is no longer running. If I take a standard status, the agent runs. The location and company will not be confiscated either. Do you have an idea here?
Greetings City
hi i revoked all the changes (restored from snapshot)..
now i can't import csv files shows error "500 server error" on the latest version -Version v6.1.0 - build 10161 (master)
I think SharpSnipe has a problem with it's .update feature.
SnipeAgent creates assets fine via the SharpSnipe lib, but the update asset seems to fail.
I've got a custom app that uses the update method and it's not working as well.
Any ideas, finding it hard to debug where it's going wrong.
HI,
I have been running this agent fine for months then all of a sudden today we are getting the unhandled exception below, I'm not sure if its due to the latest .net update that happened but this is happening on multiple computers running Windows 10 with SnipeIT Version 5.1.5.
Unhandled Exception: SnipeSharp.Exceptions.InvalidStatusLabelTypeException: Deployed Is an invalid status label. Use undeployable, deployable, pending, archived, in production, ready to deploy
at SnipeSharp.Endpoints.Models.StatusLabel.set_Type(String value) in C:\Users\mccrory\Source\SnipeSharp\SnipeSharp\Endpoints\Models\StatusLabel.cs:line 36
at SnipeSharp.Endpoints.Models.StatusLabel..ctor(String name) in C:\Users\mccrory\Source\SnipeSharp\SnipeSharp\Endpoints\Models\StatusLabel.cs:line 13
at Void .ctor(System.String)(Object[] )
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObjectUsingCreatorWithParameters(JsonReader reader, JsonObjectContract contract, JsonProperty containerProperty, ObjectConstructor`1 creator, String id)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateNewObject(JsonReader reader, JsonObjectContract objectContract, JsonProperty containerMember, JsonProperty containerProperty, String id, Boolean& createdFromNonDefaultCreator)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateList(IList list, JsonReader reader, JsonArrayContract contract, JsonProperty containerProperty, String id)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateList(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, Object existingValue, String id)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings)
at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonSerializerSettings settings)
at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value)
at SnipeSharp.Endpoints.ExtendedManagers.AssetEndpointManager.FindBySerial(String serial) in C:\Users\mccrory\Source\SnipeSharp\SnipeSharp\Endpoints\ExtendedManagers\AssetEndpointManager.cs:line 35
at SnipeAgent.Broker.SyncAll(SnipeItApi snipe, Asset currentAsset, Model currentModel, Manufacturer currentManufacturer, Category currentCategory, Company currentCompany, StatusLabel currentStatusLabel, Location currentLocation) in C:\Users\mccrory\Source\SnipeAgent\Broker.cs:line 194
at SnipeAgent.SnipeAgent.Main(String[] args) in C:\Users\mccrory\Source\SnipeAgent\SnipeAgent.cs:line 354
Dear team,
First of all. Excelent work with this Agent.
It worked just fine.
Now. I do have an inquiry.
I kinda need, not only the client's notebook info slide ( wich loads the Manufacturer, Category, model and so forth ) info into my snipe-it, but also it's hardware components (Disks, RAM cards, Processor) and the user's current licenses (This one could be optional tho).
This is mandatory for me and my team, 'cause we're gonna have to deploy this agent all through the organization.
I understand this is all opensource and I can dive in and get into the import config.
Still. A guideline from you would help me out big.
Please advice. I remain attentive.
Best regards,
Ordnasil
Unhandled Exception: SnipeSharp.Exceptions.InvalidStatusLabelTypeException: In Stock / Storage Is an invalid status label. Use undeployable, deployable, pending, archived, in production, ready to deploy
at SnipeSharp.Endpoints.Models.StatusLabel.set_Type(String value) in C:\Users\mccrory\Source\SnipeSharp\SnipeSharp\Endpoints\Models\StatusLabel.cs:line 36
at SnipeSharp.Endpoints.Models.StatusLabel..ctor(String name) in C:\Users\mccrory\Source\SnipeSharp\SnipeSharp\Endpoints\Models\StatusLabel.cs:line 13
at Void .ctor(System.String)(Object[] )
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObjectUsingCreatorWithParameters(JsonReader reader, JsonObjectContract contract, JsonProperty containerProperty, ObjectConstructor`1 creator, String id)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateNewObject(JsonReader reader, JsonObjectContract objectContract, JsonProperty containerMember, JsonProperty containerProperty, String id, Boolean& createdFromNonDefaultCreator)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateList(IList list, JsonReader reader, JsonArrayContract contract, JsonProperty containerProperty, String id)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateList(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, Object existingValue, String id)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings)
at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonSerializerSettings settings)
at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value)
at SnipeSharp.Endpoints.ExtendedManagers.AssetEndpointManager.FindBySerial(String serial) in C:\Users\mccrory\Source\SnipeSharp\SnipeSharp\Endpoints\ExtendedManagers\AssetEndpointManager.cs:line 35
at SnipeAgent.Broker.SyncAll(SnipeItApi snipe, Asset currentAsset, Model currentModel, Manufacturer currentManufacturer, Category currentCategory, Company currentCompany, StatusLabel currentStatusLabel, Location currentLocation) in C:\Users\mccrory\Source\SnipeAgent\Broker.cs:line 194
at SnipeAgent.SnipeAgent.Main(String[] args) in C:\Users\mccrory\Source\SnipeAgent\SnipeAgent.cs:line 354
Received this error after installing agent, copying over known working config file, and then triggering the agent.exe via PSEXEC remotely.
Hey I just discovered this project after having a hard with marksman.
Would it be possible to add some custom values to the import?
Best regards!
@ReticentRobot Thanks for your solution, is it possible to have the asset tag value not get updated if it's already in existence, this is in case the value doesn't use the 001+serialNumber convention, but this is okay with new assets.
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.