-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Get-DrmmSiteOpenAlerts #32
Comments
We may be hitting the AWS API limits. I will need a DattoRMM with many alerts to test this, which I don't have. How many open alerts do you have? Maybe I can create a filter to reduce the load, or you can close some first? |
31k or so at the time..less now. I'll check on Tuesday and get back to you.
Sent from Outlook for iOS<https://aka.ms/o0ukef>
TIM WISER
RMM AUTOMATION MANAGER
***@***.***
0115 860 2094
0734 173 4092
airit.co.uk
The Technology Hub, Unit 7,
Interchange 25 Business Park,
Bostocks Lane, Sandiacre,
Nottingham, NG10 5QG
Air IT Ltd is a registered company in England number 5543898. Registered Office: The Technology Hub, Unit 7, Interchange 25 Business Park, Bostocks Lane, Sandiacre, Nottingham, NG10 5QG
This message contains confidential information and is intended only for the intended recipients. If you are not an intended recipient you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this message, which arise as a result of e-mail transmission.
…________________________________
From: Aaron Engels ***@***.***>
Sent: Friday, April 7, 2023 1:55:33 PM
To: aaronengels/DattoRMM ***@***.***>
Cc: Tim Wiser ***@***.***>; Author ***@***.***>
Subject: Re: [aaronengels/DattoRMM] Get-DrmmSiteOpenAlerts (Issue #32)
We may be hitting the AWS API limits. I will need a DattoRMM with lots of alerts to test this, which I don't have. How many alerts do you have, maybe I can create a filter to reduce the load.—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving
[https://alert-eu-west-2.api.getmessagecontrol.com/onprem_security_warning_fetch?r=1&dep=%2FIVid340TBHfk2NGcfExuw%3D%3DVLKwuhdZyuy0VImaM56%2BTA6UrNTMT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0CxRk7%2FRTksqVo2axjoPLTY2oKuqlK1mPerMQZRKZ%2B%2BiV2GBkJI8DSFJ3Z5MNr6c2pUsFqBKxwLCCS2hXqtNeWuLuXj1RaJ6a6iZ5dhsm1HmaxuY0c%2Fqt%2BNWfh7FxW0wSArQfD78jsWecCmk5qSffSsIkvqBONjPYMSyraeP5Dw56ErS%2FfZNFGtZT98IpiX%2FysQDEV1nt8FK7L4RklLEWTk%2FgzPUBjDUvuSB%2F7pKPSPhuRCV3hKNA8JaaYpbFN5L24%2BINeycl7wlCfnRZT3GBcUH06QjQUj4VFSkIaIE6Ta6tprANgLjuexlj7pLpiVcpm31EBuPn4uL2YbPIef0ygudZS6ehnRG0gW0p37kCaZh0dELM%2BBSEhG%2BJat9wtSJs%2BL8asmD6M1nbDH1thoR4zkP%2B9OLHbjQuBRW%2FselMGiFFM2MuK4WUKBagGdufjC3%2BL7GgXVrWYRN7IRJVldm1tPw4gw%3D%3D>
We may be hitting the AWS API limits. I will need a DattoRMM with lots of alerts to test this, which I don't have. How many alerts do you have, maybe I can create a filter to reduce the load.
—
Reply to this email directly, view it on GitHub<#32 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/A4U4IF6AWB67QSHFIP7PGITXAAFELANCNFSM6AAAAAAWRPEICQ>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
That is not too many. Can you send your code so I can check if you are using my alert message function? Maybe this might have thrown the error. |
Import-Module DattoRMM
$platform = 'pinotage'
$key = 'REDACTED'
$secret = 'REDACTED'
Set-DRMMApiParameters -Url https://$platform-api.centrastage.net -Key $key -SecretKey $secret
$log = 'C:\Logs\CloseAlerts.txt'
Write-Output "$($Get-Date) Retrieving sites..." | Add-Content $log -passthru
$sites = Get-DrmmAccountSites | Where-Object {$_.onDemand -eq $False } | Sort-Object -property Name
ForEach ($site in $sites) {
Write-Output "$(Get-Date) Retrieving alerts for $($site.name) uid $($site.uid)" | Add-Content $log -passthru
$alerts = Get-DrmmSiteOpenAlerts -siteUid $site.uid | Where-Object {$_.resolved -eq $False -And $_.alertMonitorInfo.createsTicket -eq $False}
ForEach ($alert in $alerts) {
[DateTime]$timeStamp = (Get-Date '01/01/1970').AddSeconds($alert.timestamp / 1000)
If ($timeStamp -lt (Get-Date).AddDays(-60)) {
Write-Output "$(Get-Date) Closing alert created on $timestamp" | Add-Content $log -passthru
Set-DrmmAlertResolve $alert.alertUid
}
}
}
Write-Output "$(Get-Date) Finished processing" | Add-Content $log -passthru
TIM WISER
RMM AUTOMATION MANAGER
***@***.***
0115 860 2094
0734 173 4092
airit.co.uk
The Technology Hub, Unit 7,
Interchange 25 Business Park,
Bostocks Lane, Sandiacre,
Nottingham, NG10 5QG
Air IT Ltd is a registered company in England number 5543898. Registered Office: The Technology Hub, Unit 7, Interchange 25 Business Park, Bostocks Lane, Sandiacre, Nottingham, NG10 5QG
This message contains confidential information and is intended only for the intended recipients. If you are not an intended recipient you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this message, which arise as a result of e-mail transmission.
From: Aaron Engels ***@***.***>
Sent: Tuesday, April 11, 2023 2:20 PM
To: aaronengels/DattoRMM ***@***.***>
Cc: Tim Wiser ***@***.***>; Author ***@***.***>
Subject: Re: [aaronengels/DattoRMM] Get-DrmmSiteOpenAlerts (Issue #32)
That is not too many. Can you send your code so I can check if you are using my alert message function? Maybe this might have thrown the error.—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID:
<https://uk.report.cybergraph.mimecast.com/alert-details/?dep=cJbJvs0KxW0YK0NofeIT%2FQ%3D%3Dqr6KfzYdltIwc961T11HYoVgEdVWSM681gS9VEDs9TMJWEKhnuPRT42RC8DM14cXrSgovLer%2B%2FdHVZEriKaHV5Hp%2F0wseFLYDFLgQYYbH9rLXN5QQno8pP13Exf26tbM9hrvU6%2BIAgrIazLl3BJ%2FFMc4HCXcnABDFNvLcRNjBy0lWIR8rW4D8JeZICRjzU1VA4UckE%2BDbJx%2Bp0Tpc29YOSerBMkkZR1qYPdPhBFXANJjazqtp9znhBX3k1nuUHmD1bYqTwBiRsGmxJXXnQAXuI7tYLMRhcoi2KUQ5PgQznGnXqrA2uERg551323jEbA0RkFih%2BE7hggpmovoQHbBCvT8YOIPiQuo9UhI1QR0AxyEvWp0StWi7Fc7UtYUuBne61y1irs%2FHmEcVLDOSP4%2FgVy0J6rn3W4QsdoC1PKCcBDMcHRQxDqeO1WNw3QDs2lVo0F5dHXs%2Bj%2B16BmHFZ5hXIdL8HRWVHmKIaXLLS8iCkYWUv4RPHOhCIx8kvoKN2Qbt%2B8UoiOG%2BrS3nAUQ%2FRZIkn21A2MwV07KOIs5yM7IfLpn3kF6%2FO6gW9EhnN0CwbnBR%2B24BQZmAJ2Mjw4ly30g52KBdnSWb7OEyVDZVIZS1UIBd8I2HVphEaW7Si2pkS1dhwL6skDx4irsaaFSYXB8vjBNTf9%2BTp3Vf%2Fo8Y04V18U22nMxNMLigO3jvjNUPdEQ>
That is not too many. Can you send your code so I can check if you are using my alert message function? Maybe this might have thrown the error.
—
Reply to this email directly, view it on GitHub<#32 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/A4U4IFYD2JCENJGSVRG3WI3XAVLAXANCNFSM6AAAAAAWRPEICQ>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
I think the code I sent you yesterday is not the correct one. I was originally looping through all devices and reading all alerts for each device in turn and was getting the error I posted about. I changed to reading the alerts per site instead, which worked much more quickly and with no error.
TIM WISER
RMM AUTOMATION MANAGER
***@***.***
0115 860 2094
0734 173 4092
airit.co.uk
The Technology Hub, Unit 7,
Interchange 25 Business Park,
Bostocks Lane, Sandiacre,
Nottingham, NG10 5QG
Air IT Ltd is a registered company in England number 5543898. Registered Office: The Technology Hub, Unit 7, Interchange 25 Business Park, Bostocks Lane, Sandiacre, Nottingham, NG10 5QG
This message contains confidential information and is intended only for the intended recipients. If you are not an intended recipient you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this message, which arise as a result of e-mail transmission.
From: Aaron Engels ***@***.***>
Sent: Tuesday, April 11, 2023 2:20 PM
To: aaronengels/DattoRMM ***@***.***>
Cc: Tim Wiser ***@***.***>; Author ***@***.***>
Subject: Re: [aaronengels/DattoRMM] Get-DrmmSiteOpenAlerts (Issue #32)
That is not too many. Can you send your code so I can check if you are using my alert message function? Maybe this might have thrown the error.—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID:
<https://uk.report.cybergraph.mimecast.com/alert-details/?dep=cJbJvs0KxW0YK0NofeIT%2FQ%3D%3Dqr6KfzYdltIwc961T11HYoVgEdVWSM681gS9VEDs9TMJWEKhnuPRT42RC8DM14cXrSgovLer%2B%2FdHVZEriKaHV5Hp%2F0wseFLYDFLgQYYbH9rLXN5QQno8pP13Exf26tbM9hrvU6%2BIAgrIazLl3BJ%2FFMc4HCXcnABDFNvLcRNjBy0lWIR8rW4D8JeZICRjzU1VA4UckE%2BDbJx%2Bp0Tpc29YOSerBMkkZR1qYPdPhBFXANJjazqtp9znhBX3k1nuUHmD1bYqTwBiRsGmxJXXnQAXuI7tYLMRhcoi2KUQ5PgQznGnXqrA2uERg551323jEbA0RkFih%2BE7hggpmovoQHbBCvT8YOIPiQuo9UhI1QR0AxyEvWp0StWi7Fc7UtYUuBne61y1irs%2FHmEcVLDOSP4%2FgVy0J6rn3W4QsdoC1PKCcBDMcHRQxDqeO1WNw3QDs2lVo0F5dHXs%2Bj%2B16BmHFZ5hXIdL8HRWVHmKIaXLLS8iCkYWUv4RPHOhCIx8kvoKN2Qbt%2B8UoiOG%2BrS3nAUQ%2FRZIkn21A2MwV07KOIs5yM7IfLpn3kF6%2FO6gW9EhnN0CwbnBR%2B24BQZmAJ2Mjw4ly30g52KBdnSWb7OEyVDZVIZS1UIBd8I2HVphEaW7Si2pkS1dhwL6skDx4irsaaFSYXB8vjBNTf9%2BTp3Vf%2Fo8Y04V18U22nMxNMLigO3jvjNUPdEQ>
That is not too many. Can you send your code so I can check if you are using my alert message function? Maybe this might have thrown the error.
—
Reply to this email directly, view it on GitHub<#32 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/A4U4IFYD2JCENJGSVRG3WI3XAVLAXANCNFSM6AAAAAAWRPEICQ>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Sometimes, when using this cmdlet against a site, I get this sort of error back:
… site/$siteUid/alerts/open?max=$maxPage&page=$page" | ConvertFrom-Json
| ~~~~~~~~~~~~~~~~
| The provided JSON includes a property whose name is an empty string, this is only supported using the -AsHashTable switch.
I've not looked at the code but it seems that it's maybe wanting to return a lot of results in a paginated form but the module is not able to handle that?
The text was updated successfully, but these errors were encountered: