Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
picomon
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Colomban Wendling
picomon
Commits
15d2cd21
Commit
15d2cd21
authored
Apr 25, 2014
by
Jonathan Michalon
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'b4n/picomon-no-ipy'
parents
c010b729
b1a9b282
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
5 deletions
+7
-5
README.md
README.md
+1
-2
picomon.py
picomon.py
+6
-3
No files found.
README.md
View file @
15d2cd21
...
...
@@ -7,6 +7,5 @@ Dependencies
------------
Written in Python, it needs at least python 3.2 for the ThreadPools.
It also depends on
`ipy`
, a module for managing IP addresses.
On debian Wheezy the package
s are
`python3`
and
`python3-ipy
`
.
On debian Wheezy the package
is
`python3
`
.
picomon.py
View file @
15d2cd21
import
concurrent.futures
from
time
import
sleep
from
IPy
import
IP
from
sys
import
hexversion
as
sys_hexversion
...
...
@@ -14,7 +13,7 @@ else:
import
subprocess
from
subprocess
import
PIPE
class
TimeoutExpired
(
subprocess
.
Subp
rocessError
):
class
TimeoutExpired
(
subprocess
.
CalledP
rocessError
):
def
__init__
(
self
,
args
,
timeout
=
None
,
output
=
None
):
self
.
cmd
,
self
.
timeout
,
self
.
output
=
args
,
timeout
,
output
...
...
@@ -61,6 +60,10 @@ else:
return
self
.
_out
,
self
.
_err
def
ip_version
(
addr
):
return
6
if
':'
in
addr
else
4
class
Check
(
object
):
def
__init__
(
self
,
**
options
):
self
.
_options
=
options
...
...
@@ -108,7 +111,7 @@ class Check(object):
return
p
.
returncode
==
0
def
exec_by_ip_family
(
self
,
addr
,
v4command
,
v6command
):
ipv
=
IP
(
addr
)
.
version
(
)
ipv
=
ip_version
(
addr
)
if
ipv
==
4
:
return
self
.
exec_with_timeout
(
v4command
)
if
ipv
==
6
:
...
...
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