Commit a2daae2d by feilong

init

parent da005429
......@@ -48,7 +48,6 @@ Get_current_value(){
esac
}
Push_n9e(){
for metric_array in ${metric_arrays[@]};do
{
for pre_metric in $(eval echo \${$metric_array[@]});do
......
......@@ -7,10 +7,7 @@ items:
"""
import os
import sys
import urllib2
import base64
import json
import re
import time
import yaml
import commands
......
......@@ -45,6 +45,7 @@ if __name__ == "__main__":
sys.stderr.write('cannot get local ip')
sys.exit(0)
core_total = int(os.popen("cat /proc/cpuinfo | grep processor | tail -1 | cut -d' ' -f2").read().strip()) + 1
# 核数太多采集单核指标意义不大
if core_total <= 8:
print(json.dumps(get_cpu_core_stat(core_total)))
else:
......
......@@ -609,7 +609,8 @@ def check(target=False):
# pass
if __name__ == "__main__":
code, endpoint = commands.getstatusoutput("ifconfig `route|grep '^default'|awk '{print $NF}'`|grep inet|awk '{print $2}'|awk -F ':' '{print $NF}'|head -n 1")
code, endpoint = commands.getstatusoutput(
"ifconfig `route|grep '^default'|awk '{print $NF}'`|grep inet|awk '{print $2}'|awk -F ':' '{print $NF}'|head -n 1")
if code != 0:
sys.stderr.write('cannot get local ip')
sys.exit(0)
......@@ -625,7 +626,7 @@ if __name__ == "__main__":
step = 600
else:
step = int(options.step)
metric=None
metric = None
if options.metric:
metric = options.metric
if metric not in metrics:
......@@ -636,7 +637,7 @@ if __name__ == "__main__":
if options.push:
addmsg('status', 2)
print(json.dumps(messages))
#push(messages)
# push(messages)
else:
if options.debug:
print(json.dumps(messages, indent=2))
......
......@@ -2,7 +2,6 @@
#-*- coding:utf8 -*-
import sys
import os
import pymongo
from pymongo import MongoClient
......
......@@ -2,9 +2,6 @@
# coding: utf-8
import cx_Oracle
import inspect
import json
import re
class OracleTool(object):
......@@ -486,7 +483,7 @@ if __name__ == "__main__":
'dbname': 'orcl11g',
}
odb = OracleTool(dbconfig)
print odb.version()
print odb.tablespace_temp('TEMP')
print odb.show_tablespaces_temp()
print(odb.version())
print(odb.tablespace_temp('TEMP'))
print(odb.show_tablespaces_temp())
odb.db_close()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment