Getting Data In

Is there a way to run cmd btool check via rest?

ddrillic
Ultra Champion

@harsmarvania57 suggested to use the lovely and useful ./splunk cmd btool check command In When modifying serverclass which safeguards could help us avoid the following mistakes?

Since most of our users use Jenkins to deploy their code, is there a way to run this command via rest?

Tags (3)
0 Karma
1 Solution

MuS
Legend

Hi ddrillic,

there might be something, because the old S.O.S app used it by using a custom command.

But why not use the https://splunkbase.splunk.com/app/1607/ that will provide shell access within Splunk where one can run btool for example.

Hope this helps ...

cheers, MuS

View solution in original post

gabriel_vasseur
Contributor

I don't think https://splunkbase.splunk.com/app/1607/ has any chance of being installed in splunk cloud.


Someone at splunk suggested we try https://splunkbase.splunk.com/app/6368/ which we had no trouble getting installed in cloud and it's working for us.

0 Karma

MuS
Legend

Hi ddrillic,

there might be something, because the old S.O.S app used it by using a custom command.

But why not use the https://splunkbase.splunk.com/app/1607/ that will provide shell access within Splunk where one can run btool for example.

Hope this helps ...

cheers, MuS

ddrillic
Ultra Champion

@MuS, is there a way to restrict this app, to run only the btool command? with the Unix sudo command for example, we can restrict which commands can run...

0 Karma

MuS
Legend

Which one are you referring @ddrillic ? If it is this one https://splunkbase.splunk.com/app/1607/ then it is just a python script which can be modified so it only runs btool for example.

cheers, MuS

ddrillic
Ultra Champion

Very interesting @MuS.

0 Karma

ddrillic
Ultra Champion

Much appreciated @MuS

0 Karma

MuS
Legend

Okay, S.O.S app had a custom command called btool in it https://answers.splunk.com/answers/104622/make-output-of-btool-some-conf-type-list-more-legible-unix... You can still download the app here https://splunkbase.splunk.com/app/748/#/overview Not sure though if you can use it to do btool check but well worth to give it a try 😉

cheers, MuS

gjanders
SplunkTrust
SplunkTrust
0 Karma

ddrillic
Ultra Champion

Thank you @gjanders

0 Karma

wrangler2x
Motivator

One thing you can't do with it is pipe to something else. This would normally show all the inputs.conf stanza names but in the app it just shows you usage info. Here on *nix:

$ splunk cmd btool inputs list --debug | grep "\["

/opt/splunk/etc/apps/unix/local/inputs.conf                            [script:///opt/splunk/etc/apps/unix/bin/ps.sh]
/opt/splunk/etc/apps/unix/local/inputs.conf                            [script:///opt/splunk/etc/apps/unix/bin/rlog.sh]
/opt/splunk/etc/apps/unix/local/inputs.conf                            [script:///opt/splunk/etc/apps/unix/bin/time.sh]
/opt/splunk/etc/apps/unix/local/inputs.conf                            [script:///opt/splunk/etc/apps/unix/bin/top.sh]

etc...

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...