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
e4ec1291
Commit
e4ec1291
authored
Aug 10, 2020
by
feilong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
init
parent
25432fc5
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
10 additions
and
10 deletions
+10
-10
10_ss.sh
10_ss.sh
+1
-1
120_hwcheck.sh
120_hwcheck.sh
+1
-1
30_mysql.sh
30_mysql.sh
+1
-1
30_oracle.py
30_oracle.py
+1
-1
30_rabbitmq.py
30_rabbitmq.py
+1
-1
30_redis.sh
30_redis.sh
+1
-1
60_linux.sh
60_linux.sh
+1
-1
60_linux_cpu.py
60_linux_cpu.py
+1
-1
60_mongodb.py
60_mongodb.py
+1
-1
hwcheck_dell.py
hwcheck_dell.py
+1
-1
No files found.
10_ss.sh
View file @
e4ec1291
...
...
@@ -13,7 +13,7 @@ ss_orphaned=$(echo $output | grep -Po "orphaned (\d+)" | awk '{print $2}')
ss_synrecv
=
$(
echo
$output
|
grep
-Po
"synrecv (
\d
+)"
| awk
'{print $2}'
)
ss_timewait
=
$(
echo
$output
|
grep
-Po
"timewait (
\d
+)"
| awk
'{print $2}'
)
endpoint
=
$(
ifconfig
`
route|grep
'^default'
|awk
'{print $NF}'
`
|grep inet|awk
'{print $2}'
|awk
-F
':'
'{print $NF}'
|head
-n
1
)
endpoint
=
$(
ifconfig
`
route|grep
'^default'
|
head
-n1
|
awk
'{print $NF}'
`
|grep inet|awk
'{print $2}'
|awk
-F
':'
'{print $NF}'
|head
-n
1
)
step
=
$(
basename
$0
|awk
-F
'_'
'{print $1}'
)
timestamp
=
$(
date +%s
)
...
...
120_hwcheck.sh
View file @
e4ec1291
...
...
@@ -4,7 +4,7 @@
PATH
=
$PATH
:/usr/sbin:/sbin
step
=
$(
echo
$0
|grep
-Po
'\d+(?=_)'
)
endpoint
=
$(
ifconfig
`
route|grep
'^default'
|awk
'{print $NF}'
`
|grep inet|awk
'{print $2}'
|awk
-F
':'
'{print $NF}'
|head
-n
1
)
endpoint
=
$(
ifconfig
`
route|grep
'^default'
|
head
-n1
|
awk
'{print $NF}'
`
|grep inet|awk
'{print $2}'
|awk
-F
':'
'{print $NF}'
|head
-n
1
)
base_dir
=
$(
cd
$(
dirname
$0
)
;
pwd
)
cd
$base_dir
...
...
30_mysql.sh
View file @
e4ec1291
...
...
@@ -8,7 +8,7 @@ mysqld_max_con=13684
user
=
"monitor"
pass
=
"3IPSkSxDpiPUtlF"
host
=
"127.0.0.1"
endpoint
=
$(
ifconfig
`
route|grep
'^default'
|awk
'{print $NF}'
`
|grep inet|awk
'{print $2}'
|awk
-F
':'
'{print $NF}'
|head
-n
1
)
endpoint
=
$(
ifconfig
`
route|grep
'^default'
|
head
-n1
|
awk
'{print $NF}'
`
|grep inet|awk
'{print $2}'
|awk
-F
':'
'{print $NF}'
|head
-n
1
)
Json_join
(){
metric
=
$1
...
...
30_oracle.py
View file @
e4ec1291
...
...
@@ -21,7 +21,7 @@ counter_metric_list = ["commits","dbseqread","indexffs","logfilesync","logprllwr
conf_file
=
os
.
path
.
join
(
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
)),
'oracle_auth.conf'
)
if
not
os
.
path
.
exists
(
conf_file
):
sys
.
exit
(
0
)
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'|
head -n1|
awk '{print $NF}'`|grep inet|awk '{print $2}'|awk -F ':' '{print $NF}'|head -n 1"
)
if
code
!=
0
:
sys
.
exit
(
0
)
f
=
open
(
conf_file
)
y
=
yaml
.
load
(
f
)
...
...
30_rabbitmq.py
View file @
e4ec1291
...
...
@@ -19,7 +19,7 @@ rates = ('ack', 'deliver', 'deliver_get', 'publish')
code
,
num
=
commands
.
getstatusoutput
(
"grep 'beam.smp 15672' /home/n9e/service_port 2>/dev/null|grep -v grep|wc -l"
)
if
code
!=
0
or
int
(
num
)
==
0
:
sys
.
exit
(
0
)
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'|
head -n1|
awk '{print $NF}'`|grep inet|awk '{print $2}'|awk -F ':' '{print $NF}'|head -n 1"
)
if
code
!=
0
:
sys
.
exit
(
0
)
timeout
=
10
p
=
[]
...
...
30_redis.sh
View file @
e4ec1291
...
...
@@ -7,7 +7,7 @@ base_dir=$(cd $(dirname $0);pwd)
cd
$base_dir
ip
=
127.0.0.1
metrics_counter
=(
total_connections_received rejected_connections keyspace_hits keyspace_misses total_commands_processed total_net_input_bytes total_net_output_bytes expired_keys evicted_keys used_cpu_sys used_cpu_user
)
endpoint
=
$(
ifconfig
`
route|grep
'^default'
|awk
'{print $NF}'
`
|grep inet|awk
'{print $2}'
|awk
-F
':'
'{print $NF}'
|head
-n
1
)
endpoint
=
$(
ifconfig
`
route|grep
'^default'
|
head
-n1
|
awk
'{print $NF}'
`
|grep inet|awk
'{print $2}'
|awk
-F
':'
'{print $NF}'
|head
-n
1
)
Json_join
(){
metric
=
$1
...
...
60_linux.sh
View file @
e4ec1291
...
...
@@ -3,7 +3,7 @@ step=$(echo $0|grep -Po '\d+(?=_)')
service_port
=
/home/n9e/service_port
base_dir
=
$(
cd
$(
dirname
$0
)
;
pwd
)
cd
$base_dir
endpoint
=
$(
ifconfig
`
route|grep
'^default'
|awk
'{print $NF}'
`
|grep inet|awk
'{print $2}'
|awk
-F
':'
'{print $NF}'
|head
-n
1
)
endpoint
=
$(
ifconfig
`
route|grep
'^default'
|
head
-n1
|
awk
'{print $NF}'
`
|grep inet|awk
'{print $2}'
|awk
-F
':'
'{print $NF}'
|head
-n
1
)
Json_join
(){
metric
=
$1
...
...
60_linux_cpu.py
View file @
e4ec1291
...
...
@@ -41,7 +41,7 @@ def get_cpu_core_stat(num):
return
data
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'|
head -n1|
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
)
...
...
60_mongodb.py
View file @
e4ec1291
...
...
@@ -67,7 +67,7 @@ step = int(os.path.basename(__file__).split('_')[0])
conf_file
=
os
.
path
.
join
(
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
)),
'mongodb_auth.conf'
)
if
not
os
.
path
.
exists
(
conf_file
):
sys
.
exit
(
0
)
from
mongodb_server
import
mongodbMonitor
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'|
head -n1|
awk '{print $NF}'`|grep inet|awk '{print $2}'|awk -F ':' '{print $NF}'|head -n 1"
)
if
code
!=
0
:
sys
.
exit
(
0
)
f
=
open
(
conf_file
)
y
=
yaml
.
load
(
f
)
...
...
hwcheck_dell.py
View file @
e4ec1291
...
...
@@ -611,7 +611,7 @@ def check(target=False):
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"
)
"ifconfig `route|grep '^default'|
head -n1|
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
)
...
...
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