NineSec Team Shell
Server IP : 184.107.3.203  /  Your IP : 216.73.216.51
Web Server : Apache
System : Linux dedicated2.avenfashion.com.ph 4.18.0-553.40.1.el8_10.x86_64 #1 SMP Mon Feb 10 12:11:18 EST 2025 x86_64
User : adminteladeoro ( 1015)
PHP Version : 8.2.28
Disable Function : exec,passthru,shell_exec,system
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0755) :  /usr/lib/python3.6/site-packages/sos/report/plugins/__pycache__/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : //usr/lib/python3.6/site-packages/sos/report/plugins/__pycache__/juju.cpython-36.opt-1.pyc
3

~�g��@s:ddlZddlZddlmZmZmZGdd�dee�ZdS)�N)�Plugin�UbuntuPlugin�	PluginOptc	@sleZdZdZdZdZdZdZedde	d	d
�edde
d
d
�edde
dd
�edde
dd
�gZdd�Zdd�Z
dS)�Jujua3The Juju plugin is aimed at collecting Juju-related logs,
    configurations, and controller/model state(s).

    Logs and agent configuration information (/var/log/juju and /var/lib/juju)
    is collected by default since these are useful for troubleshooting.

    The Juju state collection is disabled by default and can be enabled with
    the 'juju-state' option. Collecting Juju state is safe in theory, but it
    does act on the live controller(s)/model(s) and is therefore optional.

    The default Juju state collection collects all controllers and models that
    the 'juju-user' (default=ubuntu) has access to.

    Specific controllers or models can be collected using the 'controllers'
    and 'models' options.

    Important: the string list is whitespace delimited, not colon delimited
    (sos plugin standard). This is due to the underlying Juju CLI accepting
    specific models in the format 'controller:model' and whitespaces are not
    allowed in either controller and model names.

    Example: models="controller_a:model_x controller_b:model_y"
    zJuju orchestration toolZjuju�virt�sysmgmt�
/var/log/jujuz
juju-stateFz Include Juju state in the report)�defaultZval_typeZdescz	juju-userZubuntuzJuju client user.�controllers�z[Collect Juju state for specified controllers. Uses a             whitespace delimited list.�modelszVCollect Juju state for specified models. Uses a whitespace             delimited list.cCs>x&|jd�D]}|j|�|j|�qW|jdddddddd	d
dg
�|jd�|jd
dgdd�|jd�r�|jdddg�|jd�|jd�n
|jd�|jd�s�dS|jd�}ytj	|�Wn&t
k
r�|jd|�d��dSX|jd��r|jd��r|jd�dS|jd|d �}|d!d"k�rtt
|jd�jd#��}|�rX|d$hk�rX|}nt
tj|d%�dj��}ni}|jd��r�x�|jd�jd#�D] }d&|�d'�}|j||d ��q�Wn~x||D]t}|jd(|�d'�|d �}	|	d!d"k�r�tj|	d%�d}
x6|
D].}|d)}d&|�d*|�d'�}|j||d ��qW�q�WdS)+Nzjuju*Zjuju_engine_reportZjuju_goroutinesZjuju_heap_profileZjuju_leasesZjuju_metricsZjuju_pubsub_reportZjuju_presence_reportZjuju_statepool_reportZjuju_statetracker_reportZjuju_unit_statusz!/var/lib/juju/agents/*/agent.confz/var/log/juju*z/var/lib/juju*T)�	recursiveZall_logsz
/var/log/jujuz
/var/lib/jujuz/var/lib/juju/**/.*z/var/lib/juju/kvmz/var/lib/juju/toolsz/var/log/juju/*.logz
juju-statez	juju-userzUser "z4" does not exist, will not collect Juju information.r
rzWOptions: controllers, models are mutually exclusive. Will not collect Juju information.zjuju controllers --format=json)ZrunasZstatusr� r�outputzjuju status -m z --format=jsonzjuju models --all -c z
short-name�:)Zget_service_namesZadd_journalZadd_service_statusZadd_cmd_outputZ
add_copy_specZadd_dir_listingZ
get_optionZadd_forbidden_path�pwd�getpwnam�KeyErrorZ	_log_warnZcollect_cmd_output�set�split�json�loads�keysZexec_cmd)�selfZserviceZ	juju_userZcontrollers_jsonZdesired_controllersr
ZmodelZcommandZ
controllerZmodels_jsonrZ
short_name�r�/usr/lib/python3.6/juju.py�setupOs�










z
Juju.setupcCsLd}ddddg}ddj|��d�}d	}|j|||�|j|�|jd
�dS)Nz/var/lib/juju/agents/*ZsharedsecretZapipasswordZoldpasswordZ
statepasswordz(^\s*(�|z
)\s*:\s*)(.*)z\1*********zjuju controllers)�joinZdo_path_regex_subZdo_file_private_subZdo_cmd_private_sub)rZagents_pathZprotect_keysZ
keys_regexZ	sub_regexrrr�postproc�s
z
Juju.postprocN)rr)r)�__name__�
__module__�__qualname__�__doc__Z
short_descZplugin_nameZprofiles�filesr�bool�strZoption_listrrrrrrrs6
nr)rrZsos.report.pluginsrrrrrrrr�<module>s

NineSec Team - 2022