summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Richter <Felix.Richter@syntax-fehler.de>2011-01-17 16:52:49 +0100
committerFelix Richter <Felix.Richter@syntax-fehler.de>2011-01-17 16:52:49 +0100
commitf95bf3d9f1c824f16205d29db24c5dcc0c5cb288 (patch)
treee6e54664a537eaee5b2babc80cce74e2c874f8c4
parent353dbba3c004a2dfbbbb42bfbc694783d3291716 (diff)
pingy thrown out
-rw-r--r--arping.py25
-rwxr-xr-xsnmp_users.py2
2 files changed, 4 insertions, 23 deletions
diff --git a/arping.py b/arping.py
index 60f271d2..ee96c9aa 100644
--- a/arping.py
+++ b/arping.py
@@ -1,12 +1,12 @@
#!/usr/bin/python2
import logging
-log = logging.getLogger('pingy')
+log = logging.getLogger('arpingy')
import os
try:
if (os.geteuid() != 0):
raise Exception('no root permissions')
- from scapy.all import *
+ from scapy.all import * #might throws "no such module"
def arpingy(iprange="10.42.1.0/24",iface='eth0'):
log.debug("pinging"+ iprange)
@@ -25,26 +25,7 @@ try:
print ("something went wrong while arpinging " + str(e))
return []
- def pingy(ip="10.42.1.0/24",iface='eth0'):
- log.debug("pinging"+ ip)
- """Arping function takes IP Address or Network, returns nested mac/ip list"""
- try:
- conf.verb=0
- ans,unans=srp(Ether()/IP(dst=ip)/ICMP(),timeout=1)
-
- collection = []
- for snd, rcv in ans:
- result = rcv.sprintf(r"%IP.src% %Ether.src%").split()
- log.debug(result)
- collection.append(result)
- return collection
- except Exception as e:
- print ("something went wrong while arpinging " + str(e))
- return []
-
except Exception as e:
- log.error("Cannot Arping!" + str(e))
- def pingy(iprange):
- return True
+ log.error("Cannot load arping functions!" + str(e))
def arpingy(iprange):
return True
diff --git a/snmp_users.py b/snmp_users.py
index df78cc8d..481938d3 100755
--- a/snmp_users.py
+++ b/snmp_users.py
@@ -1,7 +1,7 @@
#!/usr/bin/python2
import subprocess,re
import logging
-from arping import arpingy,pingy
+from arping import arpingy
log = logging.getLogger('snmp_users')
class snmp_users: