Nagios Exchange Nagios Exchange
  • Home
  • Directory
  • Library
  • Support
  • About
  • Submit Feedback

Advanced Search

Build precise queries to find exactly what you need

Search Logic

Select compatible versions

Press ESC to close

Sign In Sign Up

Nagios World Conference 2026: Sept. 14-17 in St. Paul, MN | Learn More

  • Home
  • Directory
  • Library
  • Support
  • About
  • Submit Feedback
Plugins4406Themes and Skins13Add-ons760Graphics and Logos36View All Categories
LinuxSecuritySNMPFile SystemCloud
New Listings Recently Updated Listings Most Favored Listings Most Popular Listings Most Rated Listings Most Reviewed Listings
Random Project
Network Connections, Stats and Bandwidth check_iftraffic43a.pl
5.0 (2)
78.6K
RSS Feed
Newest Listings Updated Listings
Top Contributors
deskwork_itunes142 (4)Chad Columbus (3)Marcin Bednarski (3)Davide Lemma (3)Sam N (2)
See More
Newest Contributors
pawal (1)matthewducey (1)Linuxfabrik (1)signalgrid (1)Sanna Glue (2)
See More

Copyright © 2009-2026 Nagios Enterprises, LLC. All rights reserved.

Privacy PolicyTerms of UseTrademarks
Home > jacek duma
jd

jacek duma

@jdcontrib

User Stats

Member Since: November 4, 2016

Favorites0

Views

Projects0

No Projects Found
Threaded Python multiple ports scanner

I added new modification to the plugin. I needed it.

Better timeout control (default was 127 sec), and added performance data output for future analysis. #!/usr/bin/python """ Threaded Python multiple port scanner """ import threading import socket import time import getopt import sys def usage(): print "Usage: %s -H [-w ] [-c ] -p """ % (sys.argv[0]) try: optlist, args = getopt.getopt(sys.argv[1:], 'H:w:c:p:h') except getopt.GetoptError: usage() sys.exit(2) server = None warning = 5 # defaul value critical = 10 # default value ports = None perfmon = " | " msg = "" exit_code = 0; for opt, arg in optlist: if opt == '-h': usage() sys.exit(2) if opt == '-H': server = arg if opt == '-p': ports = arg if opt == '-w': warning = int(arg) if opt == '-c': critical = int(arg) timeout = critical if ports == None or server == None: print "Server or ports not entered." usage() sys.exit(2) def check_port(server,port): global perfmon global msg global exit_code s = socket.socket() s.settimeout(timeout) start_time = time.time() if s.connect_ex((server,port)) == 0: time_value = time.time() - start_time perfmon += "port%s=%.6fs;;;0.000000;0.000000 " % (port,time_value) ports_opened.append(port) # check opening time and decide - warning or critical if time_value > critical: msg += " Time is CRITICAL %ss for port %s " % (time_value,port) exit_code = 2 if time_value > warning and time_value

Reviewed 10 years ago

No Favorites Found

Copyright © 2009-2026 Nagios Enterprises, LLC. All rights reserved.

Privacy PolicyTerms of UseTrademarks
Home Browse Submit Profile