Jump to content

Steve G

Hornbill Developer
  • Content Count

    467
  • Joined

  • Last visited

  • Days Won

    20

Everything posted by Steve G

  1. @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
  2. 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
  3. Hi @Josh Bridgens, Is there anything more in the generated log file? Thanks, Steve
  4. 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
  5. @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
  6. 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
  7. @LifeOfJonny, This has now been fixed in the admin console. Let us know if you have any more issues. Cheers, Steve
  8. Hi @LifeOfJonny, We can replicate this, and are investigating. Will post back here once the investigation is complete. Cheers, Steve
  9. 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.
  10. What's New ITOM can now discover Windows computers using Windows Remote Management (WinRM). ITOM can now discover and run packages against Linux hosts using SSH, with the capability to run both scripts and native executables on target systems.
  11. Hi @AndyGilly, I've made the required changes, the scripts now support the use of proxies. Each script now has a number of variables that can be used to define the proxy details. If set to NULL, then a proxy will not be used. They are on Github now. Let me know how you get on with them. Cheers, Steve
  12. Hi @nasimg, You could make a call to session::userProfileGet, passing the email address in the userId parameter as so: Note that the userId parameter is not case-sensitive in this API call, but the userId returned in the profileData output params is correctly cased. Cheers, Steve
  13. @AndyGilly I saw the screenshot before you removed it, and you can get to what you need fine so it's not a firewall issue. It'll likely be your proxy getting in the way, I'll make some changes to the code to allow you to provide proxy details, will let you know here once done. Cheers, Steve
  14. Hi @AndyGilly, Looks like it's timing out when trying to retrieve your instance API endpoint details from files.hornbill.com - possibly due to a firewall or proxy getting in the way... Does the account and machine that's running Power BI (and therefore R) have access to https://files.hornbill.com/instances/YOURINSTANCEID/zoneinfo, replacing YOURINSTANCEID with your instance ID? We may need to add specific proxy support to the scripts too, I'll take a look at that. Cheers, Steve
  15. Hi @AndyGilly, I've just given the R scripts a whirl through R v4.0.2, and they are working fine. The process I followed to install and configiure this is as so: Downloaded and installed R v4.0.2 from here: https://cran.r-project.org/bin/windows/base/ ; Opened RGui for the newly installed version of R, and installed the httr & readr packages (and dependencies) from within there (I used the UK - London repo, but that shouldn't matter as they are mirrored); Opened Power BI, navigated to Options and settings > Options > R scripting, and set the Detected R home directories option to the version of R that I just installed: Run the existing scripts as a Power BI data source, and they return the dataframe as expected. So I think this must be an environmental issue in your R/Packages/Power BI configuration... Could you check the above steps (2 and 3 probably being the most important) and let me know how you get on? Also, if you don't want to use R to pull data in to Power BI from Hornbill, then you could always use the (slightly friendlier) Python data source scripts to perform this. Cheers, Steve
  16. Hi @Adrian Simpkins, No, the IT Service Management Connector in Azure currently does not support Hornbill - but there's no reason why you couldn't use a combination of Azure Monitor, Azure Automation and the PowerShell Runbooks and Modules that we have provided (and are available from the PowerShell Gallery, or from the Runbooks and Modules galleries in Azure Automation) to perform the same functionality... You could (and this is VERY high level) add a Runbook to Azure Automation that takes relevant inputs and makes a call to the Hornbill API to log an incident (examples), then configure your alerts in Azure Monitor to call that Runbook when the thresholds are breached. It's been a while since I set up Azure to do that, but from what I remember it was fairly straight forward... I'll add a task to our list to investigate what needs to happen to become a supported tool in the Azure IT Service Management Connector, but the above should get you going in the meantime. Let me know how you get on. Cheers, Steve
  17. Hi @chriscorcoran, The only ways I can replicate this error are: If the channel is only allowed to be posted to by moderators, and the user who you created the keysafe key with is not a moderator (usually Team Managers); If the user who you created the keysafe key with is not a member of the Team. So I think it must be one of those scenarios? Forbidden would suggest a permissions issue, so I would check for either of the above... Cheers, Steve
  18. What's Fixed Cloud Automations for Jira and Jira Cloud - fixed errors when creating Issues without Versions being provided.
  19. What's New Cloud Automations for GOV.UK Notify - Send and check the status of SMS messages, letters and emails via the GOV.UK Notify service. See the Hornbill wiki for more information.
  20. Hi @Mark den Elzen, The 404 error you are seeing suggests that the script has been able to communicate with Hornbill, but can't find the specific endpoint. This is possibly down to the instance ID provided to the script - could you double-check that please (and note, it is case-sensitive). Thanks, Steve
  21. @Martyn Houghton, I'll add it to the list and let you know once we've had chance to take a look. Cheers, Steve
  22. What's New ITOM Content Pack - Windows Management package. A collection of automation tasks for managing Services, Processes, Environment Variables and PowerShell Script Execution Policies on Windows machines. See the Hornbill Wiki for more information.
  23. Hi @Will J Douglas, The current Teams integration doesn't support adding mentions. That particular feature was not added as there's no nice way of doing it due to complications in the API that Microsoft provide to perform this task - it's not as straightforward as @ mentioning someone I'm afraid. With your requirement, would the mentions be hard-coded into the body input parameter? So they wouldn't be dynamic and driven by a field in the Request? If so, then we may be able to provide something like the attached, and give you an additional input parameter for you to define the IDs for the users you are mentioning in 1 & 2: It's not an elegant solution, but probably the best we could do while we wait for Microsoft to push the API out of beta, hopefully with better support for mentions... Thanks, Steve
  24. What's New Cloud Automations for SalesForce - Create, Read, Update and Delete SalesForce Contracts.
×
×
  • Create New...