Server IP : 85.193.89.191 / Your IP : 18.224.59.181 Web Server : Apache System : Linux 956367-cx40159.tmweb.ru 3.10.0-1160.105.1.el7.x86_64 #1 SMP Thu Dec 7 15:39:45 UTC 2023 x86_64 User : bitrix ( 600) PHP Version : 8.1.27 Disable Function : NONE MySQL : OFF | cURL : OFF | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /lib/python2.7/site-packages/ansible/plugins/callback/ |
Upload File : |
� � �\c @` s� d d l m Z m Z m Z e Z d Z d Z d d l Z d d l Z d d l Z d d l Z d d l m Z d d l m Z d d l m Z d d l m Z d d l m Z d e f d � � YZ d e f d � � YZ d S( i ( t absolute_importt divisiont print_functionsa callback: splunk type: aggregate short_description: Sends task result events to Splunk HTTP Event Collector author: "Stuart Hirst <support@convergingdata.com>" description: - This callback plugin will send task results as JSON formatted events to a Splunk HTTP collector. - The companion Splunk Monitoring & Diagnostics App is available here "https://splunkbase.splunk.com/app/4023/" - Credit to "Ryan Currah (@ryancurrah)" for original source upon which this is based. version_added: "2.7" requirements: - Whitelisting this callback plugin - 'Create a HTTP Event Collector in Splunk' - 'Define the url and token in ansible.cfg' options: url: description: URL to the Splunk HTTP collector source env: - name: SPLUNK_URL ini: - section: callback_splunk key: url authtoken: description: Token to authenticate the connection to the Splunk HTTP collector env: - name: SPLUNK_AUTHTOKEN ini: - section: callback_splunk key: authtoken s examples: > To enable, add this to your ansible.cfg file in the defaults block [defaults] callback_whitelist = splunk Set the environment variable export SPLUNK_URL=http://mysplunkinstance.datapaas.io:8088/services/collector/event export SPLUNK_AUTHTOKEN=f23blad6-5965-4537-bf69-5b5a545blabla88 Set the ansible.cfg variable in the callback_splunk block [callback_splunk] url = http://mysplunkinstance.datapaas.io:8088/services/collector/event authtoken = f23blad6-5965-4537-bf69-5b5a545blabla88 N( t datetime( t basename( t open_url( t AnsibleJSONEncoder( t CallbackBaset SplunkHTTPCollectorSourcec B` s e Z d � Z d � Z RS( c C` sj t | _ d | _ d | _ t t j � � | _ t j � | _ t j t j � � | _ t j � | _ d S( Nt ( t Falset ansible_check_modet ansible_playbookt ansible_versiont strt uuidt uuid4t sessiont sockett gethostnamet hostt gethostbynamet ip_addresst getpasst getusert user( t self( ( sC /usr/lib/python2.7/site-packages/ansible/plugins/callback/splunk.pyt __init__O s c C` s� | j d j d � t k r( t | _ n | j d j d � rZ | j d j d � | _ n | j j r{ t | j j � } n d } i } | j j | d <| j | d <| | d <t j � j d � | d <| j | d <| j | d <| j | d <| | d <| j | d <| j | d <| j j | d <| j | d <| | d <| j | d <| j | d <t j | d t d t �} d | d } t | | d i d d 6d | d 6d d �d S( Nt argst _ansible_check_modet _ansible_versionR R t statuss %Y-%m-%d %H:%M:%S +0000t timestampR R R t runtimeR R t ansible_hostR t ansible_rolet ansible_taskt ansible_resultt clst sort_keyss {"event":t }t headerss application/jsons Content-types Splunk t Authorizationt methodt POST( t _task_fieldst gett TrueR R t _taskt _roleR t Nonet _uuidR R t utcnowt strftimeR R R t _hostt nameR t _resultt jsont dumpsR R ( R t urlt authtokent statet resultR! R# t datat jsondata( ( sC /usr/lib/python2.7/site-packages/ansible/plugins/callback/splunk.pyt send_eventX s@ ( t __name__t __module__R RA ( ( ( sC /usr/lib/python2.7/site-packages/ansible/plugins/callback/splunk.pyR N s t CallbackModulec B` s� e Z d Z d Z d Z e Z d d � Z d � Z d d d d � Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z RS( g @t aggregatet splunkc C` sD t t | � j d | � i | _ d | _ d | _ t � | _ d S( Nt display( t superRD R t start_datetimesR2 R; R<