BENEFITS:

  • Visual schedules are more intuitive and allow you to see who’s “on-call” and that you have “coverage” the entire time.
  • The calendar can inform and remind your staff WHO is on-call/duty at any time.
  • Overcome the limitations of the “time-based chain” which can’t currently do “overnight” shifts like “6pm to 8am the next morning” and rotations that change each week or on a specified date.

HOW DOES IT WORK?

This is a datasource (PowerShell script) that reads your calendar every ~5 minutes (adjustable) and changes your LogicMonitor Escalation chains to match the calendar. Each escalation chain is an ‘instance’ and has it’s own graphs.

REQUIREMENTS:

  • FYI: This datasource uses the LogicMonitor REST API.
  • This supports calendars on Office 365  (if I get enough requests for it, I can add support for onsite Exchange). See older version for Google apps calendar support.
  • Your calendar names must match the names of your Escalation chain (not case-sensitive) and have the word ‘schedule’ in the name (or set a different word in script)
  • The event names on your calendar must use a specific format. e.g. 1=Al (SMS), 2=Bob (voice). ‘Email’ is the default so you don’t need to specify that in parenthesis. It also supports recipient groups. Another example where 2 people are on stage 1 is 1=Al (SMS), Carl (SMS), 2=Don (voice)
  • You can only have one event on your calendar at the same time (otherwise it will get confused)
  • Disclaimer: This is not officially supported by LogicMonitor tech support. Use at your own risk. If you need help, email me mike [at] wowie.us

INSTRUCTIONS TO SETUP:

  • I suggest you use a separate user account in LogicMonitor for the API calls. Generate the API ID and key and save them. Set these properties at the device or group or ‘root’ level.
    • api.id
    • api.key
    • lm.account
    • office365.user
    • office365.pass
  • Download this DataSource file and import it into your account (Settings > DataSources > Add > From file )
  • Set a property on your device (preferably your collector) so the datasource will be applied:
    sync_calendar = whatever
  • Set some settings at the top of PowerShell script in datasource (or use variables). $LM_account (your logicmonitor portal name)
  • If you haven’t already, create your schedules.
  • Test by using ‘test script’ in the DataSource or ‘poll now’ on the device ‘Raw Data’ tab for errors/alerts. A status of 0 or 1 are ok, other numbers indicate problems as shown in the description field of ‘Alert Tuning’ tab

TROUBLESHOOTING:

Run the script in the LogicMonitor interactive debug command window ( Settings > Collectors > Manage > Support > Run Debug Command)

Type “!posh” to open a window. Paste in the contents of the script. You will need to change the $chain_name from ##wildalias## to your Escalation Chain name. And hard code the credentials and account name. Then click “Submit”

>>!posh
return
[20180608 10:07:51] - Testing Logic Monitor API access

[20180608 10:07:51] - API access checked
[20180608 10:07:51] - Searching for chain 'Schedule for databases'
[20180608 10:07:51] - REST status: 200, 1 chain found.
[20180608 10:07:55] - EWS List calendar operation complete, result is 200,200
[20180608 10:07:55] - Found 3 calendars.
[20180608 10:07:55] - Found 7 events.
[20180608 10:07:55] - Current Date is Friday, June 8, 2018 5:07:55 PM UTC.
[20180608 10:07:55] - Getting list of LM Users
[20180608 10:07:55] - REST status: 200, 18 users found.
[20180608 10:07:55] - Getting list of LM Groups
[20180608 10:07:55] - REST status: 200, 4 groups found.
[20180608 10:07:55] - Compare event to chain. Event name is 'Yauhen'
[20180608 10:07:55] - DEBUG: Event has 1 stages, listing contacts:
[20180608 10:07:55] - DEBUG: Stage 1, addr Yauhen(ADMIN), method email
[20180608 10:07:55] - DEBUG: Escalation chain has 1 stages, listing contacts:
[20180608 10:07:55] - DEBUG: Stage 1, addr m@m.com(ARBITRARY), method email
[20180608 10:07:55] - Updating chain
[20180608 10:07:56] - Searching for chain 'Schedule for databases'
[20180608 10:07:56] - REST status: 200, 1 chain found.
[20180608 10:07:56] - Update successful, REST status 200.
[20180608 10:07:56] - Status=1