Project

General

Profile

Feature #2235

Feature #2144: Add support for SHC

Make input not run if on SHC but not the captain

Added by Luke Murphey about 6 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
Start date:
03/23/2018
Due date:
% Done:

100%

Associated revisions

Revision 38 (diff)
Added by lukemurphey about 6 years ago

Fixing detection of SHC captains

Reference #2235

History

#1 Updated by Luke Murphey about 6 years ago

import os
import sys
import socket
import splunk.auth

print "Hostname:", socket.gethostname()

session_key = splunk.auth.getSessionKey(username='admin', password='Chang3d!')

path_to_mod_input_lib = os.path.join(os.getcwd(), 'modular_input.zip')
sys.path.insert(0, path_to_mod_input_lib)

from modular_input.server_info import ServerInfo

print "is_on_shc:", ServerInfo.is_on_shc(session_key)

server_info = ServerInfo.get_server_info(session_key)
print "server_info:", server_info

shc_info = ServerInfo.get_shc_cluster_info(session_key)
print "shc_info:", shc_info

shc_captain = ServerInfo.get_dict_object(shc_info, ['content', 'captain', 'label'])
print "shc_captain:", shc_captain

print "is_shc_captain:", ServerInfo.is_shc_captain(session_key)

#2 Updated by Luke Murphey about 6 years ago

  • % Done changed from 0 to 50

This appears to be correctly running on the captain. However, no results are coming in.

#3 Updated by Luke Murphey about 6 years ago

  • Status changed from New to Closed
  • % Done changed from 50 to 100

Also available in: Atom PDF