ContributionsMost RecentMost LikesSolutionsRe: Custom HTTP Integrations and refresh/update oauth2 tokens Thank you very much and sorry for the late response. We will surely try this. Cheers, Peter Custom HTTP Integrations and refresh/update oauth2 tokens Hi, Has anyone been faced with trying to create a custom http integration towards a system that need to refresh oauth2 tokens to be able to connect. The same way you need to refresh the tokens for Logic Monitor when connecting. Re: Fixing device hostnames after being populated Sorry for the delay, My next guess is that you create a script that lists the devices trough api. For each device do a ping (in PowerShell: Test-NetConnection) extract the computername and add it to the device displayname. Again through API. We don't have a script like that but have been talking about writing one. If or when we do we'll put it up here but that may take a while so if you haven't solved your problem yet my recommendation is start scripting. Hope it works out for you. DPM (Data Protection Manager) Monitoring DPM First was a blur to us. To monitor all jobs wasn't the best thing as a multi instance datasource as the jobs were so many the monitoring of them could potentially use all of the backup server computepower. We also tried the batch script collector but we never got that to work for some reason. Then we took a step back sat down and thinking. We don't actually need to see all jobs. It's quite enough just to see which server got problems. So, i wrote this datasource(it's a multi instance datasource) that collect all computer objects and then for each object checks DPM Alerts and send it out to a custom message. Please enjoy, Z9NNJH Custom Windows Eventlogs Hi, We were in need of monitoring other eventlogs than Application, Security and System so i made a scripted multi instanced datasource to monitor any eventlog in C:\Windows\System32\Winevt\Logs. Not a perfect datasource but it get the job done. 6WG9CE Use ##custom.eventlog## to monitor. Re: ManageEngine ServiceDesk Plus MSP Integration Hello, Sorry for the extreme delay. First things first. After upgrading Servicedesk plus 9.4 it started to behave differently. I've been in contact with Manage Engine and I've been in contact with Logic Monitor. We are looking for another ticket system.There is just too much arguments for leaving Servicedesk plus MSP version. However, after the upgrade SDP stopped receiving alerts. I troubleshooted for a very long time and found out that I couldn't use some of the tokens. Not happy about that at all. I also started using a type of json instead of the xml version. You need to set the integration to raw and use urlencodes as content-type. Do not use JSON because SDP cannot interpret that. Below is an integration for new alerts that we found was working. If you put this in a json verifier on internet it will fail right away but it is in this format SDP wants the data. format=json&data={ "operation": { "details": { "requesttype": "Incident", "priority": "Low", "urgency": "Low", "mode": "Other", "subject": "***##LEVEL##*** | ##ALERTID## | ##HOST## | ##DATASOURCE##", "description": [ "Host: ##HOST##", "\nLM AlertID: ##ALERTID##:", "\nDatasource: ##DATASOURCE##", "\nDatapoint: ##DATAPOINT##", "\nDatapoint Description: ##DPDESCRIPTION##", "\nLevel: ##LEVEL##", "\nStart: ##START##", "\nDuration: ##DURATION##", "\nValue: ##VALUE##", "\nClearValue: ##CLEARVALUE##", "\nReason: ##DATAPOINT## exceeds ##THRESHOLD##", "\nGroup: ##GROUP##", "\n\nCustomer Location: ##location##" ], "category": "[Category]", "subcategory": "[SubCategory]", "requester": "Logic Monitor", "site": "##customer.site##", "group": "Server Management", "account": "##customer.name##" } } } You also need to set the alert integration to get the ticketnumber from SDP. It looks like this. The others look like the setting above. Enjoy! :)/emoticons/smile@2x.png 2x" title=":)" width="20"> Multi instanced datasource listing Custom Customer Datasources Hello, We needed a datasource to show custom datasources named Mon_[CustomerName]* from all our customers in a datasource. This to be able to show big numbers on each customers dashboard and also a summary on our Sales Dashboard. Itis important to know that this datasource calculates from every customer so be careful which server you appy this to. Best is to have an internal server of your own. First i created the datasource and made it a multi instance datasource with Active Discovery. Below is the script fetching our customers names from device groups. Please notice that we've got all our customers inside a group called customers. We search inside that group by telling Powershell to look inside that group by its DeviceGroup ID. CollectorScript ########################################################################################## <# Use TLS 1.2 #> [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 <# account info #> $accessId = '[AccessID]' $accessKey = '[AccessKey]' $company = '[Your Company]' <# request details #> $httpVerb = 'GET' $resourcePath = '/device/groups' $queryParams = '?filter=parentId~[ParentGroupID]' # Here we put the group ID of our Customers group. <# Construct URL #> $url = 'https://' + $company + '.logicmonitor.com/santaba/rest' + $resourcePath + $queryParams <# Get current time in milliseconds #> $epoch = [Math]::Round((New-TimeSpan -start (Get-Date -Date "1/1/1970") -end (Get-Date).ToUniversalTime()).TotalMilliseconds) <# Concatenate Request Details #> $requestVars = $httpVerb + $epoch + $resourcePath <# Construct Signature #> $hmac = New-Object System.Security.Cryptography.HMACSHA256 $hmac.Key = [Text.Encoding]::UTF8.GetBytes($accessKey) $signatureBytes = $hmac.ComputeHash([Text.Encoding]::UTF8.GetBytes($requestVars)) $signatureHex = [System.BitConverter]::ToString($signatureBytes) -replace '-' $signature = [System.Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes($signatureHex.ToLower())) <# Construct Headers #> $auth = 'LMv1 ' + $accessId + ':' + $signature + ':' + $epoch $headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]" $headers.Add("Authorization",$auth) $headers.Add("Content-Type",'application/json') <# Make Request #> $response = Invoke-RestMethod -Uri $url -Method $httpVerb -Header $headers <# Create Body of Data #> $rawbody = $response.data $items = $rawbody.items foreach($item in $items){ $customername = $($item.name.Split(" ")[0]) # this filter the first word in the customer name Which is all we want. write-host "$customername##$customername" # Should be ID##Name##Description but then i got problems with the ##Wildvalue## Token } EXIT 0; ########################################################################################## After this we added the script below to count the amount of custom datasources for each customer in collection above. ########################################################################################## <# Use TLS 1.2 #> [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 <# account info #> $accessId = '[AccessId]' $accessKey = '[AccessKey]' $company = '[Company]' $httpVerb = 'GET' $resourcePath = '/setting/datasources' $queryParams = "?size=500&filter=name~MON_##WILDVALUE##" # Search for a datasource called *MON_Customername* <# Construct URL #> $url = 'https://' + $company + '.logicmonitor.com/santaba/rest' + $resourcePath + $queryParams <# Get current time in milliseconds #> $epoch = [Math]::Round((New-TimeSpan -start (Get-Date -Date "1/1/1970") -end (Get-Date).ToUniversalTime()).TotalMilliseconds) <# Concatenate Request Details #> $requestVars = $httpVerb + $epoch + $resourcePath <# Construct Signature #> $hmac = New-Object System.Security.Cryptography.HMACSHA256 $hmac.Key = [Text.Encoding]::UTF8.GetBytes($accessKey) $signatureBytes = $hmac.ComputeHash([Text.Encoding]::UTF8.GetBytes($requestVars)) $signatureHex = [System.BitConverter]::ToString($signatureBytes) -replace '-' $signature = [System.Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes($signatureHex.ToLower())) <# Construct Headers #> $auth = 'LMv1 ' + $accessId + ':' + $signature + ':' + $epoch $headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]" $headers.Add("Authorization",$auth) $headers.Add("Content-Type",'application/json') <# Make Request #> $response = Invoke-RestMethod -Uri $url -Method $httpVerb -Header $headers $rawbody = $response.data $items = $rawbody.items $monitors=$items.Count write-host "CustomMonitors=$($monitors)" ########################################################################################## Create a Datapoint with the following settings. Hope all works well for you. Logic Monitor and Power BI Hi, Is someone involved in creating a custom connector for Power BI to pull data from Logic Monitor? I'm starting to investigate this now. If I get it to work I will give you information on how to do it when I'm done. Re: Fixing device hostnames after being populated What happens if you rerun you netscan? Make sure to set rename to ##REVERSEDNS##. CPU, Memory and SystemDrive in one Data Source I wanted to collect data for processor, memory and systemdrive usage inWindows toone data source. This to have it show in percentage bars in a table widget. I don't know if you have any other use for it but it presents the data as percentage och consumed capacity. Oh, it's good if you know a little bit Powershell. The script is written to use custom properties so you either need to add them or change the script a little. MKKRR4
Top ContributionsCustom HTTP Integrations and refresh/update oauth2 tokensRe: Fixing device hostnames after being populatedRe: ManageEngine ServiceDesk Plus MSP IntegrationRe: Custom HTTP Integrations and refresh/update oauth2 tokensDPM (Data Protection Manager)Custom Windows EventlogsMulti instanced datasource listing Custom Customer DatasourcesLogic Monitor and Power BIRe: Fixing device hostnames after being populatedCPU, Memory and SystemDrive in one Data Source