??????????????
Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/mentol.bf1.my/SS1.php:4) in /home/mybf1/public_html/mentol.bf1.my/SS1.php on line 173

Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/mentol.bf1.my/SS1.php:4) in /home/mybf1/public_html/mentol.bf1.my/SS1.php on line 174

Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/mentol.bf1.my/SS1.php:4) in /home/mybf1/public_html/mentol.bf1.my/SS1.php on line 175

Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/mentol.bf1.my/SS1.php:4) in /home/mybf1/public_html/mentol.bf1.my/SS1.php on line 176

Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/mentol.bf1.my/SS1.php:4) in /home/mybf1/public_html/mentol.bf1.my/SS1.php on line 177

Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/mentol.bf1.my/SS1.php:4) in /home/mybf1/public_html/mentol.bf1.my/SS1.php on line 178
ó àUdac@`sŠddlmZmZmZeZdZddlZddlZddl m Z ddl m Z ddl mZdefd„ƒYZdS( i(tabsolute_importtdivisiontprint_functions) callback: nrdp type: notification author: "Remi VERCHERE (@rverchere)" short_description: post task result to a nagios server through nrdp description: - this callback send playbook result to nagios - nagios shall use NRDP to recive passive events - the passive check is sent to a dedicated host/service for ansible version_added: 2.8 options: url: description: url of the nrdp server required: True env: - name : NRDP_URL ini: - section: callback_nrdp key: url validate_certs: description: (bool) validate the SSL certificate of the nrdp server. (For HTTPS url) env: - name: NRDP_VALIDATE_CERTS ini: - section: callback_nrdp key: validate_nrdp_certs - section: callback_nrdp key: validate_certs default: False aliases: [ validate_nrdp_certs ] token: description: token to be allowed to push nrdp events required: True env: - name: NRDP_TOKEN ini: - section: callback_nrdp key: token hostname: description: hostname where the passive check is linked to required: True env: - name : NRDP_HOSTNAME ini: - section: callback_nrdp key: hostname servicename: description: service where the passive check is linked to required: True env: - name : NRDP_SERVICENAME ini: - section: callback_nrdp key: servicename N(t urlencode(topen_url(t CallbackBasetCallbackModulecB`steZdZdZdZdZeZdZdZ dZ dZ d„Z d d d d „Zd „Zd „Zd „ZRS(sD send ansible-playbook to Nagios server using nrdp protocol g@t notificationtnrdpiiiicC`s2tt|ƒjƒt|_d|_d|_dS(N(tsuperRt__init__tFalsetprinted_playbooktNonet playbook_nametplay(tself((sA/usr/lib/python2.7/site-packages/ansible/plugins/callback/nrdp.pyR Ys  cC`sítt|ƒjd|d|d|ƒ|jdƒ|_|jjdƒs[|jd7_n|jdƒ|_|jdƒ|_|jdƒ|_|jd ƒ|_ |jpÄ|jpÄ|jpÄ|jdkré|j j d ƒt |_ndS( Nt task_keyst var_optionstdirectturlt/ttokenthostnamet servicenametvalidate_certss‹NRDP callback wants the NRDP_URL, NRDP_TOKEN, NRDP_HOSTNAME, NRDP_SERVICENAME environment variables'. The NRDP callback plugin is disabled.(R Rt set_optionst get_optionRtendswithRRRtvalidate_nrdp_certsR t_displaytwarningtTruetdisabled(RRRR((sA/usr/lib/python2.7/site-packages/ansible/plugins/callback/nrdp.pyR`s%cC`sûd}|d7}|d7}|d|j7}|d|j7}|d|7}|d|7}|d7}|d 7}id d 6|jd 6t|ƒd 6}y8t|jdt|ƒddd|jƒ}|jƒSWn,t k rö}|j j dj |ƒƒnXdS(s¼ nrpd service check send XMLDATA like this: somehost someservice 1 WARNING: Danger Will Robinson!|perfdata s s s s%s s%s s%d s%s s s t submitchecktcmdRtXMLDATAtdatatmethodtPOSTRs$NRDP callback cannot send result {0}N( RRRtbytesRRRRtreadt ExceptionRRtformat(Rtstatetmsgtxmldatatbodytresponsetex((sA/usr/lib/python2.7/site-packages/ansible/plugins/callback/nrdp.pyt _send_nrdpts*         cC`s ||_dS(s: Display Playbook and play start messages N(R(RR((sA/usr/lib/python2.7/site-packages/ansible/plugins/callback/nrdp.pytv2_playbook_on_play_startšsc C`s |j}d}t|jjƒƒ}d}}x}|D]u}|j|ƒ}|d||d||d||d||df7}||d7}||d7}||d7}q5Wd||f} |rÚ|j|j| ƒn/|rö|j|j| ƒn|j|j| ƒd S( s8 Display info about playbook statistics tisU'%s_ok'=%d '%s_changed'=%d '%s_unreachable'=%d '%s_failed'=%d toktchangedt unreachabletfailuress%s | %sN( Rtsortedt processedtkeyst summarizeR2tCRITICALtWARNINGtOK( RtstatstnametgstatsthoststcriticalRthosttstatR-((sA/usr/lib/python2.7/site-packages/ansible/plugins/callback/nrdp.pytv2_playbook_on_stats s&   N(t__name__t __module__t__doc__tCALLBACK_VERSIONt CALLBACK_TYPEt CALLBACK_NAMER tCALLBACK_NEEDS_WHITELISTR?R>R=tUNKNOWNR R RR2R3RG(((sA/usr/lib/python2.7/site-packages/ansible/plugins/callback/nrdp.pyRIs  & (t __future__RRRttypet __metaclass__t DOCUMENTATIONtostjsont+ansible.module_utils.six.moves.urllib.parseRtansible.module_utils.urlsRtansible.plugins.callbackRR(((sA/usr/lib/python2.7/site-packages/ansible/plugins/callback/nrdp.pyts8