Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 993515
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T06:26:07+00:00 2026-05-16T06:26:07+00:00

Is there a way to monitor server ports using SNMP (I’m using net-snmp-python to

  • 0

Is there a way to monitor server ports using SNMP (I’m using net-snmp-python to check this with python).
So far I’ve checked pretty simple with “nc” command, however I want to see if I can do this with SNMP.

Thank you for your answers and patience.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T06:26:08+00:00Added an answer on May 16, 2026 at 6:26 am

    Well if you want to use SNMP to see exactly what ports are listening, you should be able to use the following OIDS and walk the table

      "1.3.6.1.2.1.6.13.1.1" tcpConnState 
      "1.3.6.1.2.1.7.5.1.1"  udpLocalAddress
    

    Walking UDP would give you something like this:

    snmpwalk -cpublic 192.168.1.13 1.3.6.1.2.1.7.5.1.1                                                    
       UDP-MIB::udpLocalAddress.0.0.0.0.68 = IpAddress: 0.0.0.0
       UDP-MIB::udpLocalAddress.0.0.0.0.161 = IpAddress: 0.0.0.0
       UDP-MIB::udpLocalAddress.0.0.0.0.32908 = IpAddress: 0.0.0.0
       UDP-MIB::udpLocalAddress.0.0.0.0.33281 = IpAddress: 0.0.0.0
       UDP-MIB::udpLocalAddress.0.0.0.0.33795 = IpAddress: 0.0.0.0
       UDP-MIB::udpLocalAddress.0.0.0.0.34822 = IpAddress: 0.0.0.0
       UDP-MIB::udpLocalAddress.0.0.0.0.44782 = IpAddress: 0.0.0.0
       UDP-MIB::udpLocalAddress.192.168.1.13.9950 = IpAddress: 192.168.1.13
    

    and TCP like:

    snmpwalk -cpublic 192.168.1.13 1.3.6.1.2.1.6.13.1.1                                                   
       TCP-MIB::tcpConnState.0.0.0.0.21.0.0.0.0.0 = INTEGER: listen(2)
       TCP-MIB::tcpConnState.0.0.0.0.23.0.0.0.0.0 = INTEGER: listen(2)
       TCP-MIB::tcpConnState.0.0.0.0.80.0.0.0.0.0 = INTEGER: listen(2)
    

    Walking the tables will show you what ports are listening, and could provide you with some information.

    Now if you just want to check to see if specific ports that you listed in your question are listening you can use the following OIDS to check.

    ftp -- 1.3.6.1.2.1.6.13.1.1.0.0.0.0.21.0.0.0.0.0
    ssh -- 1.3.6.1.2.1.6.13.1.1.0.0.0.0.22.0.0.0.0.0
    http --  1.3.6.1.2.1.6.13.1.1.0.0.0.0.80.0.0.0.0.0
    https -- 1.3.6.1.2.1.6.13.1.1.0.0.0.0.443.0.0.0.0.0
    bind -- 1.3.6.1.2.1.7.5.1.1.0.0.0.0.53 
    

    the above OIDS assume that the server is bound to the default address (0.0.0.0). But they could be bound to the server IP address only (depends on config). In that case assuming your Server IP is 192.168.10.1 you would get

    1.3.6.1.2.1.7.5.1.1.192.168.10.1.53  for bind
    

    so all that being said I think if you wanted to tell if http was listening on the default address on host 192.168.10.1, using the python net snmp bindings you would have something like this.

    import netsnmp
    oid = netsmp.Varbind('1.3.6.1.2.1.6.13.1.1.0.0.0.0.80.0.0.0.0.0')
    result = netsnmp.snmp(oid,
                          Version = 2,
                          DestHost="192.168.10.1",
                          Community="public")
    

    I am not 100% sure if the Varbind is required as I don’t do any snmp stuff in python,and some examples I found had it, and some didn’t. But try it either way. in the above query, if the server isn’t listening it will return a no such OID, if it is open and listening result should Integer(2).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a way to measure or monitor how much of the server's CPU
Is there a way to monitor a gmail account using imaplib without polling gmail
Is there a way to monitor (log) the reason for restarting of an ASP.NET
Is there any way to monitor the availability of a domain, when the server
Is there a way to run New Relic Server Monitor with Google App Engine
Is there any way, using C#, to monitor a specific file then change its
Is there a way to monitor the size of the cache on your web
Is there a way to monitor queries in an access database, similar to the
Is there a way to monitor the loading progress (percent progress bar style) when
F Is there a way to monitor the FTP port so that I can

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.