summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorroot <root@krebs>2011-05-24 22:27:31 +0200
committerroot <root@krebs>2011-05-24 22:27:31 +0200
commit843b62b3ea1923eeb50d73a2bc260800ebec6213 (patch)
tree0fb8a7078c6df1b177f205acb0b172f2f4b0be23 /modules
parentb3d53f4d088b8abacd95541283ce9229012e736b (diff)
fixed arping
Diffstat (limited to 'modules')
-rwxr-xr-xmodules/people/src/arping.py2
-rwxr-xr-xmodules/people/src/arping_users.py12
2 files changed, 9 insertions, 5 deletions
diff --git a/modules/people/src/arping.py b/modules/people/src/arping.py
index eea176e0..1b51ab1b 100755
--- a/modules/people/src/arping.py
+++ b/modules/people/src/arping.py
@@ -14,7 +14,7 @@ try:
log.debug("pinging "+ str(iprange))
"""Arping function takes IP Address or Network, returns nested mac/ip list"""
try:
- conf.verb=1
+ conf.verb=0
ans,unans=arping(iprange,iface=iface,timeout=1,retry=3)
collection = []
diff --git a/modules/people/src/arping_users.py b/modules/people/src/arping_users.py
index d6f6826e..9dd95749 100755
--- a/modules/people/src/arping_users.py
+++ b/modules/people/src/arping_users.py
@@ -1,14 +1,16 @@
#!/usr/bin/python
-import subprocess,re,logging
+import subprocess,re,logging,sys
from arping import arpingy
from multiprocessing import Pool
-
DEV='eth0'
MAC_NAMES='mac_names.lst'
data = []
ret = {}
-exit (0)
+verb = False
+
+if len(sys.argv) > 1 and sys.argv[1] == 'v':
+ verb = True
def get_own_addr():
data = subprocess.Popen(['/sbin/ifconfig',DEV],
stdout=subprocess.PIPE).communicate()[0].replace('\n','')
@@ -27,7 +29,7 @@ def load_names(MAC_NAMES):
def arping_helper(dic):
return arpingy(**dic)
-for first in range(3):
+for first in range(4):
for second in range(255):
data.append({'iprange':'10.42.'+str(first)+'.'+str(second),'iface':DEV})
@@ -44,5 +46,7 @@ except:
for p in ret:
+ if verb:
+ print p[0] + " => " + p[1]
if p[1] in names:
print names[p[1]]+ " is online"