Splunk IT Service Intelligence

Can ITSI Maintenance mode be set from a command line as opposed to via the GUI and if so, how?

pat_boyle
Engager

I'm lazy and a creature of habit. I do a regular weekly maintenance on our Splunk systems which necessitates setting up a bunch of maintenance windows in ITSI in advance via the GUI.

Is there a way to create an ITSI maintenance window from a command line / rest call - basically so I can set it up in CRON and get another 30 mins in bed?

All I need is to be able to specify:

  1. Which server
  2. A name for the window
  3. A Duration
  4. List of impacted services or entities
1 Solution

jherring_splunk
Splunk Employee
Splunk Employee
0 Karma

kartikaykv1
Explorer

Use the below CURL to put Entities in Maintenance mode.

Time should be in UTC.
Use _key id for entities.

curl -k -u admin:password https://localhost:8089/servicesNS/nobody/SA-ITOA/maintenance_services_interface/maintenance_calendar -X POST -H "Content-Type:application/json" -d '{"title":"TEST MW","start_time":1589705600,"end_time":1589709600,"objects":[{"object_type":"entity","_key":"52f345bd-9764-4bc1-82a1-040"},{"object_type":"entity","_key":"45de7c5f-0d5f-4d50-9910-a1a"}]}'

nickmew
Path Finder

Slight alteration - I had to add underscores in the start_time, end_time, object_type and _key to get this to work:

curl -k -u username:password https://localhost:8089/servicesNS/nobody/SA-ITOA/maintenance_services_interface/maintenance_calendar -X POST -H "Content-Type:application/json" -d "{\"title\":\"TEST MW\",\"start_time\":1589705600,\"end_time\":1589709600,\"objects\":[{\"object_type\":\"entity\",\"_key\":\"10bc6ede-20f5-45a8-a19f-562ffc425f69\"}]}"

0 Karma

jherring_splunk
Splunk Employee
Splunk Employee
0 Karma
Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...