一个非常简单的基于sqs的分布式系统命令通知包
command-notifier的Python项目详细描述
一个非常简单的基于sqs的分布式系统命令通知包
>;警告:这可能会被滥用,从而破坏整个基础结构,获得根访问权限等。
安装
通过pypi使用pip:
pip install command-notifier
通过github使用pip:
pip install git+git://github.com/josegonzalez/python-command-notifier.git#egg=command-notifier
用法
cn publish的cli用法如下:
usage: cn-publish [-h] [-a AWS_ACCESS_KEY_ID] [-s AWS_SECRET_ACCESS_KEY] [-c COMMAND] [-r EC2_REGION] [-t SNS_TOPIC] cn-publish, a tool to publish a command via sns optional arguments: -h, --help show this help message and exit -a AWS_ACCESS_KEY_ID, --aws-access-key-id AWS_ACCESS_KEY_ID AWS Access Key ID -s AWS_SECRET_ACCESS_KEY, --aws-secret-access-key AWS_SECRET_ACCESS_KEY AWS Secret Access Key -c COMMAND, --command COMMAND Command to publish -r EC2_REGION, --ec2-region EC2_REGION EC2 Region -t SNS_TOPIC, --sns-topic SNS_TOPIC SNS Topic to publish to cn-publish is pwnage
cn subscribe的cli用法如下:
usage: cn-subscribe [-h] [-a AWS_ACCESS_KEY_ID] [-s AWS_SECRET_ACCESS_KEY] [-c COMMAND_FILE] [-r EC2_REGION] [-t SNS_TOPIC] [-w SNS_WAIT_TIME_SECONDS] [-q SQS_QUEUE] cn-subscribe, a tool to run commands published from sqs optional arguments: -h, --help show this help message and exit -a AWS_ACCESS_KEY_ID, --aws-access-key-id AWS_ACCESS_KEY_ID AWS Access Key ID -s AWS_SECRET_ACCESS_KEY, --aws-secret-access-key AWS_SECRET_ACCESS_KEY AWS Secret Access Key -c COMMAND_FILE, --command-file COMMAND_FILE Path to json file with whitelisted commands -r EC2_REGION, --ec2-region EC2_REGION EC2 Region -t SNS_TOPIC, --sns-topic SNS_TOPIC SNS Topic to subscribe to -w SNS_WAIT_TIME_SECONDS, --sns-wait-time-seconds SNS_WAIT_TIME_SECONDS SNS Wait Time in Seconds -q SQS_QUEUE, --sqs-queue SQS_QUEUE SQS Queue to utilize to cn-subscribe is pwnage
也可以使用等效的环境变量代替命令参数。