Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Monitoring
FeM Nagios Plugins
Commits
c6bbb9ae
Unverified
Commit
c6bbb9ae
authored
Mar 17, 2022
by
Adrian Schollmeyer
Browse files
check_net_traffic: Add additional perfdata
parent
db727870
Changes
1
Hide whitespace changes
Inline
Side-by-side
check_net_traffic
View file @
c6bbb9ae
...
...
@@ -51,7 +51,11 @@ def parse_net_stats(data):
fields
=
re
.
split
(
"\s+"
,
data
[
i
].
strip
())
results
[
fields
[
0
][:
-
1
]]
=
{
"rbytes"
:
int
(
fields
[
1
]),
"tbytes"
:
int
(
fields
[
9
])
"tbytes"
:
int
(
fields
[
9
]),
"r_errs"
:
int
(
fields
[
3
]),
"t_errs"
:
int
(
fields
[
11
]),
"r_dropped"
:
int
(
fields
[
4
]),
"t_dropped"
:
int
(
fields
[
12
])
}
return
results
...
...
@@ -73,6 +77,10 @@ def get_perfdata(results, diff):
for
name
,
value
in
results
.
items
():
perfdata
+=
" {:}_rx={:.2f}B"
.
format
(
name
,
value
[
"rbytes"
])
perfdata
+=
" {:}_tx={:.2f}B"
.
format
(
name
,
value
[
"tbytes"
])
perfdata
+=
f
"
{
name
}
_rx_errs=
{
value
[
'r_errs'
]
}
"
perfdata
+=
f
"
{
name
}
_tx_errs=
{
value
[
't_errs'
]
}
"
perfdata
+=
f
"
{
name
}
_rx_dropped=
{
value
[
'r_dropped'
]
}
"
perfdata
+=
f
"
{
name
}
_tx_dropped=
{
value
[
't_dropped'
]
}
"
return
perfdata
# nagios compatible exit
...
...
Write
Preview
Supports
Markdown
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