Forum Discussion
On 12/20/2021 at 11:00 AM, Mike Moniz said:I would ask support if they can get you a copy of one of the old DataSources as they do most of the work. I switched jobs so I no longer have a copy myself.
Some generic suggestions:
- Don't suggest coding thresholds in DataSources directly, instead provide values that LM can set thresholds on. For example don't code QuoteWarning as 0=ok, 1=almost at warning, 2=over quota. Instead do something like RemainingBeforeQuotaWarning (size minus quota) or RemainingBeforeQuotaReadOnly that you can setup LM to what warning level you want. You then don't need to worry about quota or mailbox size changing.
- Connecting to MS will sometimes time out, so you might want to code multiple attempts to login in the code
- If the script takes too long (>2 min default), LM will kill the script which will leave the session option to MS. MS will only allow 3 at once, so you may want to keep it only open as long as needed and perhaps kill any existing session before starting. Also keep that in mind while testing.
- If you use PSRemoting and the script doesn't close the connection (or LM kills the script), it will leave some temp files behind which can very slowly fill up the collector's drive. Not sure if this applies for M365 connections.
- If you turn on Multi Instance but don't provide an autodiscovery script, you can add needed instances via Add Monitoring Instance in the Resources page. Rather then say hardcode service accounts in an autodiscover script.
Good feedback. What do you mean about multi instance and no discovery script? We did not hard code service account in the autodiscover script (although technically the api call to get the creds is hard coded here). You piqued my curiosity with this comment...
Regarding coding thresholds into the datasource, couldn't agree more. We ended up being able to grab all the data points that allow us flexibility w/ LM logic to be able to alert. For now we kept it simple by biulding alert threshold > 90 90 90 so that if the totalsize goes above 90 we trip a crit alert. Down the road we may be able to do something nice such as "totalsize > issuewarning" and then trigger it. So as we manage the issuewarning setting on a given mailbox, the LM logic is current...and no alert threshhold needs to be modified.
This is the first time we have done powershell. We have a few groovy scripts on custom datasources that do things like check cloud storage for last file write date to accomplish a sort of "dead man's switch" on ETL stuff....and it has worked nicely. I am stoked to see we are able to do so much with powershell as well...!
Related Content
- 5 months ago
- 2 years ago
- 11 months ago