%PDF- %PDF-
| Direktori : /proc/thread-self/root/proc/3522530/root/lib/python2.7/site-packages/salt/engines/ |
| Current File : //proc/thread-self/root/proc/3522530/root/lib/python2.7/site-packages/salt/engines/logentries.pyc |
�
���^c @@ so d Z d d l m Z m Z m Z d d l Z d d l Z y d d l Z e Z
Wn e k
ri e Z
n Xy d d l
Z
e Z Wn e k
r� e Z n Xd d l Z d d l Z d d l Z d d l Z d d l Z e j e � Z d � Z d e f d � � YZ y d d l
Z
e Z Wn e k
r9e Z e Z n Xd e f d � � YZ e Z d d
d d d � Z d S(
uo
An engine that sends events to the Logentries logging service.
:maintainer: Jimmy Tang (jimmy_tang@rapid7.com)
:maturity: New
:depends: ssl, certifi
:platform: all
.. versionadded: 2016.3.0
To enable this engine the master and/or minion will need the following
python libraries
ssl
certifi
If you are running a new enough version of python then the ssl library
will be present already.
You will also need the following values configured in the minion or
master config.
:configuration:
Example configuration
.. code-block:: yaml
engines:
- logentries:
endpoint: data.logentries.com
port: 10000
token: 057af3e2-1c05-47c5-882a-5cd644655dbf
The 'token' can be obtained from the Logentries service.
To test this engine
.. code-block:: bash
salt '*' test.ping cmd.run uptime
i ( t absolute_importt print_functiont unicode_literalsNc C@ s t r t r t St S( N( t HAS_CERTIFIt HAS_SSLt Truet False( ( ( s; /usr/lib/python2.7/site-packages/salt/engines/logentries.pyt __virtual__K s t PlainTextSocketAppenderc B@ sA e Z e d d d d � Z d � Z d � Z d � Z d � Z RS( u data.logentries.comiP i� c C@ sd | | _ | | _ | | _ d | _ d | _ d | _ t j j j d � | _
| | _ d | _
d S( Ng�������?i
uG
It appears the LOGENTRIES_TOKEN parameter you entered is incorrect!
u
( t LE_APIt LE_PORTt LE_TLS_PORTt MIN_DELAYt MAX_DELAYt
INVALID_TOKENt saltt utilst stringutilst to_strt LINE_SEPt verboset Nonet _conn( t selfR R R
R ( ( s; /usr/lib/python2.7/site-packages/salt/engines/logentries.pyt __init__P s c C@ s; t j t j t j � | _ | j j | j | j f � d S( N( t sockett AF_INETt SOCK_STREAMR t connectR R
( R ( ( s; /usr/lib/python2.7/site-packages/salt/engines/logentries.pyt open_connectiond s c C@ s� | j � | j } x� t r� y | j � d SWn* t k
rZ | j r[ t j d � q[ n X| d 9} | | j k r� | j } n | t j
d | � } y t j | � Wq t
k
r� � q Xq Wd S( Nu Unable to connect to Logentriesi i ( t close_connectionR R R t ExceptionR t logt warningR
t randomt uniformt timet sleept KeyboardInterrupt( R t
root_delayt wait_for( ( s; /usr/lib/python2.7/site-packages/salt/engines/logentries.pyt reopen_connectionh s"