ruạṛ
3 ?L�i � @ sD d dl Z d dlZd dlZdZG dd� de j�Zedkr@e� j� dS )� Nz&/usr/sbin/bitninjacli --stats --minifyc @ s e Zd ZdZ dd� ZdS )�PluginZbitninjac C sp y|j td�}W n t}Y nX tjd| �}|j� }|d }|jd�}|dkrltj||d� j dd��S dS )aj Collects metrics from the BitNinja Linux Agent. For this plugin to work, at least BitNinja version 2.38.8 is required, and the following configurations must be applied to it: /etc/bitninja/System/config.ini: ```ini [statistics] enableIntegration = 1 ``` This will allow agent360 to access the statistics. Then after a BitNinja restart, the plugin can be tested by running: sudo -u agent360 agent360 test bitninja Add to /etc/agent360.ini: ```ini [bitninja] enabled = true ``` ZstatCommandzsudo r �{N� � ) �get�__name__�DEFAULT_STAT_COMMAND�os�popen� readlines�find�json�loads�replace)�self�config�command�stream�resultZ firstLineZ startIndex� r �B/root/tmp/pip-build-3x0y2zol/agent360/agent360/plugins/bitninja.py�run s z Plugin.runN)r � __module__�__qualname__r r r r r r s r �__main__)Zpluginsr r r Z BasePluginr r �executer r r r �<module> s )
cải xoăn