Jump to content

Steve G

Hornbill Developer
  • Content Count

    472
  • Joined

  • Last visited

  • Days Won

    20

Steve G last won the day on April 30

Steve G had the most liked content!

Community Reputation

130 Excellent

About Steve G

  • Rank
    Senior Member

Profile Information

  • Gender
    Male
  • Location
    Hull, UK

Contact Methods

  • Website URL
    https://www.hornbill.com

Recent Profile Visitors

2,223 profile views
  1. Hi @Dan Munns, What version of the tool are you running locally? As the tool didn't support both of those fields until v3.5.0 (and we're on 3.8.1 now). Cheers, Steve
  2. Thanks @Jeremy. I can't see the error from that screenhot though I'm afraid. I'll need to see the content of the state object, could you expand that and let me know what's in there, please? Thanks, Steve
  3. Hi @Jeremy, I've just given this a whirl, and I'm unable to replicate the issue Are there any information/errors presented in the browser console, as per ther toast message? If not, could you check the response of the call to the iBridgeInvoke API that is made when you visit the node (via the Network tab in the browser developer tools), then this should give us a more descriptive error in the response: Cheers, Steve
  4. Hi @AndyGilly, I've seen this before, and it's usually down to the Windows smart-quote characters finding their way into the dataframe that R is returning to Power BI. If you change csvEncoding variable in the R script to ISO-8859-1 then you should see your data returned to Power BI again - but with those pesky characters replaced by something that Power BI can handle. Let me know how you get on. Cheers, Steve
  5. Hi @Francis von Stein, There are 2 events around entity record creation, when we're talking webhooks: Create : This event is fired before the record is added to the entity, so its payload only contains the user-provided values and NOT any auto-assigned values (including auto-incrementing primary keys); Created : This event is fired after the record is added to the entity, and its payload contains all user provided AND auto-assigned values (including primary keys). For example, this is an example of the Create payload: { "onEntityEvent": { "eventSource": "urn:webhook:entity:Asset:create", "callingSessionId": "U2020072800159591", "eventTime": "2020-07-28 08:56:36Z", "actionBy": "steveg", "actionByName": "Steve Goldthorpe", "entity": "Asset", "record": { "h_acq_method": "-1", "h_class": "computer", "h_deprec_method": "-1", "h_description": "WEBHOOKTESTER", "h_last_updated": "2020-07-28 08:56:36", "h_last_updated_by": "steveg", "h_location_type": "-1", "h_name": "WEBHOOKTEST", "h_operational_state": "-1", "h_record_state": "1", "h_type": "1", "h_version": "1", "h_booking": "-1", "h_static": "-1" } } } And this is an example of the Created payload: { "onEntityEvent": { "eventSource": "urn:webhook:entity:Asset:created", "callingSessionId": "U2020072800159591", "eventTime": "2020-07-28 08:56:36Z", "actionBy": "steveg", "actionByName": "Steve Goldthorpe", "entity": "Asset", "record": { "h_pk_asset_id": "361", "h_acq_method": "-1", "h_class": "computer", "h_cost": "0.0", "h_created_date": "2020-07-28 08:56:36", "h_deprec_method": "-1", "h_deprec_value": "0.0", "h_description": "WEBHOOKTESTER", "h_disposal_price": "0.0", "h_last_updated": "2020-07-28 08:56:36", "h_last_updated_by": "steveg", "h_location_type": "-1", "h_maintenance_cost": "0.0", "h_name": "WEBHOOKTEST", "h_operational_state": "-1", "h_record_state": "1", "h_residual_value": "0.0", "h_type": "1", "h_version": "1", "h_booking": "-1", "h_static": "-1" } } } Note the additional auto-assigned properties in the Created payload, including the h_pk_asset_id. So by using the Entity : Asset : Created webhook event, you'll get the information you need: Cheers, Steve
  6. @TIm W Also, with regards to updating assets using the API's, check this post out as it contains some more useful information: Cheers, Steve
  7. Hi @TIm W, Sure. Here are a couple of examples of how you can do what you need using the Hornbill Python API Library, which contains examples and is documented over on Github. This is a basic code snippet that will return details of an asset with an exact match on name, where the name of the asset is SGMAC2011: from xmlmc import XmlmcService from xmlmc import XmlmcHelper xmlmc = XmlmcService("yourinstanceid") xmlmc.set_api_key("yourapikey") xmlmc.add_param("application", "com.hornbill.servicemanager") xmlmc.add_param("entity", "Asset") elem = xmlmc.add_param("searchFilter") elem.add_child("column", "h_name") elem.add_child("value", "SGMAC2011") elem.add_child("matchType", "exact") json_string = xmlmc.invoke("data", "entityBrowseRecords2") if XmlmcHelper.is_call_success(json_string): assetRecords = XmlmcHelper.get_param_value(json_string, "params/rowData/row")[0] assetId = assetRecords['h_pk_asset_id'] assetClass = assetRecords['h_class'] for attr, value in assetRecords.items(): print (attr, value) else: print(XmlmcHelper.get_error_message(json_string)) Note, we're using the data::entityBrowseRecords2 API to search through the Asset entity in Service Manager, and return the record. We're providing the instance ID (stevegdev here, but replace that with whatever yours is), and an API Key to authenticate the request. The image below shows the returned fields (I'm just looping through the properties of the returned object), and how they can be assigned to new variables you use later in the script. To add an asset, you can use the relevant Asset Creation API for the class of Asset you are creating. An example being AssetsComputer::addAssetComputer API, which will create a computer type asset: from xmlmc import XmlmcService from xmlmc import XmlmcHelper xmlmc = XmlmcService("yourinstanceid") xmlmc.set_api_key("yourapikey") xmlmc.add_param("name", "MYNEWASSET") xmlmc.add_param("type", "1") xmlmc.add_param("version", "1") json_string = xmlmc.invoke("apps/com.hornbill.servicemanager/AssetsComputer", "addAssetComputer") if XmlmcHelper.is_call_success(json_string): assetId = XmlmcHelper.get_param_value(json_string, "params/assetId") print(assetId) else: print(XmlmcHelper.get_error_message(json_string)) Note, if you have a look at the API documentation, it gives you a list of the input parameters. name, type and version are mandatory, and the rest are optional. With regards to the type input, this is the primary key of the asset type that the new asset should be. The easiest way to find out what value you should use here is in the Asset Type Details form in the main app: To update assets of class Computer, you can use the AssetsComputer::updateAssetComputer API. The code for that will be almost identical to the create code above, except you need to provide the asset ID to update. If you do a page search for addAsset, or updateAsset in the Service Manager API documentation, you can find the API's for creating and updating assets of different class. Hope this helps, Steve
  8. Hi @Josh Bridgens, Is there anything more in the generated log file? Thanks, Steve
  9. Hi @Josh Bridgens, You have the -dryrun=true argument set, which will perform a dry-run of the utility. This means that the utility won't make any changes to your Hornbill acounts, and everything will just be written to the log instead. Check out the documentation on the Hornbill wiki for more information. Cheers, Steve
  10. @Nikolaj, You'll need to grab the latest release for your OS and architecture from Github, and replace your 3.0.3 executable with that. Once that's done, you'll need to make some changes to your config. Firstly you need to remove the square brackets from the output field against the action, then hit save: Then in Attrib 5, replace the square brackets with curly braces, so it reads: {accountExpires} Or delete the value and inject it from the variable picker. Note, the newly created variables from the pre-import actions are all below the main variables. So you'll go from this: To this: Hope this helps! Cheers, Steve
  11. Hi @Nikolaj, This is now possible, if you're using v3.6.0 or above of the LDAP Import Tool. We've provided a pre-import action called LDAP Timestamp to Date & Time, which will take a field value containing an LDAP timestamp, and convert it into the YYYY-MM-DD HH:MM:SS format: So if you inject the Output of this action into one of the users fields (I've chosen Attrib 4, below) then the readable datetime will be written into the field: The user I've imported: Ansd the users record in Hornbill: Hope this helps. Steve
  12. @LifeOfJonny, This has now been fixed in the admin console. Let us know if you have any more issues. Cheers, Steve
  13. Hi @LifeOfJonny, We can replicate this, and are investigating. Will post back here once the investigation is complete. Cheers, Steve
  14. What's Changed Active Directory Group Management package. Removed hard-failures to ensure outcome and errors output parameters are populated in the event of a caught exception. Active Directory Group Management package. Replaced instances of Write-Host with Write-Output to support EncodedCommand execution, for SIS build > 3342. Active Directory User Management package. Added support for the correct handling of PowerShell Boolean Inputs, for SIS build > 3342. Active Directory User Management package. Removed hard-failures to ensure outcome and errors output parameters are populated in the event of a caught exception. Active Directory User Management package. Replaced instances of Write-Host with Write-Output to support EncodedCommand execution, for SIS build > 3342. Azure Automation package. Removed hard-failures to ensure outcome and errors output parameters are populated in the event of a caught exception. Azure Automation package. Replaced instances of Write-Host with Write-Output to support EncodedCommand execution, for SIS build > 3342. Dynatrace package. Removed hard-failures to ensure outcome and errors output parameters are populated in the event of a caught exception Dynatrace package. Replaced instances of Write-Host with Write-Output to support EncodedCommand execution in SIS build > 3342. Hyper-V package. Added support for the correct handling of PowerShell Boolean Inputs, for SIS build > 3342. Hyper-V package. Removed hard-failures to ensure outcome and errors output parameters are populated in the event of a caught exception. Hyper-V package. Replaced instances of Write-Host with Write-Output to support EncodedCommand execution, for SIS build > 3342. Nagios XI package. Removed hard-failures to ensure outcome and errors output parameters are populated in the event of a caught exception. Nagios XI package. Replaced instances of Write-Host with Write-Output to support EncodedCommand execution, for SIS build > 3342. PRTG package. Removed hard-failures to ensure outcome and errors output parameters are populated in the event of a caught exception. PRTG package. Replaced instances of Write-Host with Write-Output to support EncodedCommand execution, for SIS build > 3342. Rapid7 InsightVM package. Added support for the correct handling of PowerShell Boolean Inputs, for SIS build > 3342. Rapid7 InsightVM. Removed hard-failures to ensure outcome and errors output parameters are populated in the event of a caught exception. Rapid7 InsightVM. Replaced instances of Write-Host with Write-Output to support EncodedCommand execution, for SIS build > 3342. Rundeck package. Removed hard-failures to ensure outcome and errors output parameters are populated in the event of a caught exception. Rundeck package. Replaced instances of Write-Host with Write-Output to support EncodedCommand execution, for SIS build > 3342. VMware vSphere package. Added support for the correct handling of PowerShell Boolean Inputs, for SIS build > 3342. VMware vSphere package. Removed hard-failures to ensure outcome and errors output parameters are populated in the event of a caught exception. VMware vSphere package. Replaced instances of Write-Host with Write-Output to support EncodedCommand execution, for SIS build > 3342. Windows Disk Cleanup package. Added support for the correct handling of PowerShell Boolean Inputs, for SIS build > 3342. Windows Disk Cleanup package. Replaced instances of Write-Host with Write-Output to support EncodedCommand execution. Windows Management package. Replaced instances of Write-Host with Write-Output to support EncodedCommand execution, for SIS build > 3342.
×
×
  • Create New...