Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
蜕变的菜鸟
glances
提交
5252eab9
G
glances
项目概览
蜕变的菜鸟
/
glances
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
glances
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
5252eab9
编写于
6月 25, 2014
作者:
N
Nicolargo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Improve Windows SNMP get
上级
1820a200
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
147 addition
and
33 deletion
+147
-33
glances/core/glances_stats.py
glances/core/glances_stats.py
+39
-2
glances/plugins/glances_cpu.py
glances/plugins/glances_cpu.py
+7
-5
glances/plugins/glances_fs.py
glances/plugins/glances_fs.py
+44
-15
glances/plugins/glances_load.py
glances/plugins/glances_load.py
+1
-1
glances/plugins/glances_network.py
glances/plugins/glances_network.py
+21
-6
glances/plugins/glances_plugin.py
glances/plugins/glances_plugin.py
+9
-1
glances/plugins/glances_system.py
glances/plugins/glances_system.py
+26
-3
未找到文件。
glances/core/glances_stats.py
浏览文件 @
5252eab9
...
@@ -22,9 +22,17 @@
...
@@ -22,9 +22,17 @@
import
collections
import
collections
import
os
import
os
import
sys
import
sys
import
re
from
glances.core.glances_globals
import
plugins_path
,
sys_path
from
glances.core.glances_globals
import
plugins_path
,
sys_path
# SNMP OID regexp pattern to short system name dict
oid_to_short_system_name
=
{
'.*Linux.*'
:
'linux'
,
'.*BSD.*'
:
'bsd'
,
'.*Darwin.*'
:
'mac'
,
'.*Windows.*'
:
'windows'
,
'.*Cisco.*'
:
'cisco'
}
class
GlancesStats
(
object
):
class
GlancesStats
(
object
):
...
@@ -203,6 +211,9 @@ class GlancesStatsClientSNMP(GlancesStats):
...
@@ -203,6 +211,9 @@ class GlancesStatsClientSNMP(GlancesStats):
# Init the arguments
# Init the arguments
self
.
args
=
args
self
.
args
=
args
# OS name is used because OID is differents between system
self
.
os_name
=
None
# Load plugins
# Load plugins
self
.
load_plugins
(
args
=
self
.
args
)
self
.
load_plugins
(
args
=
self
.
args
)
...
@@ -219,14 +230,40 @@ class GlancesStatsClientSNMP(GlancesStats):
...
@@ -219,14 +230,40 @@ class GlancesStatsClientSNMP(GlancesStats):
user
=
self
.
args
.
snmp_user
,
user
=
self
.
args
.
snmp_user
,
auth
=
self
.
args
.
snmp_auth
)
auth
=
self
.
args
.
snmp_auth
)
return
clientsnmp
.
get_by_oid
(
"1.3.6.1.2.1.1.5.0"
)
!=
{}
# If we can not grab the hostname, then exit...
ret
=
clientsnmp
.
get_by_oid
(
"1.3.6.1.2.1.1.5.0"
)
!=
{}
if
ret
:
# Get the OS name (need to grab the good OID...)
oid_os_name
=
clientsnmp
.
get_by_oid
(
"1.3.6.1.2.1.1.1.0"
)
try
:
self
.
system_name
=
self
.
get_system_name
(
oid_os_name
[
'1.3.6.1.2.1.1.1.0'
])
except
KeyError
:
self
.
system_name
=
None
return
ret
def
get_system_name
(
self
,
oid_system_name
):
"""Get the short os name from the OS name OID string"""
short_system_name
=
None
if
oid_system_name
==
''
:
return
short_system_name
# Find the short name in the oid_to_short_os_name dict
for
r
,
v
in
oid_to_short_system_name
.
iteritems
():
if
re
.
search
(
r
,
oid_system_name
):
short_system_name
=
v
break
return
short_system_name
def
update
(
self
):
def
update
(
self
):
"""Update the stats using SNMP."""
"""Update the stats using SNMP."""
# For each plugins, call the update method
# For each plugins, call the update method
for
p
in
self
.
_plugins
:
for
p
in
self
.
_plugins
:
# Set the input method to SNMP
# Set the input method to SNMP
self
.
_plugins
[
p
].
set_input
(
'snmp'
)
self
.
_plugins
[
p
].
set_input
(
'snmp'
,
self
.
system_name
)
# print "DEBUG: Update %s stats using SNMP request" % p
# print "DEBUG: Update %s stats using SNMP request" % p
try
:
try
:
self
.
_plugins
[
p
].
update
()
self
.
_plugins
[
p
].
update
()
...
...
glances/plugins/glances_cpu.py
浏览文件 @
5252eab9
...
@@ -27,10 +27,9 @@ import psutil
...
@@ -27,10 +27,9 @@ import psutil
# percentage of user CPU time: .1.3.6.1.4.1.2021.11.9.0
# percentage of user CPU time: .1.3.6.1.4.1.2021.11.9.0
# percentages of system CPU time: .1.3.6.1.4.1.2021.11.10.0
# percentages of system CPU time: .1.3.6.1.4.1.2021.11.10.0
# percentages of idle CPU time: .1.3.6.1.4.1.2021.11.11.0
# percentages of idle CPU time: .1.3.6.1.4.1.2021.11.11.0
snmp_oid
=
{
'user'
:
'1.3.6.1.4.1.2021.11.9.0'
,
snmp_oid
=
{
'default'
:
{
'user'
:
'1.3.6.1.4.1.2021.11.9.0'
,
'system'
:
'1.3.6.1.4.1.2021.11.10.0'
,
'system'
:
'1.3.6.1.4.1.2021.11.10.0'
,
'idle'
:
'1.3.6.1.4.1.2021.11.11.0'
}
'idle'
:
'1.3.6.1.4.1.2021.11.11.0'
}}
class
Plugin
(
GlancesPlugin
):
class
Plugin
(
GlancesPlugin
):
...
@@ -91,7 +90,10 @@ class Plugin(GlancesPlugin):
...
@@ -91,7 +90,10 @@ class Plugin(GlancesPlugin):
self
.
stats
[
cpu
]
=
getattr
(
cputimespercent
,
cpu
)
self
.
stats
[
cpu
]
=
getattr
(
cputimespercent
,
cpu
)
elif
self
.
get_input
()
==
'snmp'
:
elif
self
.
get_input
()
==
'snmp'
:
# Update stats using SNMP
# Update stats using SNMP
self
.
stats
=
self
.
set_stats_snmp
(
snmp_oid
=
snmp_oid
)
try
:
self
.
stats
=
self
.
set_stats_snmp
(
snmp_oid
=
snmp_oid
[
self
.
get_short_system_name
()])
except
KeyError
:
self
.
stats
=
self
.
set_stats_snmp
(
snmp_oid
=
snmp_oid
[
'default'
])
if
self
.
stats
[
'user'
]
==
''
:
if
self
.
stats
[
'user'
]
==
''
:
self
.
reset
()
self
.
reset
()
...
...
glances/plugins/glances_fs.py
浏览文件 @
5252eab9
...
@@ -19,6 +19,8 @@
...
@@ -19,6 +19,8 @@
"""File system plugin."""
"""File system plugin."""
import
base64
from
glances.plugins.glances_plugin
import
GlancesPlugin
from
glances.plugins.glances_plugin
import
GlancesPlugin
import
psutil
import
psutil
...
@@ -37,11 +39,15 @@ import psutil
...
@@ -37,11 +39,15 @@ import psutil
# Used space on the disk: .1.3.6.1.4.1.2021.9.1.8.1
# Used space on the disk: .1.3.6.1.4.1.2021.9.1.8.1
# Percentage of space used on disk: .1.3.6.1.4.1.2021.9.1.9.1
# Percentage of space used on disk: .1.3.6.1.4.1.2021.9.1.9.1
# Percentage of inodes used on disk: .1.3.6.1.4.1.2021.9.1.10.1
# Percentage of inodes used on disk: .1.3.6.1.4.1.2021.9.1.10.1
snmp_oid
=
{
'mnt_point'
:
'1.3.6.1.4.1.2021.9.1.2'
,
snmp_oid
=
{
'default'
:
{
'mnt_point'
:
'1.3.6.1.4.1.2021.9.1.2'
,
'device_name'
:
'1.3.6.1.4.1.2021.9.1.3'
,
'device_name'
:
'1.3.6.1.4.1.2021.9.1.3'
,
'size'
:
'1.3.6.1.4.1.2021.9.1.6'
,
'size'
:
'1.3.6.1.4.1.2021.9.1.6'
,
'used'
:
'1.3.6.1.4.1.2021.9.1.8'
,
'used'
:
'1.3.6.1.4.1.2021.9.1.8'
,
'percent'
:
'1.3.6.1.4.1.2021.9.1.9'
}
'percent'
:
'1.3.6.1.4.1.2021.9.1.9'
},
'windows'
:
{
'mnt_point'
:
'1.3.6.1.2.1.25.2.3.1.3'
,
'alloc_unit'
:
'1.3.6.1.2.1.25.2.3.1.4'
,
'size'
:
'1.3.6.1.2.1.25.2.3.1.5'
,
'used'
:
'1.3.6.1.2.1.25.2.3.1.6'
}}
class
Plugin
(
GlancesPlugin
):
class
Plugin
(
GlancesPlugin
):
...
@@ -110,17 +116,38 @@ class Plugin(GlancesPlugin):
...
@@ -110,17 +116,38 @@ class Plugin(GlancesPlugin):
# Update stats using SNMP
# Update stats using SNMP
# SNMP bulk command to get all file system in one shot
# SNMP bulk command to get all file system in one shot
fs_stat
=
self
.
set_stats_snmp
(
snmp_oid
=
snmp_oid
,
bulk
=
True
)
try
:
fs_stat
=
self
.
set_stats_snmp
(
snmp_oid
=
snmp_oid
[
self
.
get_short_system_name
()],
bulk
=
True
)
except
KeyError
:
fs_stat
=
self
.
set_stats_snmp
(
snmp_oid
=
snmp_oid
[
'default'
],
bulk
=
True
)
# Loop over fs
# Loop over fs
for
fs
in
fs_stat
:
if
self
.
get_short_system_name
()
==
'windows'
:
fs_current
=
{}
# Windows tips
fs_current
[
'device_name'
]
=
fs_stat
[
fs
][
'device_name'
]
for
fs
in
fs_stat
:
fs_current
[
'mnt_point'
]
=
fs
# Memory stats are grabed in the same OID table (ignore it)
fs_current
[
'size'
]
=
int
(
fs_stat
[
fs
][
'size'
])
*
1024
if
fs
==
'Virtual Memory'
or
fs
==
'Physical Memory'
:
fs_current
[
'used'
]
=
int
(
fs_stat
[
fs
][
'used'
])
*
1024
continue
fs_current
[
'percent'
]
=
float
(
fs_stat
[
fs
][
'percent'
])
fs_current
=
{}
self
.
stats
.
append
(
fs_current
)
fs_current
[
'device_name'
]
=
''
fs_current
[
'mnt_point'
]
=
fs
.
partition
(
' '
)[
0
]
fs_current
[
'size'
]
=
int
(
fs_stat
[
fs
][
'size'
])
*
int
(
fs_stat
[
fs
][
'alloc_unit'
])
fs_current
[
'used'
]
=
int
(
fs_stat
[
fs
][
'used'
])
*
int
(
fs_stat
[
fs
][
'alloc_unit'
])
fs_current
[
'percent'
]
=
float
(
fs_current
[
'used'
]
*
100
/
fs_current
[
'size'
])
self
.
stats
.
append
(
fs_current
)
else
:
# Default behavor
for
fs
in
fs_stat
:
fs_current
=
{}
fs_current
[
'device_name'
]
=
fs_stat
[
fs
][
'device_name'
]
fs_current
[
'mnt_point'
]
=
fs
fs_current
[
'size'
]
=
int
(
fs_stat
[
fs
][
'size'
])
*
1024
fs_current
[
'used'
]
=
int
(
fs_stat
[
fs
][
'used'
])
*
1024
fs_current
[
'percent'
]
=
float
(
fs_stat
[
fs
][
'percent'
])
self
.
stats
.
append
(
fs_current
)
return
self
.
stats
return
self
.
stats
...
@@ -146,7 +173,9 @@ class Plugin(GlancesPlugin):
...
@@ -146,7 +173,9 @@ class Plugin(GlancesPlugin):
for
i
in
sorted
(
self
.
stats
,
key
=
lambda
fs
:
fs
[
'mnt_point'
]):
for
i
in
sorted
(
self
.
stats
,
key
=
lambda
fs
:
fs
[
'mnt_point'
]):
# New line
# New line
ret
.
append
(
self
.
curse_new_line
())
ret
.
append
(
self
.
curse_new_line
())
if
len
(
i
[
'mnt_point'
])
+
len
(
i
[
'device_name'
].
split
(
'/'
)[
-
1
])
<=
6
:
if
i
[
'device_name'
]
==
''
:
mnt_point
=
i
[
'mnt_point'
]
elif
len
(
i
[
'mnt_point'
])
+
len
(
i
[
'device_name'
].
split
(
'/'
)[
-
1
])
<=
6
:
# If possible concatenate mode info... Glances touch inside :)
# If possible concatenate mode info... Glances touch inside :)
mnt_point
=
i
[
'mnt_point'
]
+
' ('
+
i
[
'device_name'
].
split
(
'/'
)[
-
1
]
+
')'
mnt_point
=
i
[
'mnt_point'
]
+
' ('
+
i
[
'device_name'
].
split
(
'/'
)[
-
1
]
+
')'
elif
len
(
i
[
'mnt_point'
])
>
9
:
elif
len
(
i
[
'mnt_point'
])
>
9
:
...
...
glances/plugins/glances_load.py
浏览文件 @
5252eab9
...
@@ -116,7 +116,7 @@ class Plugin(GlancesPlugin):
...
@@ -116,7 +116,7 @@ class Plugin(GlancesPlugin):
ret
.
append
(
self
.
curse_add_line
(
msg
,
"TITLE"
))
ret
.
append
(
self
.
curse_add_line
(
msg
,
"TITLE"
))
# Core number
# Core number
if
self
.
stats
[
'cpucore'
]
>
0
:
if
self
.
stats
[
'cpucore'
]
>
0
:
msg
=
_
(
"{0
}-core"
).
format
(
self
.
stats
[
'cpucore'
]
,
'>1'
)
msg
=
_
(
"{0
:d}-core"
).
format
(
int
(
self
.
stats
[
'cpucore'
])
,
'>1'
)
ret
.
append
(
self
.
curse_add_line
(
msg
))
ret
.
append
(
self
.
curse_add_line
(
msg
))
# New line
# New line
ret
.
append
(
self
.
curse_new_line
())
ret
.
append
(
self
.
curse_new_line
())
...
...
glances/plugins/glances_network.py
浏览文件 @
5252eab9
...
@@ -19,6 +19,8 @@
...
@@ -19,6 +19,8 @@
"""Network plugin."""
"""Network plugin."""
import
base64
from
glances.core.glances_timer
import
getTimeSinceLastUpdate
from
glances.core.glances_timer
import
getTimeSinceLastUpdate
from
glances.plugins.glances_plugin
import
GlancesPlugin
from
glances.plugins.glances_plugin
import
GlancesPlugin
...
@@ -27,9 +29,9 @@ import psutil
...
@@ -27,9 +29,9 @@ import psutil
# SNMP OID
# SNMP OID
# http://www.net-snmp.org/docs/mibs/interfaces.html
# http://www.net-snmp.org/docs/mibs/interfaces.html
# Dict key = interface_name
# Dict key = interface_name
snmp_oid
=
{
'interface_name'
:
'1.3.6.1.2.1.2.2.1.2'
,
snmp_oid
=
{
'
default'
:
{
'
interface_name'
:
'1.3.6.1.2.1.2.2.1.2'
,
'cumulative_rx'
:
'1.3.6.1.2.1.2.2.1.10'
,
'cumulative_rx'
:
'1.3.6.1.2.1.2.2.1.10'
,
'cumulative_tx'
:
'1.3.6.1.2.1.2.2.1.16'
}
'cumulative_tx'
:
'1.3.6.1.2.1.2.2.1.16'
}
}
class
Plugin
(
GlancesPlugin
):
class
Plugin
(
GlancesPlugin
):
...
@@ -94,7 +96,7 @@ class Plugin(GlancesPlugin):
...
@@ -94,7 +96,7 @@ class Plugin(GlancesPlugin):
for
net
in
network_new
:
for
net
in
network_new
:
try
:
try
:
# Try necessary to manage dynamic network interface
# Try necessary to manage dynamic network interface
netstat
=
{}
netstat
=
{}
netstat
[
'interface_name'
]
=
net
netstat
[
'interface_name'
]
=
net
netstat
[
'time_since_update'
]
=
time_since_update
netstat
[
'time_since_update'
]
=
time_since_update
netstat
[
'cumulative_rx'
]
=
network_new
[
net
].
bytes_recv
netstat
[
'cumulative_rx'
]
=
network_new
[
net
].
bytes_recv
...
@@ -118,7 +120,12 @@ class Plugin(GlancesPlugin):
...
@@ -118,7 +120,12 @@ class Plugin(GlancesPlugin):
# Update stats using SNMP
# Update stats using SNMP
# SNMP bulk command to get all network interface in one shot
# SNMP bulk command to get all network interface in one shot
netiocounters
=
self
.
set_stats_snmp
(
snmp_oid
=
snmp_oid
,
bulk
=
True
)
try
:
netiocounters
=
self
.
set_stats_snmp
(
snmp_oid
=
snmp_oid
[
self
.
get_short_system_name
()],
bulk
=
True
)
except
KeyError
:
netiocounters
=
self
.
set_stats_snmp
(
snmp_oid
=
snmp_oid
[
'default'
],
bulk
=
True
)
# Previous network interface stats are stored in the network_old variable
# Previous network interface stats are stored in the network_old variable
if
not
hasattr
(
self
,
'network_old'
):
if
not
hasattr
(
self
,
'network_old'
):
...
@@ -138,7 +145,15 @@ class Plugin(GlancesPlugin):
...
@@ -138,7 +145,15 @@ class Plugin(GlancesPlugin):
try
:
try
:
# Try necessary to manage dynamic network interface
# Try necessary to manage dynamic network interface
netstat
=
{}
netstat
=
{}
netstat
[
'interface_name'
]
=
net
# Windows: a tips is needed to convert HEX to TXT
# http://blogs.technet.com/b/networking/archive/2009/12/18/how-to-query-the-list-of-network-interfaces-using-snmp-via-the-ifdescr-counter.aspx
if
self
.
get_short_system_name
()
==
'windows'
:
try
:
netstat
[
'interface_name'
]
=
str
(
base64
.
b16decode
(
net
[
2
:
-
2
].
upper
()))
except
TypeError
:
netstat
[
'interface_name'
]
=
net
else
:
netstat
[
'interface_name'
]
=
net
netstat
[
'time_since_update'
]
=
time_since_update
netstat
[
'time_since_update'
]
=
time_since_update
netstat
[
'cumulative_rx'
]
=
float
(
network_new
[
net
][
'cumulative_rx'
])
netstat
[
'cumulative_rx'
]
=
float
(
network_new
[
net
][
'cumulative_rx'
])
netstat
[
'rx'
]
=
(
float
(
network_new
[
net
][
'cumulative_rx'
])
-
netstat
[
'rx'
]
=
(
float
(
network_new
[
net
][
'cumulative_rx'
])
-
...
...
glances/plugins/glances_plugin.py
浏览文件 @
5252eab9
...
@@ -44,6 +44,7 @@ class GlancesPlugin(object):
...
@@ -44,6 +44,7 @@ class GlancesPlugin(object):
# Init the input method
# Init the input method
self
.
input_method
=
'local'
self
.
input_method
=
'local'
self
.
short_system_name
=
None
# Init the stats list
# Init the stats list
self
.
stats
=
None
self
.
stats
=
None
...
@@ -59,20 +60,27 @@ class GlancesPlugin(object):
...
@@ -59,20 +60,27 @@ class GlancesPlugin(object):
"""Return the human-readable stats."""
"""Return the human-readable stats."""
return
str
(
self
.
stats
)
return
str
(
self
.
stats
)
def
set_input
(
self
,
input_method
):
def
set_input
(
self
,
input_method
,
short_system_name
=
None
):
"""Set the input method.
"""Set the input method.
* local: system local grab (psutil or direct access)
* local: system local grab (psutil or direct access)
* snmp: Client server mode via SNMP
* snmp: Client server mode via SNMP
* glances: Client server mode via Glances API
* glances: Client server mode via Glances API
For SNMP, short_system_name is detected short OS name
"""
"""
self
.
input_method
=
input_method
self
.
input_method
=
input_method
self
.
short_system_name
=
short_system_name
return
self
.
input_method
return
self
.
input_method
def
get_input
(
self
):
def
get_input
(
self
):
"""Get the input method."""
"""Get the input method."""
return
self
.
input_method
return
self
.
input_method
def
get_short_system_name
(
self
):
"""Get the short detected OS name"""
return
self
.
short_system_name
def
set_stats
(
self
,
input_stats
):
def
set_stats
(
self
,
input_stats
):
"""Set the stats to input_stats."""
"""Set the stats to input_stats."""
self
.
stats
=
input_stats
self
.
stats
=
input_stats
...
...
glances/plugins/glances_system.py
浏览文件 @
5252eab9
...
@@ -22,13 +22,25 @@
...
@@ -22,13 +22,25 @@
# Import system libs
# Import system libs
import
os
import
os
import
platform
import
platform
import
re
# Import Glances libs
# Import Glances libs
from
glances.plugins.glances_plugin
import
GlancesPlugin
from
glances.plugins.glances_plugin
import
GlancesPlugin
# SNMP OID
# SNMP OID
snmp_oid
=
{
'hostname'
:
'1.3.6.1.2.1.1.5.0'
,
snmp_oid
=
{
'default'
:
{
'hostname'
:
'1.3.6.1.2.1.1.5.0'
,
'os_name'
:
'1.3.6.1.2.1.1.1.0'
}
'system_name'
:
'1.3.6.1.2.1.1.1.0'
}}
# SNMP to human read
# Dict (key: OS short name) of dict (reg exp OID to human)
# Windows: http://msdn.microsoft.com/en-us/library/windows/desktop/ms724832%28v=vs.85%29.aspx
snmp_to_human
=
{
'windows'
:
{
'Windows Version 6.3'
:
'Windows 8.1 or Server 2012R2'
,
'Windows Version 6.2'
:
'Windows 8 or Server 2012'
,
'Windows Version 6.1'
:
'Windows 7 or Server 2008R2'
,
'Windows Version 6.0'
:
'Windows Vista or Server 2008'
,
'Windows Version 5.2'
:
'Windows XP 64bits or 2003 server'
,
'Windows Version 5.1'
:
'Windows XP'
,
'Windows Version 5.0'
:
'Windows 2000'
}}
class
Plugin
(
GlancesPlugin
):
class
Plugin
(
GlancesPlugin
):
...
@@ -90,7 +102,18 @@ class Plugin(GlancesPlugin):
...
@@ -90,7 +102,18 @@ class Plugin(GlancesPlugin):
self
.
stats
[
'os_version'
]
=
""
self
.
stats
[
'os_version'
]
=
""
elif
self
.
get_input
()
==
'snmp'
:
elif
self
.
get_input
()
==
'snmp'
:
# Update stats using SNMP
# Update stats using SNMP
self
.
stats
=
self
.
set_stats_snmp
(
snmp_oid
=
snmp_oid
)
try
:
self
.
stats
=
self
.
set_stats_snmp
(
snmp_oid
=
snmp_oid
[
self
.
get_short_system_name
()])
except
KeyError
:
self
.
stats
=
self
.
set_stats_snmp
(
snmp_oid
=
snmp_oid
[
'default'
])
# Default behavor: display all the information
self
.
stats
[
'os_name'
]
=
self
.
stats
[
'system_name'
]
# Windows OS tips
if
self
.
get_short_system_name
()
==
'windows'
:
for
r
,
v
in
snmp_to_human
[
'windows'
].
iteritems
():
if
re
.
search
(
r
,
self
.
stats
[
'system_name'
]):
self
.
stats
[
'os_name'
]
=
v
break
return
self
.
stats
return
self
.
stats
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录