MaxJamakovic

Members
  • Posts

    3
  • Joined

  • Last visited

Reputation

0 Neutral

About MaxJamakovic

  • Rank
    Member
    Member
  1. $Username = '##ddbinfoweb.user##' $PasswordRaw = '##ddbinfoweb.pass##' $Bytes = [System.Text.Encoding]::Unicode.GetBytes($PasswordRaw) $Password = [Convert]::ToBase64String($Bytes) $Body = @{username=$Username;password=$Password} $headers = @{ Accept = 'application/json' 'Content-Type' = 'application/json' } $username = "appUser" $password = "base64 encodedPassword" $body = @{username=$username;password=$password;} $response = Invoke-RestMethod 'https://localhost/webconsole/api/Login' -Method 'POST' -Headers $headers -Body $($body | ConvertTo-Json) $token = $response | Select-Object -ExpandProperty token $headers = @{ Authtoken = $token Accept = 'application/json' } $response = Invoke-RestMethod 'https://localhost/webconsole/api/DDBInformation/8' -Method 'GET' -Headers $headers $response.dedupDBInfo.subStoreList.avgQITime -gt "1400" to position on very top?
  2. Hi Mike, the user is not service account, it's local user account to log in to application website. that same use is also added to logic monitor under device properties. I'm not sure if supports NTLM but to get the token user password must be Base64 Encoded Password
  3. $headers = @{ Accept = 'application/json' 'Content-Type' = 'application/json' } $username = "appUser" $password = "base64 encodedPassword" $body = @{username=$username;password=$password;} $response = Invoke-RestMethod 'https://localhost/webconsole/api/Login' -Method 'POST' -Headers $headers -Body $($body | ConvertTo-Json) $token = $response | Select-Object -ExpandProperty token $headers = @{ Authtoken = $token Accept = 'application/json' } $response = Invoke-RestMethod 'https://localhost/webconsole/api/DDBInformation/8' -Method 'GET' -Headers $headers $response.dedupDBInfo.subStoreList.avgQITime -gt "1400" Hi I'm new to Logic Monitor what do I need to modify in this script so that can be run from collector, the script retrieves the token and inserts that token in next command, but I need to modify so that this user gets credentials from logic monitor service account. This REST API is using base64 encoded password to obtain token. I need help with adding the logic monitor service account and write output to logic monitor, the script returns nothing if value is less than 1400 if grater than 1400 to trigger alert.