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

Get Updates on the Splunk Community!

[Puzzles] Solve, Learn, Repeat: Dynamic formatting from XML events

This challenge was first posted on Slack #puzzles channelFor a previous puzzle, I needed a set of fixed-length ...

Enter the Agentic Era with Splunk AI Assistant for SPL 1.4

  🚀 Your data just got a serious AI upgrade — are you ready? Say hello to the Agentic Era with the ...

Stronger Security with Federated Search for S3, GCP SQL & Australian Threat ...

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