Deployment Architecture

pass username and password while search head cluster restart

vikram_m
Path Finder

We are using a Search Head cluster
Splunk Enterprise
Version:
7.2.6

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.

!#/bin/bash
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

harsmarvania57
SplunkTrust
SplunkTrust

Hi,

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!

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...

Welcome to the Splunk Community!

(view in My Videos) We're so glad you're here! The Splunk Community is place to connect, learn, give back, and ...

Tech Talk | Elevating Digital Service Excellence: The Synergy of Splunk RUM & APM

Elevating Digital Service Excellence: The Synergy of Real User Monitoring and Application Performance ...