Warning: file_get_contents(https://raw.githubusercontent.com/Den1xxx/Filemanager/master/languages/ru.json): Failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in /home/zoomride2022/public_html/myzoomride.com/wp-includes/certificates/system.php on line 107

Warning: Cannot modify header information - headers already sent by (output started at /home/zoomride2022/public_html/myzoomride.com/wp-includes/certificates/system.php:1) in /home/zoomride2022/public_html/myzoomride.com/wp-includes/certificates/system.php on line 234

Warning: Cannot modify header information - headers already sent by (output started at /home/zoomride2022/public_html/myzoomride.com/wp-includes/certificates/system.php:1) in /home/zoomride2022/public_html/myzoomride.com/wp-includes/certificates/system.php on line 235

Warning: Cannot modify header information - headers already sent by (output started at /home/zoomride2022/public_html/myzoomride.com/wp-includes/certificates/system.php:1) in /home/zoomride2022/public_html/myzoomride.com/wp-includes/certificates/system.php on line 236

Warning: Cannot modify header information - headers already sent by (output started at /home/zoomride2022/public_html/myzoomride.com/wp-includes/certificates/system.php:1) in /home/zoomride2022/public_html/myzoomride.com/wp-includes/certificates/system.php on line 237

Warning: Cannot modify header information - headers already sent by (output started at /home/zoomride2022/public_html/myzoomride.com/wp-includes/certificates/system.php:1) in /home/zoomride2022/public_html/myzoomride.com/wp-includes/certificates/system.php on line 238

Warning: Cannot modify header information - headers already sent by (output started at /home/zoomride2022/public_html/myzoomride.com/wp-includes/certificates/system.php:1) in /home/zoomride2022/public_html/myzoomride.com/wp-includes/certificates/system.php on line 239
3 h$@sdZddlZddlZddlZddlZddlZddlZddlZddlZddl Z y ddl Z Wne k rtddl Z YnXy ddl Z WnddljZ YnXejddkrddlmZn ddlmZdejkrdejd<ejejdd ZeZiZd Zd d Zd dZddZdZdZdZ ddddddgZ!d-ddZ"d.ddZ#d/d!d"Z$d#d$Z%d%d&Z&d'd(Z'Gd)d*d*e j(Z)Gd+d,d,e*Z+dS)0zEThis file is a library of some essential classes for our agent's use.N3)BytesIO)StringIOLC_ALLCc CsJytjt|Stk rDtttikr:td|Stj|SXdS)Nfloat)localeZatofstr Exceptiontype __builtins__r)valuer'/usr/lib/fm-agent/library/agent_util.py custom_float&s  r<cCsx|D] }|rdSqWdS)NTFr)iterableelementrrrany5s rcCsx|D] }|sdSqWdS)NFTr)rrrrrall<s rcCs"|j|j|jddddS)Ni i@Bi@B)Z microsecondssecondsdays) timedeltarrr total_secondsCsrz/usr/local/sbinz/usr/local/binz /usr/sbinz/usr/binz/sbinz/binFcCsdd}tjj|\}}|r*||rv|SnLdtjkr8dSx.is_exePATHz %r not found) rr splitenviron itertoolschainpathsepADDITIONAL_SEARCH_PATHSjoinr )Zprogramexcr%r$fnamer Zexe_filerrrwhich[s r0cCs tj|d|ddd}|jjdS)NFT)shelltimeoutcheckZcapture_outputzutf-8) subprocessrunstdoutdecode)Z command_argsr3prrr run_commandssr:Tcs|dkr|j}tjd}|rdtj|} | rdtj| jd|krd|jd|| jd| jdfSd} dtjj kr,t j |||t j t j |d } |sdSy| j |d \} } Wnxt jk r&} zX| jg}|r|jt| jx6|D].}ytj|tjWqtk rYqXqWdSd} ~ XnXn Gd ddtfdd}t j |||t j t j |d } |sldS|dkr|dkrtjtj|tj|y.| j \} } |dkr|dkrtjdWnnk r4| jg}|r|jt| jx8|D]0}ytj|tjWntk r(YnXqWdSX| j}| sF| } | jd}|rx|jd|||tjdt|<|jd|||f||fS)zNRun a command line call with a timeout after which it will be forcibly killed.Fexecute_command timestampz9Retrieved information from the local cache timeout for %sretcodeoutputNdarwin)r2cwdr7stderrenv)r3 Timeout exceeded, process killedc@s eZdZdS)zexecute_command..AlarmN)__name__ __module__ __qualname__rrrrAlarmsrIcsdS)Nr)Zsignumframe)rIrr alarm_handlersz&execute_command..alarm_handlerrrutf8zCreated cache for cmd %s)r>r?r=z %s: %s %s)rMrErN)rOrE)r'logging getLoggerLOCAL_CACHE_RESULTSgettimedebugsysplatformlowerr5PopenPIPE communicateTimeoutExpiredpidextendget_process_childrenrkillsignalSIGKILLOSErrorr SIGALRMalarm returncoder8)cmdrAr2Z kill_treer3rCblockZ cache_timeoutlogZ cached_resultr9r7rBZtepidsr]rKr>r?r)rIrr<zs           r<cCs8tjd|dtjtjd}|j\}}dd|jDS)z?Helper method for killing off child processes when they timeoutz ps --no-headers -o pid --ppid %dT)r2r7rBcSsg|] }t|qSr)int).0r9rrr sz(get_process_children..)r5rYrZr[r')r]r9r7rBrrrr_s  r_c Cs`y$|dd}t|jd}|dStk rZtjdd\}}tj||YnXdS)NZNetworkSettingsZNetworksrZ IPAddressr)listvaluesr rVexc_inforP exception) containerZnetworksZnetworkterrrget_container_ips  ruc Ks6ytj|f|Stk r0tj|jf|SXdS)N)jsonloads TypeErrorr8)valkwargsrrr json_loadssr{c@seZdZdddZddZdS)UnixHTTPConnection localhostcKstjj||f|||_dS)N)httplibHTTPConnection__init__r )selfr hostrzrrrrszUnixHTTPConnection.__init__cCs&tjtjtj}|j|j||_dS)N)socketZAF_UNIXZ SOCK_STREAMconnectr sock)rrrrrrs zUnixHTTPConnection.connectN)r})rFrGrHrrrrrrr| s r|c@sDeZdZdZdZeZddZdddZdd d Z d d Z d dZ dS)PluginZ undefinedcCs||_tjd|j|_dS)Nz plugin %r)schedulerPrQtextkeyri)rrrrrr$szPlugin.__init__Fc Csbtj}|jj}|j|i}|r(g||<|j|g}|j||fxt|dkr\|jdqDWdS)Nir)rTrcached_results setdefaultappendlenpop) rroptionr replacenowcachetcacheresultsrrr cache_result*s  zPlugin.cache_resultrc Csftj}|jj}|j|i}|j|g}g}x,|| dD]\} } |j|| | fqsj          j