Skip to content

Commit

Permalink
Merge pull request #12 from tech-sketch/nano-sec-support
Browse files Browse the repository at this point in the history
support nano sec for sender data
  • Loading branch information
ike-dai authored Mar 27, 2017
2 parents b003d19 + 61ecdf4 commit 09a3a09
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
5 changes: 4 additions & 1 deletion lambda_code/AWS_AmazonSNS.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,10 @@ def __check_event_type(self, record):
return "Other"

def send_to_zabbix(self):
send_data = json.loads('{"request":"sender data","data":[]}')
now = "%.9f" % time.time()
sec = now.split(".")[0]
ns = now.split(".")[1]
send_data = json.loads('{"request":"sender data","data":[],"clock":%s,"ns":%s }' % (sec, ns))
send_data["data"] = self.send_items
send_data_string = json.dumps(send_data)
zbx_client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
Expand Down
5 changes: 4 additions & 1 deletion scripts/AWS_Service_Health_Dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ def __init__(self, base_url, block, zabbix_host='localhost', zabbix_port=10051):


def get_rss(self, url):
send_data = json.loads('{"request":"sender data","data":[]}')
now = "%.9f" % time.time()
sec = now.split(".")[0]
ns = now.split(".")[1]
send_data = json.loads('{"request":"sender data","data":[],"clock":%s,"ns":%s }' % (sec, ns))
response = feedparser.parse(url)
send_items = []

Expand Down
5 changes: 4 additions & 1 deletion scripts/cloudwatch_zabbix.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,10 @@ def __send_to_zabbix(self, send_data):


def send_metric_data_to_zabbix(self):
send_data = json.loads('{"request":"sender data","data":[]}')
now = "%.9f" % time.time()
sec = now.split(".")[0]
ns = now.split(".")[1]
send_data = json.loads('{"request":"sender data","data":[],"clock":%s,"ns":%s }' % (sec, ns))
metric_list = self.__get_metric_list()
all_metric_stats = []
servicename = self.service
Expand Down

0 comments on commit 09a3a09

Please # to comment.