Installation
Highlighted

Is it possible to monitor Splunk license usage programatically?

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)
Highlighted

Re: monitor splunk license usage programatically

Splunk Employee
Splunk Employee

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

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

Highlighted

Re: monitor splunk license usage programatically

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/autogeneratedpool_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}%) | percentlicenseused={$usagePercentage}";
  6. Exit with error code based on usage. 0 = OK, 1 = warning, 2 = Critical

View solution in original post

Highlighted

Re: monitor splunk license usage programatically

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
Highlighted

Re: monitor splunk license usage programatically

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
Highlighted

Re: monitor splunk license usage programatically

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