summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSven Nierlein <sven@nierlein.org>2013-08-15 09:34:27 (GMT)
committerSven Nierlein <sven@nierlein.org>2013-08-15 09:34:27 (GMT)
commit2493c15c285cc2785a43cefc91124292790cd8f7 (patch)
tree0d82271be60d67ce12b4399fcc0fc2f1069e388b
parentbc4ca2b348f9a90290e3f1b7e345981de5c699d1 (diff)
parent93b35b06f953e868de4b79e420c0c967ca78feaf (diff)
downloadmonitoring-plugins-2493c15c285cc2785a43cefc91124292790cd8f7.tar.gz
Merge pull request #40 from avances123/master
updating deprecated imports of check_nmap.py plugin
-rw-r--r--contrib/check_nmap.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/contrib/check_nmap.py b/contrib/check_nmap.py
index 07f6d7f..481a62b 100644
--- a/contrib/check_nmap.py
+++ b/contrib/check_nmap.py
@@ -43,7 +43,7 @@ _version_ = '1.21'
43# 0.20 2000-07-10 jaclu Initial release 43# 0.20 2000-07-10 jaclu Initial release
44 44
45 45
46import sys, os, string, whrandom 46import sys, os, string, random
47 47
48import tempfile 48import tempfile
49from getopt import getopt 49from getopt import getopt
@@ -207,8 +207,7 @@ class CheckNmap:
207 # _if_ two processes in deed get the same tmp-file 207 # _if_ two processes in deed get the same tmp-file
208 # the only result is a normal error message to nagios 208 # the only result is a normal error message to nagios
209 # 209 #
210 r=whrandom.whrandom() 210 self.tmp_file=tempfile.mktemp('.%s') % random.randint(0,100000)
211 self.tmp_file=tempfile.mktemp('.%s')%r.randint(0,100000)
212 if self.debug: 211 if self.debug:
213 print 'Tmpfile is: %s'%self.tmp_file 212 print 'Tmpfile is: %s'%self.tmp_file
214 # 213 #
@@ -388,7 +387,7 @@ Version: %s""" % _version_
388 387
389def doc_syntax(): 388def doc_syntax():
390 print """ 389 print """
391Usage: check_ports [-v|--debug] [-H|--host host] [-V|--version] [-h|--help] 390Usage: check_nmap.py [-v|--debug] [-H|--host host] [-V|--version] [-h|--help]
392 [-o|--optional port1,port2,port3 ...] [-r|--range range] 391 [-o|--optional port1,port2,port3 ...] [-r|--range range]
393 [-p|--port port1,port2,port3 ...] [-t|--timeout timeout]""" 392 [-p|--port port1,port2,port3 ...] [-t|--timeout timeout]"""
394 393