Installation

Is it possible to monitor Splunk license usage programatically?

chrisrex
Explorer

Is it possible to monitor the Splunk license remotely anymore? With Splunk 4.1 I was using the http://splunkserver:8089/services/license/license page to parse currentDailyUsageAmount, licenseDailyUsageLimit, expirationDate, etc.

Previous to Splunk 4.1 there was yet another method that was used to get license information. It seems that this changes every release.

Labels (1)
1 Solution

chrisrex
Explorer

I wrote a nagios script with PHP to get what I needed via REST. Send me a message if you want the script. It is basically this though:

  1. Get the sessionKey
  2. Authenticate with sessionKey to /services/licenser/licenses/$licenseId with sessionKey and get the licenseMaxBytes (repeat for each license you have). Get a sum of these.
  3. Authenticate with sessionKey to /servicesNS/nobody/system/licenser/pools/auto_generated_pool_enterprise to get current usedBytes.
  4. Divide usedBytes / licensedMaxBytes and multiply by 100 for your percentage used
  5. echo "Used Bytes: $usedBytes / Total Available: $totalMaxBytes ({$usagePercentage}%) | percent_license_used={$usagePercentage}";
  6. Exit with error code based on usage. 0 = OK, 1 = warning, 2 = Critical

View solution in original post

Damine
New Member

I have created a c# application(Windows Service) using Splunk SDK C# to monitor splunk licence.
if the indexed data exceeds the value you enter it will disable all UDP inputs and enable them after midnight
The link to the application is down below fell free to change it to your needs.

http://www.codeproject.com/Tips/1112026/Automate-Splunk-Licence-Monitoring

0 Karma

lukeh
Contributor

Hurrican Labs released a python script for nagios monitoring of your splunk license usage, and I have included the script and a fresh dashboard in the latest version of Splunk for Nagios:

http://splunk-base.splunk.com/apps/22374/splunk-for-nagios

All the best,

Luke 🙂

0 Karma

chrisrex
Explorer

I wrote a nagios script with PHP to get what I needed via REST. Send me a message if you want the script. It is basically this though:

  1. Get the sessionKey
  2. Authenticate with sessionKey to /services/licenser/licenses/$licenseId with sessionKey and get the licenseMaxBytes (repeat for each license you have). Get a sum of these.
  3. Authenticate with sessionKey to /servicesNS/nobody/system/licenser/pools/auto_generated_pool_enterprise to get current usedBytes.
  4. Divide usedBytes / licensedMaxBytes and multiply by 100 for your percentage used
  5. echo "Used Bytes: $usedBytes / Total Available: $totalMaxBytes ({$usagePercentage}%) | percent_license_used={$usagePercentage}";
  6. Exit with error code based on usage. 0 = OK, 1 = warning, 2 = Critical

amit_active2008
New Member

Hi chrisrex,

I would like to monitor Splunk licence in Nagios. Please share this script to me as well.

Thanks,
Amit Kumar
email : amit.active2008@gmail.com

0 Karma

jlaw
Splunk Employee
Splunk Employee

Here's a Community Wiki topic with some licensing-related searches:

http://www.splunk.com/wiki/Community:TroubleshootingIndexedDataVolume

Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Tech Talk Recap | Mastering Threat Hunting

Mastering Threat HuntingDive into the world of threat hunting, exploring the key differences between ...

Observability for AI Applications: Troubleshooting Latency

If you’re working with proprietary company data, you’re probably going to have a locally hosted LLM or many ...

Splunk AI Assistant for SPL vs. ChatGPT: Which One is Better?

In the age of AI, every tool promises to make our lives easier. From summarizing content to writing code, ...