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!

.conf24 | Day 0

Hello Splunk Community! My name is Chris, and I'm based in Canberra, Australia's capital, and I travelled for ...

Enhance Security Visibility with Splunk Enterprise Security 7.1 through Threat ...

(view in My Videos)Struggling with alert fatigue, lack of context, and prioritization around security ...

Troubleshooting the OpenTelemetry Collector

  In this tech talk, you’ll learn how to troubleshoot the OpenTelemetry collector - from checking the ...