Commit 3ee4934c by see.liuh@gmail.com

1. 增加zabbix动态item功能( Low-level discovery),简称lld的操作文档。见章节4.6

2. vproc脚本增加生成lld所需json串功能。
3. vproc脚本根目录修改为/root/Log
1 parent 8afaa1da
#!/usr/bin/python
# coding: utf-8
import urllib
import urllib2
import datetime
import time
import sys
if __name__ == '__main__':
param_day = 7
if(len(sys.argv) >= 2) :
param_day=int(sys.argv[1])
# http://localhost:9200/_cat/indices?v
date_now = datetime.date.today()
days_before_30 = date_now - datetime.timedelta(days=param_day)
date_format = days_before_30.__format__('%Y.%m.%d')
url_delete = "http://127.0.0.1:9200/*-{}".format(date_format)
request_delete = urllib2.Request(url_delete)
request_delete.get_method = lambda:'DELETE'
response_delete = urllib2.urlopen(request_delete).read()
print(response_delete)
#!/bin/bash
ansible starnet -s -m raw -a "sed -i 's/^name.*/name: \"{{ inventory_hostname }}\"/g' /root/UserApp/filebeat_app/filebeat.yml"
ansible starnet -s -m raw -a "sed -i 's/192.168.9.112:9200/192.168.88.12:9200/g' /root/UserApp/filebeat_app/filebeat.yml"
ansible starnet -s -m raw -a "sed -i 's/Server=192.168.8.133/Server=192.168.88.12/g' /usr/local/etc/zabbix_agentd.conf"
ansible starnet -s -m raw -a "sed -i 's/ServerActive=192.168.8.133/ServerActive=192.168.88.12/g' /usr/local/etc/zabbix_agentd.conf"
ansible starnet -s -m raw -a "sed -i 's/^Hostname=.*/Hostname=starnet_gongsi/g' /usr/local/etc/zabbix_agentd.conf"
ansible starnet -s -m raw -a "pkill -9 filebeat; pkill -9 zabbix_agentd; zabbix_agentd"
ansible starnet_master -s -m raw -a "sed -i 's/192.168.9.133:9200/192.168.9.112:9200/g' /etc/haproxy/haproxy.cfg; service haproxy restart"
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!