Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fvt]2.12.1 switchdiscover -s snmp could not use port 161 by nmap way on rh env #1252

Closed
junxiawang opened this issue Jun 3, 2016 · 5 comments

Comments

@junxiawang
Copy link
Contributor

env:rh
build:latest build lsdef - Version 2.12.1 (git commit 2794ca5, built Thu Jun 2 09:30:41 EDT 2016)
How to reproduce:

[root@c910f04x27v02 result]# switchdiscover  --range 10.5.24.1
Discovering switches using nmap for 10.5.24.1. It may take long time...
ip              name                    vendor                                              mac         
------------    ------------            ------------                                        ------------
10.5.24.1  [root@c910f04x27v02 result]# switchdiscover  --range 10.5.24.1 -s snmp
Discovering switches using snmpwalk.....
Could not process this command: /usr/bin/nmap -P0 -v -sU -p 161 -oA snmp_scan 10.5.24.1 | grep 'open port 161' 
 No switch found 
    switch-10-5-24-1        Juniper Networks                                    5C:5E:AB:64:CA:7F
--------------------------------------------->
Questions:
 1) I do not know why snmp discover using nmap way
 2) I do not think all env could use port 161
@cxhong
Copy link
Contributor

cxhong commented Jun 4, 2016

  1. we used nmap for snmp discover to better parse the ip range.
  2. port 161 has to be open to allow snmpwalk command to communicate with switch
# snmpwalk -Os -v1 -c public 10.5.24.1 1.3.6.1.2.1.1.1
Timeout: No Response from 10.5.24.1

@junxiawang
Copy link
Contributor Author

@cxhong but I could get the switch using nmap but not snmp
[root@c910f04x27v02 ~]# switchdiscover --range 10.5.24.1
Discovering switches using nmap for 10.5.24.1. It may take long time...
ip name vendor mac


10.5.24.1 switch-10-5-24-1 Juniper Networks 5C:5E:AB:64:CA:7F
[root@c910f04x27v02 ~]#

@cxhong
Copy link
Contributor

cxhong commented Jun 6, 2016

switchdiscover command can't do anything if the device does not respond to SNMP queries for snmp based scan. Any snmp command we sent out will return "Timeout" messages if snmp server is not enabled.

@cxhong cxhong closed this as completed Jun 6, 2016
@daniceexi
Copy link
Contributor

@cxhong That's ok to skip the switch if the snmp port is not opened. But we should make the message to be more reasonable instead of following:

Could not process this command: /usr/bin/nmap -P0 -v -sU -p 161 -oA snmp_scan 10.5.24.1 | grep 'open port 161' 
 No switch found 

We may say: cannot find any device which enabled snmp port.

@cxhong
Copy link
Contributor

cxhong commented Jun 7, 2016

Modified the message and will checked in PR #1244

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants