Deployment Architecture

pass username and password while search head cluster restart

Path Finder

We are using a Search Head cluster
Splunk Enterprise

When the CPU and Memory of servers goes high we restart the cluster and the cluster comes back to normal.

I wrote a shell script with 2 lines.

sudo -u splunk /opt/splunk/bin/splunk rolling-restart shcluster-members

when the alert in SH is triggered it is failing as splunk username and passwd needs to be passed to the script manually.

Is there any way I can pass username and password for Splunk in the script to get triggered as per alert.

0 Karma

Ultra Champion


Please try /opt/splunk/bin/splunk rolling-restart shcluster-members -auth 'username:password' , however hard-coded admin username and password in not good practice from security point of view.

0 Karma
Get Updates on the Splunk Community!

Your Guide to SPL2 at .conf24!

So, you’re headed to .conf24? You’re in for a good time. Las Vegas weather is just *chef’s kiss* beautiful in ...

Get ready to show some Splunk Certification swagger at .conf24!

Dive into the deep end of data by earning a Splunk Certification at .conf24. We're enticing you again this ...

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Now On-Demand Join us to learn more about how you can leverage Service Level Objectives (SLOs) and the new ...