Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
picomon
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
glucas
picomon
Commits
f7c75c70
Commit
f7c75c70
authored
May 09, 2014
by
Jonathan Michalon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support basic SMTP command/response check
parent
ce623b03
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
0 deletions
+25
-0
lib/checks.py
lib/checks.py
+25
-0
No files found.
lib/checks.py
View file @
f7c75c70
...
...
@@ -202,3 +202,28 @@ class CheckHTTPS4(CheckHTTPS, Check4):
class
CheckHTTPS6
(
CheckHTTPS
,
Check6
):
pass
class
CheckSMTP
(
Check
):
def
build_command
(
self
):
command
=
[
'/usr/lib/nagios/plugins/check_smtp'
,
'-H'
,
self
.
addr
,
'-f'
,
self
.
_options
.
get
(
'from'
,
'nonexisting@localhost'
),
'-t'
,
'2'
]
if
'command'
in
self
.
_options
:
command
+=
[
'-C'
,
str
(
self
.
_options
[
'command'
])]
if
'response'
in
self
.
_options
:
command
+=
[
'-R'
,
str
(
self
.
_options
[
'response'
])]
return
command
def
check
(
self
):
command
=
self
.
build_command
()
return
self
.
exec_with_timeout
(
command
,
timeout
=
3
)
class
CheckSMTP4
(
CheckSMTP
,
Check4
):
pass
class
CheckSMTP6
(
CheckSMTP
,
Check6
):
pass
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