Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
plugin
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
op
plugin
Commits
a2daae2d
Commit
a2daae2d
authored
Apr 25, 2020
by
feilong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
init
parent
da005429
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
8 additions
and
14 deletions
+8
-14
120_hwcheck.sh
120_hwcheck.sh
+0
-0
30_mysql.sh
30_mysql.sh
+0
-1
30_oracle.py
30_oracle.py
+0
-3
60_linux_cpu.py
60_linux_cpu.py
+1
-0
hwcheck_dell.py
hwcheck_dell.py
+4
-3
mongodb_server.py
mongodb_server.py
+0
-1
oracle_pyora.py
oracle_pyora.py
+3
-6
No files found.
120_hwcheck.sh
View file @
a2daae2d
30_mysql.sh
View file @
a2daae2d
...
...
@@ -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
...
...
30_oracle.py
View file @
a2daae2d
...
...
@@ -7,10 +7,7 @@ items:
"""
import
os
import
sys
import
urllib2
import
base64
import
json
import
re
import
time
import
yaml
import
commands
...
...
60_linux_cpu.py
View file @
a2daae2d
...
...
@@ -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
:
...
...
hwcheck_dell.py
View file @
a2daae2d
...
...
@@ -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
))
...
...
mongodb_server.py
View file @
a2daae2d
...
...
@@ -2,7 +2,6 @@
#-*- coding:utf8 -*-
import
sys
import
os
import
pymongo
from
pymongo
import
MongoClient
...
...
oracle_pyora.py
View file @
a2daae2d
...
...
@@ -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
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment