scope-it / marksman Goto Github PK
View Code? Open in Web Editor NEWWindows agent for Snipe-IT asset management system
License: Apache License 2.0
Windows agent for Snipe-IT asset management system
License: Apache License 2.0
Unfortunately, I get all the virtual devices no matter whether PC or server the following known message:
Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object.
at Marksman.Sentry.RunWMI()
at Marksman.Marksman.Main(String[] args)
Does anyone have the same problem with the virtual devices and does anyone know a solution? Thank you very much for your help.
Hi,
First off thank you for this agent, it has saved me allot of time!
Unfortunatley though on a fresh windows 10 install that has been updated through windows update I get this error message.
Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object.
at Marksman.Sentry.RunWMI()
at Marksman.Marksman.Main(String[] args)
Any assistance would be appreciated
Hi
I'm trying to compile Marksman from the repo however, I've encountered a few issues.
I have managed to successfully get the SnipeSharp solution built and it appears to be loading into the Marksman solution properly however, there appears to be issues within the Marksman solution preventing a successful build.
Below are the issues I have encountered while trying to build this solution.
The marksman solution contains a VS installer (.vdproj) project however, this does not appear to be available either within this repository or another?
SearchFilter objects are created within Broker.cs
however, the SearchFilter class does not contain a constructor that takes a single argument.
In addition to the two errors listed above, the errors in the below screenshot are also present when attempting to build the solution.
OS: Windows 10
IDE: Visual Studio 2015 (Community Edition)
Hi,
I am trying to get this working but apparently the API is incorrect. I have regenerated one and tried that but no luck. Pleases can I get some help.
Also has there been any updates? I've seen that there should have been? I will find this extremely useful in my workplace.
PS C:\Users\VIGNESH> & "E:\snipe_it\Marksman.exe"
22-05-2023 6.08.16 PM: Started application.
HTTP 200: Connection to Snipe-IT instance succeded.
Attempting to create type: SnipeSharp.Endpoints.Models.Manufacturer
Instance name: LENOVO
Already exists in DB
Attempting to create type: SnipeSharp.Endpoints.Models.Category
Instance name: Laptop
Unhandled Exception: Newtonsoft.Json.JsonSerializationException: Error converting value {null} to type 'System.Boolean'. Path 'rows[0].eula', line 1, position 133. ---> System.InvalidCastException: Null object cannot be converted to a value type.
at System.Convert.ChangeType(Object value, Type conversionType, IFormatProvider provider)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.EnsureType(JsonReader reader, Object value, CultureInfo culture, JsonContract contract, Type targetType)
--- End of inner exception stack trace ---
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.EnsureType(JsonReader reader, Object value, CultureInfo culture, JsonContract contract, Type targetType)
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.ResolvePropertyAndCreatorValues(JsonObjectContract contract, JsonProperty containerProperty, JsonReader reader, Type objectType)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObjectUsingCreatorWithParameters(JsonReader reader, JsonObjectContract contract, JsonProperty containerProperty, ObjectConstructor1 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.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.EndpointManager
1.FindOne(ISearchFilter filter)
at SnipeSharp.Endpoints.EndpointManager`1.Create(T toCreate)
at Marksman.Broker.SyncAll(SnipeItApi snipe, Asset currentAsset, Model currentModel, Manufacturer currentManufacturer, Category currentCategory, Company currentCompany, StatusLabel currentStatusLabel, Location currentLocation)
at Marksman.Marksman.Main(String[] args)
PS C:\Users\VIGNESH>
The agent has suddenly stopped working for us. It says the item already exists in the database, but when browsing the database tables, the entry does not exist at all.
We did customize the code for the serial number so it queries the BIOS for the asset tag, so that may have something to do with it (See my fork for the code changes).
Any thoughts?
C:\Program Files (x86)\Marksman Scope-IT Agent>marksman
06/13/2019 4:18:48 PM: Started application.
HTTP 200: Connection to Snipe-IT instance succeded.
Attempting to create type: SnipeSharp.Endpoints.Models.Manufacturer
Instance name: System manufacturer
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: System Product Name
Already exists in DB
Attempting to create type: SnipeSharp.Endpoints.Models.Company
Instance name: Choose Company
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: Select Location
Already exists in DB
Attempting to create type: SnipeSharp.Endpoints.Models.Asset
Instance name: S1W10-ITADMIN
Already exists in DB
Total program execution time 1186ms.
06/13/2019 4:18:49 PM: Exiting application.
Do not let the marksman to run with default/empty config.
OR
rename shipped config to Marksman.config.example and check file existence on start.
Dears,
We want to update the serial number of the PCs that we already have in SnipeIT.
As we imported them with a csv file, we didn't populate the serial number field.
We would like to do it with marksman but as the asset is already created, it doesn't update the serial, even if blank.
How can we modify the broker.cs file in order to force also the serial update?
Kind regards
Need to have more logging. In general, an exception should be handled and result in a descriptive stack trace dumped to the log file / console.
This is the configuration file
<add key="API" value="hidden for security"/>
<add key="BaseURI" value="hidden for security"/>
<add key="DefaultStatusLabel" value="Ready to Deploy"/>
<add key="Company" value="BCG"/>
<add key="Location" value="IT-room-01"/>
<add key="OUEnabled" value="false"/>
<add key="OULevel" value="1"/>
<add key="Interactive" value="false"/>
<add key="WarrantyMonths" value="60"/>
<add key="AssetTagPrefix" value="002"/>
</appSettings>
and this is de error when i run marksman.exe
I don't understand I have to do
The company I do work for is a Global company, our Forest is split into countries by OU.
I'm over the USA primarily and this has been working fine, but we are taking over Canada IT management and we were trying to see if there is way to point at two LDAP binds instead of pointing to the root of our Countries OU and pulling every user across the company in as that would be a massive amount. We only want to pull in the OUs we are responsible for. We then sort by location and use the LDAP OU pointer there to sort users by location.
Can anyone confirm Marksman works with version 5.x of SnipeIT?
I'm trying to compile Marksman on Windows using Visual Studio 2017.
However it seems that the SnipeSharp API Reference doesn't seem to match the code.
The marksman code trying to call SearchFilter / Location / Statuslabel cannot as theirs no a constructor to take 1 argument. (all the constructors take 0 arguments in the class) so error CS1729 pops up 11 times.
What SnipeShare version are you using? - I've tried each of the forked versions but can't seem to find one that makes it work.
Or do you have any Windows build instructions?
When will the Component lookup (Hard drives, CPU, GPU,etc) feature be added to Marksman? Will it be able to tell us what software is loaded on a PC?
Work with the update functionality in SnipeSharp api
I would like to request advice on building application as window service and remote install on client machine.
I am getting an error in Windows 10 Invalid XML syntax on line 15 which is the API key
Can you update existing assets information using the agent?
Hello,
when running the EXE file I get the following error:
Unbehandelte Ausnahme: Newtonsoft.Json.JsonSerializationException: Error converting value {null} to type 'System.Boolean'. Path 'rows[0].eula', line 1, position 133. ---> System.InvalidCastException: Das NULL-Objekt kann nicht in einen Werttyp konvertiert werden.
bei System.Convert.ChangeType(Object value, Type conversionType, IFormatProvider provider)
bei Newtonsoft.Json.Serialization.JsonSerializerInternalReader.EnsureType(JsonReader reader, Object value, CultureInfo culture, JsonContract contract, Type targetType)
--- Ende der internen Ausnahmestapelüberwachung ---
bei Newtonsoft.Json.Serialization.JsonSerializerInternalReader.EnsureType(JsonReader reader, Object value, CultureInfo culture, JsonContract contract, Type targetType)
bei Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
bei Newtonsoft.Json.Serialization.JsonSerializerInternalReader.ResolvePropertyAndCreatorValues(JsonObjectContract contract, JsonProperty containerProperty, JsonReader reader, Type objectType)
bei Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObjectUsingCreatorWithParameters(JsonReader reader, JsonObjectContract contract, JsonProperty containerProperty, ObjectConstructor`1 creator, String id)
bei Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateNewObject(JsonReader reader, JsonObjectContract objectContract, JsonProperty containerMember, JsonProperty containerProperty, String id, Boolean& createdFromNonDefaultCreator)
bei Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
bei Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
bei Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateList(IList list, JsonReader reader, JsonArrayContract contract, JsonProperty containerProperty, String id)
bei Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateList(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, Object existingValue, String id)
bei Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
bei Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target)
bei Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
bei Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
bei Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
bei Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
bei Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
bei Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings)
bei Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonSerializerSettings settings)
bei Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value)
bei SnipeSharp.Endpoints.EndpointManager`1.FindOne(ISearchFilter filter)
bei SnipeSharp.Endpoints.EndpointManager`1.Create(T toCreate)
bei Marksman.Broker.SyncAll(SnipeItApi snipe, Asset currentAsset, Model currentModel, Manufacturer currentManufacturer, Category currentCategory, Company currentCompany, StatusLabel currentStatusLabel, Location currentLocation)
bei Marksman.Marksman.Main(String[] args)
The asset isn't created.
What can I do?
Thank You.
Is there a macOS version planned?
Hi there! @snipe (of Snipe-IT) here!
First off, thanks for writing this! It's a very cool project, and we're excited to see what you do with it! We were hoping you'd be willing to issue a new release with your manufacturer fixes in it, as we have a user who is trying to get Scope-IT working with Snipe-IT, and is hitting errors, specifically:
Unhandled Exception: SnipeSharp.Exceptions.RequiredValueIsNullException: Property Manufacturer cannot be null.
at SnipeSharp.Endpoints.QueryParameterBuilder.GetParameters(Object item)
at SnipeSharp.Common.RequestManagerRestSharp.Post(String path, ICommonEndpointModel item)
at SnipeSharp.Endpoints.EndpointManager`1.Create(T toCreate)
at Marksman.Sentry.GetAsset(NameValueCollection appSettings, SnipeItApi snipe)
at Marksman.Marksman.Main(String[] args)
It looks like #5 might be the missing piece there, and we'd love it if he could download a version with that fix in it.
Thanks so much for your time, and for this awesome project!
Is there a way to silently install Marksman with the marksman config settings preconfigured and then having it run the exe file automatically?
I want to deploy Marksman on at least 200 laptops and installing the MSI manually is time consuming.
Hi Guys,
1st let me CONGRATULATE all of you for your hard work and dedication to this project. THANK YOU !!
In relation to this particular issue: "Could not establish trust relationship for the SSL/TLS secure channel":
Is it possible to "allow" self-signed certificates or somehow bypass the "ssl check" ?
Maybe this will help ???!
https://dejanstojanovic.net/aspnet/2014/september/bypass-ssl-certificate-validation/
Many thanks in advance.
When using either the MSI, or compiling from source, the MAC address on our Dell, Lenovo, and HP laptops are not being populated during new asset creation. While looking at the code, I noticed line 129: customFields.Add("_snipeit_macaddress_1", macAddress); Is this trying to create a custom field instead of using the build in Asset with MAC Address?
Steps to recreate:
Install Marksman 1.01 MSI
Modify config file to connect to Snipe-IT
Run marksman.exe.
Verify new entry in Snipe-IT, without a MAC Address
I'm running the agent on a Latitude 7480 as my test machine.
Hi,
I am getting this error when trying to run the agent.
15/07/2019 08:52:56: Started application.
HTTP 200: Connection to Snipe-IT instance succeded.
Attempting to create type: SnipeSharp.Endpoints.Models.Manufacturer
Instance name: Hewlett-Packard
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: HP Compaq Elite 8300 Touch All-in-One PC
Already exists in DB
Attempting to create type: SnipeSharp.Endpoints.Models.Company
Instance name: Bowland High
Already exists in DB
Attempting to create type: SnipeSharp.Endpoints.Models.StatusLabel
Instance name: ready to deploy
Unhandled Exception: SnipeSharp.Exceptions.InvalidStatusLabelTypeException: Ready to Deploy (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)
at SnipeSharp.Endpoints.Models.StatusLabel..ctor(String name)
at Void .ctor(System.String)(Object[] )
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObjectUsingCreatorWithParameters(JsonReader reader, JsonObjectContract contract, JsonProperty containerProperty, ObjectConstructor1 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.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.EndpointManager
1.FindOne(ISearchFilter filter)
at SnipeSharp.Endpoints.EndpointManager`1.Create(T toCreate)
at Marksman.Broker.SyncAll(SnipeItApi snipe, Asset currentAsset, Model currentModel, Manufacturer currentManufacturer, Category currentCategory, Company currentCompany, StatusLabel currentStatusLabel, Location currentLocation)
at Marksman.Marksman.Main(String[] args)
I have tried to change the status label and still get the same issue. The old one still works but would rather have the auto updater.
When we run the agent, we get the following error....
C:\Program Files (x86)\Scope-IT\Marksman>marksman
5/15/2019 9:47:44 AM: Started application.
HTTP 200: Connection to Snipe-IT instance succeded.
Attempting to create type: SnipeSharp.Endpoints.Models.Manufacturer
Instance name: LENOVO
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: 10MR0004US
Already exists in DB
Attempting to create type: SnipeSharp.Endpoints.Models.Company
Instance name: PACT
Unhandled Exception: Newtonsoft.Json.JsonReaderException: Unexpected character encountered while parsing value: <. Path '', line 0, position 0.
at Newtonsoft.Json.JsonTextReader.ParseValue()
at Newtonsoft.Json.JsonTextReader.Read()
at Newtonsoft.Json.JsonReader.ReadForType(JsonContract contract, Boolean hasConverter)
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.EndpointManager1.FindOne(ISearchFilter filter) at SnipeSharp.Endpoints.EndpointManager
1.Create(T toCreate)
at Marksman.Broker.SyncAll(SnipeItApi snipe, Asset currentAsset, Model currentModel, Manufacturer currentManufacturer, Category currentCategory, Company currentCompany, StatusLabel currentStatusLabel, Location currentLocation)
at Marksman.Marksman.Main(String[] args)
Hi,
It seems we are missing "fieldset" as a config setting. Might help with automatic mac address on a new model additions.
Secondly we might want to add "status label" on addition. Also temporarily through config file.
Unhandled Exception: SnipeSharp.Exceptions.RequiredValueIsNullException: Property Manufacturer cannot be null.
at SnipeSharp.Endpoints.QueryParameterBuilder.GetParameters(Object item)
at SnipeSharp.Common.RequestManagerRestSharp.Post(String path, ICommonEndpointModel item)
at SnipeSharp.Endpoints.EndpointManager`1.Create(T toCreate)
at Marksman.Sentry.GetAsset(NameValueCollection appSettings, SnipeItApi snipe)
at Marksman.Marksman.Main(String[] args)
However WMI explorer shows "LENOVO" as a manufacturer After manually creating the manufacturer got
7/3/2018 12:10:36 PM: Started application.
Unhandled Exception: SnipeSharp.Exceptions.RequiredValueIsNullException: Property Category cannot be null.
at SnipeSharp.Endpoints.QueryParameterBuilder.GetParameters(Object item)
at SnipeSharp.Common.RequestManagerRestSharp.Post(String path, ICommonEndpointModel item)
at SnipeSharp.Endpoints.EndpointManager`1.Create(T toCreate)
at Marksman.Sentry.GetAsset(NameValueCollection appSettings, SnipeItApi snipe)
at Marksman.Marksman.Main(String[] args)
Category - > null
Universal class which implements "create if doesn't exist" behaviour
*Manufacturers
*Locations
*Assets
*Models
Hello all
on my first client, where i'm testing snipeit and your agent we receive an error as show below. On snipeit I can see only the category "Laptop" has been created
C:\Program Files (x86)\Scope-IT\Marksman>Marksman.exe
18/02/2021 19:44:50: Started application.
HTTP 200: Connection to Snipe-IT instance succeded.
Attempting to create type: SnipeSharp.Endpoints.Models.Manufacturer
Instance name: FUJITSU
Attempting to create type: SnipeSharp.Endpoints.Models.Category
Instance name: Laptop
Unhandled Exception: Newtonsoft.Json.JsonSerializationException: Error converting value {null} to type 'System.Boolean'. Path 'rows[0].eula', line 1, position 108. ---> System.InvalidCastException: Null object cannot be converted to a value type.
at System.Convert.ChangeType(Object value, Type conversionType, IFormatProvider provider)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.EnsureType(JsonReader reader, Object value, CultureInfo culture, JsonContract contract, Type targetType)
--- End of inner exception stack trace ---
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.EnsureType(JsonReader reader, Object value, CultureInfo culture, JsonContract contract, Type targetType)
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.ResolvePropertyAndCreatorValues(JsonObjectContract contract, JsonProperty containerProperty, JsonReader reader, Type objectType)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObjectUsingCreatorWithParameters(JsonReader reader, JsonObjectContract contract, JsonProperty containerProperty, ObjectConstructor1 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.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.EndpointManager
1.FindOne(ISearchFilter filter)
at SnipeSharp.Endpoints.EndpointManager`1.Create(T toCreate)
at Marksman.Broker.SyncAll(SnipeItApi snipe, Asset currentAsset, Model currentModel, Manufacturer currentManufacturer, Category currentCategory, Company currentCompany, StatusLabel currentStatusLabel, Location currentLocation)
at Marksman.Marksman.Main(String[] args)
C:\Program Files (x86)\Scope-IT\Marksman>
Is there an option to get this to silently run? If not I would like to request it as a feature.
After trying to run the marksman I get the below error, not sure where the problem is. The API key was created from the SnipeIT user's "ManageAPIKeys"
"C:\Program Files (x86)\Scope-IT\Marksman>Marksman
1/8/2019 12:32:52 PM: Started application.
HTTP 403: Unauthorized. Please check the API key value in your
block of the Marksman config file and ensure it has been set to a valid key.
ERROR: Could not connect to SnipeIT database instance.
Total program execution time 1522ms.
1/8/2019 12:32:53 PM: Exiting application."
So, following on from setting the status of a device to Damaged - Water Damage.
the script is now treated with the following error.
C:\Program Files (x86)\Scope-IT\Marksman>Marksman.exe
06/07/2020 09:43:16: Started application.
HTTP 200: Connection to Snipe-IT instance succeded.
Attempting to create type: SnipeSharp.Endpoints.Models.Manufacturer
Instance name: Gigabyte Technology Co., Ltd.
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: AX370-Gaming K5
Already exists in DB
Attempting to create type: SnipeSharp.Endpoints.Models.Company
Instance name: Partnerize
Already exists in DB
Attempting to create type: SnipeSharp.Endpoints.Models.StatusLabel
Instance name: Ready to Deploy
Already exists in DB
Attempting to create type: SnipeSharp.Endpoints.Models.Location
Instance name: NCL
Already exists in DB
Unhandled Exception: SnipeSharp.Exceptions.InvalidStatusLabelTypeException: Damaged - Water Damage Is an invalid status label. Use undeployable, deployable, pending, archived, in production, ready to deploy
at SnipeSharp.Endpoints.Models.StatusLabel.set_Type(String value)
at SnipeSharp.Endpoints.Models.StatusLabel..ctor(String name)
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)
at Marksman.Broker.SyncAll(SnipeItApi snipe, Asset currentAsset, Model currentModel, Manufacturer currentManufacturer, Category currentCategory, Company currentCompany, StatusLabel currentStatusLabel, Location currentLocation)
at Marksman.Marksman.Main(String[] args)
C:\Program Files (x86)\Scope-IT\Marksman>pause
Press any key to continue . . .
Hello,
So I am testing this on my local environment to snipe and it is updating snipe which is good, however for the assets AssetTagPrefix.
When am updating it in the .exe.config to bv_asset_number, it keeps updating to the S/N, however on snipe all assets have they own id, for example, bv_asset_506, is they any way I can set this up or a way for it to ignore if snipe has a different asset tag?
thanks,
Josh
We have already bulk imported info from AD. When running the config, it overwrites what is there or if I use "", it shows "undfined. Is there a way to preserve existing data for those two fields?
I set this up on web server and tried to get marksman to work on pc filled out api key and info then try run exe and keep getting error
the application has failed to start because its side-by-side
I've googled and watched loads of video on how to fix it but cant seem to get it to run.
I've installed Microsoft visual c++ redistributable also still noting
any ideas ?
Hey Guys,
When I run the Marksman.exe file I get the "Please double-check the BaseURI key in your " error. I have already edited the config file to match my baseURI and API key as indicated in the README.
Any suggestions on how to get this fixed? Thanks!
6/17/2019 4:35:32 PM: Started application.
System.Net.WebException: The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel. ---> System.Security.Authentication.AuthenticationException: The remote certificate is invalid according to the validation procedure.
at System.Net.Security.SslState.StartSendAuthResetSignal(ProtocolToken message, AsyncProtocolRequest asyncRequest, Exception exception)
at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.StartReadFrame(Byte[] buffer, Int32 readBytes, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.StartReadFrame(Byte[] buffer, Int32 readBytes, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.StartReadFrame(Byte[] buffer, Int32 readBytes, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.StartReadFrame(Byte[] buffer, Int32 readBytes, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.StartReadFrame(Byte[] buffer, Int32 readBytes, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.StartReadFrame(Byte[] buffer, Int32 readBytes, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.ForceAuthentication(Boolean receiveFirst, Byte[] buffer, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.ProcessAuthentication(LazyAsyncResult lazyResult)
at System.Net.TlsStream.CallProcessAuthentication(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Net.TlsStream.ProcessAuthentication(LazyAsyncResult result)
at System.Net.TlsStream.Write(Byte[] buffer, Int32 offset, Int32 size)
at System.Net.PooledStream.Write(Byte[] buffer, Int32 offset, Int32 size)
at System.Net.ConnectStream.WriteHeaders(Boolean async)
--- End of inner exception stack trace ---
at System.Net.HttpWebRequest.GetResponse()
at Marksman.Broker.CheckConnection(NameValueCollection appSettings)
Please double-check the BaseURI key in your
block of the Marksman config file and ensure it points to your instance of Snipe-IT.
ERROR: Could not connect to SnipeIT database instance.
config file:
Hello,
We're needing the agent to query the asset tag using WMI on SMBiosAssetTag to query the asset tag set in the bios of Dell laptops and desktops.
Running the following from PS provides the expected result:
(Get-WmiObject Win32_SystemEnclosure).SMBiosAssetTag
I'm new to VS and C#, and get errors when I try to run a build: Error CS1729 'SearchFilter' does not contain a constructor that takes 1 arguments line 105
I think I can figure out the code needed to query the asset tag directly if I could get the solution to build. Any help greatly appreciated!
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.