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!

Share Your Ideas & Meet the Lantern team at .Conf! Plus All of This Month’s New ...

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

Combine Multiline Logs into a Single Event with SOCK: a Step-by-Step Guide for ...

Combine multiline logs into a single event with SOCK - a step-by-step guide for newbies Olga Malita The ...

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...