solarwinds.swisnap
SolarWinds Snap Agent Ansible 角色
在 RHEL/CentOS、Debian/Ubuntu 或 Windows 服务器上安装和配置 SolarWinds Snap Agent。
有关 SolarWinds Snap Agent 的详细信息,请参阅 文档。
角色变量
默认值的 Ansible 角色变量如下所示:
solarwinds_token: ""
AppOptics API 的 token。在运行角色之前需要由用户配置。
swisnap_hostname_alias: ""
将在 AppOptics 界面中使用的服务器主机名别名。
swisnap_main_config_path: /opt/SolarWinds/Snap/etc/config.yaml
SolarWinds Snap Agent 主配置文件的路径。
swisnap_plugins_config: /opt/SolarWinds/Snap/etc/plugins.d
SolarWinds Snap Agent 插件配置文件的路径。
swinsap_publisher_appoptics_path: /opt/SolarWinds/Snap/etc/plugins.d/publisher-appoptics.yaml
SolarWinds Snap Agent 发布者 AppOptics 配置文件的路径。
swinsap_processes_appoptics_path: /opt/SolarWinds/Snap/etc/plugins.d/publisher-processes.yaml
SolarWinds Snap Agent 发布者进程配置文件的路径。
swisnap_auto_discover_path: /opt/SolarWinds/Snap/autoload
SolarWinds Snap Agent V1 插件的自动加载目录路径。
swisnap_tasks_autoload_path: /opt/SolarWinds/Snap/etc/tasks-autoload.d
SolarWinds Snap Agent V2 任务文件的路径。
swisnap_plugin_path: /opt/SolarWinds/Snap/bin
SolarWinds Snap Agent 插件二进制文件存储的路径。
swisnap_task_path: /opt/SolarWinds/Snap/etc/tasks.d
SolarWinds Snap Agent V1 任务文件的路径。
swisnap_service: swisnapd
swisnap_user: solarwinds
swisnap_user_group: solarwinds
SolarWinds Snap Agent 服务的名称。服务运行的用户和用户组。
swisnap_log_level: warning
swisnap_log_path: /var/log/SolarWinds/Snap
swisnap_log_format: text
日志级别、日志文件路径和日志格式。
swisnap_plugin_trust_level: ""
swisnap_keyring_paths: ""
swisnapd 的插件信任级别。启用时,只会加载可以被验证的已签名插件。签名将从 swisnap_keyring_path 中指定的密钥环文件进行验证。有效值为 0 - 关闭,1 - 启用,2 - 警告。默认值为 1 - 启用。如果未设置,则代理将使用默认启用级别。
swisnap_tls_cert_path: ""
swisnap_tls_key_path: ""
swisnap_plugin_tls_cert_path: ""
swisnap_plugin_tls_key_path: ""
swisnap_ca_cert_paths: ""
安全插件通信的可选参数。
swisnap_plugin_load_timeout: ""
允许加载插件的最大时间。默认值为 30。
swisnap_global_tags: {}
将应用于跨任务收集的指标的标签。
swisnap_restapi_enable: true
swisnap_restapi_https: ""
swisnap_restapi_rest_auth: ""
swisnap_restapi_rest_auth_password: ""
swisnap_restapi_rest_certificate: ""
swisnap_restapi_rest_key: ""
swisnap_restapi_port: ""
swisnap_restapi_addr: ""
swisnap_restapi_plugin_load_timeout: ""
可选的 REST API 参数。默认启用 REST API。
publisher_appoptics_url: ""
publisher_processes_url: ""
这些参数可以覆盖发布者的默认 URL。
swisnap_proxy_url: ""
swisnap_proxy_user: ""
swisnap_proxy_password: ""
可选的代理设置。
swisnap_host_check_timeout: ""
swisnap_host_check_timeout 允许配置查询主机操作系统以获取标识信息的超时时间。默认值设置为 5 秒。
swisnap_ec2_check_timeout: ""
swisnap_ec2_check_timeout 允许配置查询 EC2 实例元数据 URL 的超时时间,以确定主机代理是否在 EC2(或 OpenStack)实例上运行。默认值设置为 1 秒。
swisnap_ec2_check_retries: ""
swisnap_ec2_check_retries 允许配置查询 EC2 实例元数据 URL 的重试次数,以确定主机代理是否在 EC2(或 OpenStack)实例上运行。默认值设置为 3。
swisnap_floor_seconds: ""
是否将时间戳向下取整到特定时间间隔,默认值为 60 秒。
swisnap_period: ""
向 AppOptics API 报告的度量间隔时间,默认值为 60 秒。
swisnap_custom_v1_task_path: ""
swisnap_custom_v2_task_path: ""
swisnap_custom_plugin_configs_path: ""
自定义任务和插件配置文件的目录路径。允许用户配置额外的插件。应该是目录路径,例如 /path/to/directory
。
swisnap_win_installer_download_path: ""
用于下载 Windows 安装程序的路径。用户在 Windows 平台上运行角色之前需要配置该路径。
swisnap_package_version: ""
要安装的软件包特定版本,例如 4.0.0.863
。仅适用于 Linux 平台。对于 Windows 始终安装最新的软件包。
示例剧本
使用 Ansible Galaxy 安装 SolarWinds swisnap 角色:
ansible-galaxy install solarwinds.swisnap
或将此存储库克隆到您的剧本角色目录中:
git clone https://github.com/solarwinds/ansible-swisnap.git solarwinds.swisnap
Linux
- hosts: localhost
connection: local
vars_files:
- vars/my_vars.yaml
roles:
- solarwinds.swisnap
在 vars/my_vars.yaml
中:
solarwinds_token: 123456789dbba089e9ff613bb9528320188853b1a08d91d23d2fc9bc1c41ec3e
Windows:
- hosts: windows
vars_files:
- vars/main.yml
roles:
- solarwinds.swisnap
在 vars/my_vars.yaml
中:
solarwinds_token: 123456789dbba089e9ff613bb9528320188853b1a08d91d23d2fc9bc1c41ec3e
swisnap_win_installer_download_path: "C:\\Users\\Administrator\\Downloads\\solarwinds-snap-agent-installer.msi"
在 inventory
中:
[windows]
1.2.3.4
在 group_vars/windows
中:
ansible_user: Administrator
ansible_password: password
ansible_port: 5986
ansible_connection: winrm
ansible_winrm_server_cert_validation: ignore
ansible-galaxy install solarwinds.swisnap