HEX
Server: LiteSpeed
System: Linux atali.colombiahosting.com.co 5.14.0-570.12.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Tue May 13 06:11:55 EDT 2025 x86_64
User: coopserp (1713)
PHP: 8.2.29
Disabled: dl,exec,passthru,proc_open,proc_close,shell_exec,memory_limit,system,popen,curl_multi_exec,show_source,symlink,link,leak,listen,diskfreespace,tmpfile,ignore_user_abord,highlight_file,source,show_source,fpaththru,virtual,posix_ctermid,posix_getcwd,posix_getegid,posix_geteuid,posix_getgid,posix_getgrgid,posix_getgrnam,posix_getgroups,posix_getlogin,posix_getpgid,posix_getpgrp,posix_getpid,posix,posix_getppid,posix_getpwnam,posix_getpwuid,posix_getrlimit,posix_getsid,posix_getuid,posix_isatty,posix_kill,posix_mkfifo,posix_setegid,posix_seteuid,posix_setgid,posix_setpgid,posix_setsid,posix_setid,posix_times,posix_ttyname,posix_uname,proc_get_status,proc_nice,proc_terminate
Upload Files
File: //usr/local/lib/python3.9/site-packages/agent360/plugins/__pycache__/mongodb.cpython-39.pyc
a

��?h��@sDddlZddlZddlmZGdd�dej�Zedkr@e���dS)�N)�MongoClientc@seZdZdZdd�ZdS)�Plugin�mongodbc
Cs�t|�dd��}|j}|�d�}|��}i}i}z4|dddurFdnd|d	<t|dd
�|d<WnYn0z�|dd
|d<|dd|d<|dd|d<|dd|d<|dd|d<|dd|d<|dd|d<|dd|d<|dd|d<WnYn0|dd |d!<|dd"|d#<|dd$|d%<|d&d'|d(<|d&d)|d*<|d&d+|d,<|d&d-|d.<|d&d/|d0<|d&d1|d2<|d3d4d5|d6<|d3d4d7|d8<|d3d9d5|d:<|d3d9d7|d;<|d3d<d5|d=<|d3d<d7|d><|d?d@dA|dB<|d?d@dC|dD<|d?d@dE|dF<|d?dGdA|dH<|d?dGdC|dI<|d?dGdE|dJ<|dKdL|dM<|dKdN|dO<|dKdP|dQ<|dKdR|dS<|dKdT|dU<zZ|dV��D]H\}}	|	��D]4\}
}|��D] \}}
|
|dW�|��|
|�<�q�q�q�WnYn0zd|dXd'|dY<|dXd)|dZ<|dXd+|d[<|dXd-|d\<|dXd/|d]<|dXd1|d^<Wnt	�y�Yn0|��D]\}}	|�
||	|�||<�q�z@|d6|d8|d_<|d=|d>|d`<|d:|d;|da<WnYn0|}t��|db<|�|�|dcdd|de<|dcdf|dg<|dcdh|di<|dcdjdu�r�dnd|dk<|S)lz$
        Mongodb monitoring
        rZconnection_stringZserverStatus�replZismasterFr�Z	isprimary�hosts�membersZtransactionsZretriedCommandsCountz!transactions-retriedCommandsCountZretriedStatementsCountz#transactions-retriedStatementsCountZ transactionsCollectionWriteCountz-transactions-transactionsCollectionWriteCountZtotalAbortedztransactions-totalAbortedZtotalCommittedztransactions-totalCommittedZtotalStartedztransactions-totalStartedZ
currentActiveztransactions-currentActiveZcurrentInactiveztransactions-currentInactiveZcurrentOpenztransactions-currentOpen�connectionsZtotalCreatedzconnections.totalCreated�	availablezconnections.available�currentzconnections.currentZ
opcounters�commandzopcounters.command�deletezopcounters.deleteZgetmorezopcounters.getmore�insertzopcounters.insert�queryzopcounters.query�updatezopcounters.updateZopLatencies�commandsZlatencyzopLatencies.commands.latency�opszopLatencies.commands.opsZreadszopLatencies.reads.latencyzopLatencies.reads.opsZwriteszopLatencies.writes.latencyzopLatencies.writes.opsZ
globalLockZcurrentQueue�totalzglobalLock.currentQueue.totalZreaderszglobalLock.currentQueue.readersZwriterszglobalLock.currentQueue.writersZ
activeClientszglobalLock.activeClients.totalz globalLock.activeClients.readersz globalLock.activeClients.writersZasserts�msgzasserts.msgZregularzasserts.regularZ	rolloverszasserts.rollovers�userzasserts.user�warningzasserts.warning�lockszlocks-{}-{}-{}ZopcountersReplzopcountersRepl.commandzopcountersRepl.deletezopcountersRepl.getmorezopcountersRepl.insertzopcountersRepl.queryzopcountersRepl.updatezopLatencies.commandszopLatencies.writeszopLatencies.reads�tsZmemZresidentzmem.resident�bitszmem.bitsZvirtualzmem.virtual�	supportedz
mem.supported)
r�getZadminrZget_agent_cache�len�items�format�lower�KeyErrorZabsolute_to_per_second�timeZset_agent_cache)�self�config�client�db�
statisticsZ
prev_cache�data�results�key�val�key2Zval2Zkey3Zval3Z
next_cache�r,�B/usr/local/lib/python3.9/site-packages/agent360/plugins/mongodb.py�run
s�
&
z
Plugin.runN)�__name__�
__module__�__qualname__r.r,r,r,r-rsr�__main__)r!ZpluginsZpymongorZ
BasePluginrr/�executer,r,r,r-�<module>s
k