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__/maas.cpython-36.pyc
3

~�gC�@s.ddlZddlmZmZGdd�dee�ZdS)�N)�Plugin�UbuntuPluginc
@sLeZdZdZdZdZd Zd!Zd"Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dS)#�MAASzMAAS | Metal as a Service�maasi�sysmgmt�maas-region-api�maas-region-controller�maas-rack-controller�
maas-agent�maas-apiserver�
maas-dhcpd�maas-dhcpd6�	maas-http�
maas-proxy�
maas-rackd�maas-regiond�maas-syslog�
maas-temporal�maas-temporal-worker�snap.maas.supervisor�snap.maas.pebblecs��j|�sgSg}x��j|�D]�}�j||���j��s:q��fdd��j��D�}|sZqt|dd�dd�}�jd�}�jd��|r��r�|j|d	�q�r��j�nd	�|j�fd
d�|D��qW|S)Ncs"g|]}�j��r�j�|��qS�)�
path_isdir�	path_join)�.0�d)�	host_path�selfr�/usr/lib/python3.6/maas.py�
<listcomp>>sz-MAAS._get_machines_syslog.<locals>.<listcomp>cSstj|�jS)N)�os�stat�st_mtime)rrrr�<lambda>Gsz+MAAS._get_machines_syslog.<locals>.<lambda>T)�key�reverse�all_logs�sincercs g|]}tj|�j�kr|�qSr)r r!r")rr)r'rrrRs)	Zpath_exists�listdirrr�sorted�
get_option�appendZ	timestamp�extend)rZ	directoryZrecentZhost_dirZsubdirsZsorted_subdirsr&r)rrr'r�_get_machines_syslog/s*



zMAAS._get_machines_syslogcCsf|jddgdd�|jdddg�|jdd	d
ddd
dg�|jd�rR|jddg�|j|jd��dS)Nzsnap info maaszmaas statusT)Zsnap_cmdz/var/snap/maas/**/*.keyz/var/snap/maas/**/*.pemz/var/snap/maas/**/secretz/var/snap/maas/common/snap_modez"/var/snap/maas/common/log/**/*.logz /var/snap/maas/current/**/*.confz /var/snap/maas/current/**/*.yamlz/var/snap/maas/current/bindz/var/snap/maas/current/preseedsz(/var/snap/maas/current/supervisord/*.logr&z$/var/snap/maas/common/log/**/*.log.*z*/var/snap/maas/current/supervisord/*.log.*z!/var/snap/maas/common/log/rsyslog)�add_cmd_output�add_forbidden_path�
add_copy_specr*r-)rrrr�
_snap_collectWs.
zMAAS._snap_collectcCsd|jdg�|jddddddg�|jdd	d
ddd
dg�|jd�rP|jdg�|j|jd��dS)Nzapt-cache policy maas maas-*z/var/lib/maas/**/*.keyz/var/lib/maas/**/*.pemz/var/lib/maas/**/secretz/etc/maas/**/*.keyz/etc/maas/**/*.pemz/etc/maas/**/secretz/etc/maas/**/*.confz/etc/maas/**/*.yamlz/etc/maas/preseedsz/var/lib/maas/**/*.confz/var/lib/maas/dhcp/*.leasesz/var/lib/maas/temporalz/var/log/maas/**/*.logr&z/var/log/maas/**/*.log.*z/var/log/maas/rsyslog)r.r/r0r*r-)rrrr�_deb_collectys.
zMAAS._deb_collectcCsrxT|jD]J}|j|�r|j|�|jd�sH|jd�p6d}|j||d�q|j|�qW|jrf|j�n|j�dS)Nr&r'z-1days)r')�	_servicesZ
is_serviceZadd_service_statusr*Zadd_journalZis_snapr1r2)rZservicer'rrr�setup�s



z
MAAS.setupcCs|jddd�dS)Nz(.*)\.(conf|yaml|yml|toml)$z1((?:.*secret|.*password|.*pass)(?::\s*|=\s*))(.*)z\1*****)Zdo_path_regex_sub)rrrr�postproc�sz
MAAS.postprocN)r)rrrr	r
)
r
rrr
rrrrrrrrr)�__name__�
__module__�__qualname__Z
short_descZplugin_nameZplugin_timeoutZprofilesZpackagesr3r-r1r2r4r5rrrrrs6("#r)r Zsos.report.pluginsrrrrrrr�<module>s

NineSec Team - 2022