Highlighted
Absent Member.. Absent Member..
Absent Member..
308 views

Switch not created by discovery, SNMP: Connection failed.

Jump to solution

Hi,

 

A new switch is not created by discovery. The warning is that it cannot connect to the switch, the credential check sais ok.

When you look at the commlog you can see it does connect and gets values, but what goes really wrong?

 

The warning is:

<< Progress message, Severity: Warning>>
SNMP: Connection failed.

 

I'll attach the commlog.

I run 10.10 cup2.651 with cp13.03.15

 

Gr,

Ronald

0 Likes
1 Solution

Accepted Solutions
Highlighted
Absent Member.
Absent Member.

Re: Switch not created by discovery, SNMP: Connection failed.

Jump to solution

Hi Ronald,

 

A temporary solution, you could try to add the following red lines to SNMP_Connection_Utils.py

 

def getSNByPublicMib(client):
    entTable = SNMP_Networking_Utils.getEntPhysicalTable(client)
    if entTable:
        for row in entTable:
            #  INTEGER {other(1), unknown(2), chassis(3), backplane(4), container(5), powerSupply(6), fan(7), sensor(8),
            #  module(9), port(10), stack(11), cpu(12)}
            if  row.entPhysicalClassess.strip():
                if int(row.entPhysicalClassess) == 3: #only get type of chassis
                    return row.entPhysicalSerialNum
    return None

 

Or you could catch the ValueError exception. It is another temporary solution.

 

def getSNByPublicMib(client):
    entTable = SNMP_Networking_Utils.getEntPhysicalTable(client)
    if entTable:
        for row in entTable:
            #  INTEGER {other(1), unknown(2), chassis(3), backplane(4), container(5), powerSupply(6), fan(7), sensor(8),
            #  module(9), port(10), stack(11), cpu(12)}
            try:               

                if int(row.entPhysicalClassess) == 3: #only get type of chassis
                    return row.entPhysicalSerialNum

            except ValueError:

               return None

    return None

 

 

Regards,

Ivy

 

View solution in original post

0 Likes
7 Replies
Highlighted
Absent Member.. Absent Member..
Absent Member..

Re: Switch not created by discovery, SNMP: Connection failed.

Jump to solution

trying the attachment again.

0 Likes
Highlighted
Super Contributor.
Super Contributor.

Re: Switch not created by discovery, SNMP: Connection failed.

Jump to solution

Hello Ronald, 

 

It seems that the problem is that the SNMP is failing becuase the infomration been returned is not valid

 

<log start="19:54:25" severity="debug">Unexpected SNMP_AGENT Exception:
Traceback (most recent call last):
File "SNMP_Connection_Utils", line 1056, in mainFunction
File "SNMP_Connection_Utils", line 715, in doSnmp
File "SNMP_Connection_Utils", line 838, in getSNByPublicMib
ValueError: invalid literal for int() with base 10:
</log>

 

It may be better to open a support case to check into this

HP Support
If you find that this or any post resolves your issue, please be sure to mark it as an accepted solution
0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

Re: Switch not created by discovery, SNMP: Connection failed.

Jump to solution

Ronald;

 

The error is at the end of the communication log:

 

<EXEC start="19:54:25" duration="15">
<CMD>[CDATA&colon; 1.3.6.1.2.1.47.1.1.1.1.1,1.3.6.1.2.1.47.1.1.1.1.2,string,1.3.6.1.2.1.47.1.1.1.1.2,string,1.3.6.1.2.1.47.1.1.1.1.3,string,1.3.6.1.2.1.47.1.1.1.1.4,string,1.3.6.1.2.1.47.1.1.1.1.5,string,1.3.6.1.2.1.47.1.1.1.1.6,string,1.3.6.1.2.1.47.1.1.1.1.7,string,1.3.6.1.2.1.47.1.1.1.1.8,string,1.3.6.1.2.1.47.1.1.1.1.9,string,1.3.6.1.2.1.47.1.1.1.1.10,string,1.3.6.1.2.1.47.1.1.1.1.11,string,1.3.6.1.2.1.47.1.1.1.1.12,string,1.3.6.1.2.1.47.1.1.1.1.13,string,1.3.6.1.2.1.47.1.1.1.1.14,string,1.3.6.1.2.1.47.1.1.1.1.15,string,1.3.6.1.2.1.47.1.1.1.1.16,string]</CMD>
<RESULT>[CDATA&colon; ROWS_1_COLS_17|_|1|_|EMPTY_VALUE|_|Cisco 5500 Series Wireless LAN Controller|_|EMPTY_VALUE|_|0|_|EMPTY_VALUE|_|-1|_|Chassis|_|V03|_|EMPTY_VALUE|_|7.3.101.0|_|FCW1652L02M|_|EMPTY_VALUE|_|AIR-CT5508-K9|_|EMPTY_VALUE|_|EMPTY_VALUE|_|EMPTY_VALUE]</RESULT>
</EXEC>
<DISCONNECT start="19:54:25" duration="0" CMD="client_disconnect" RESULT="" IS_NULL="Y" type="snmp" credentialsId="21935_1_CMS" />
<log start="19:54:25" severity="debug">Unexpected SNMP_AGENT Exception:
Traceback (most recent call last):
File "SNMP_Connection_Utils", line 1056, in mainFunction
File "SNMP_Connection_Utils", line 715, in doSnmp
File "SNMP_Connection_Utils", line 838, in getSNByPublicMib
ValueError: invalid literal for int() with base 10:
</log>

 

The problem is with a value of 'int', which isn't a valid integer...  If you examine the code, SNMP_Connection_Utils.py, like 838, it gives you what it is looking for:

 

def getSNByPublicMib(client):
entTable = SNMP_Networking_Utils.getEntPhysicalTable(client)
if entTable:
for row in entTable:
# INTEGER {other(1), unknown(2), chassis(3), backplane(4), container(5), powerSupply(6), fan(7), sensor(8),
# module(9), port(10), stack(11), cpu(12)}
if int(row.entPhysicalClassess) == 3: #only get type of chassis
return row.entPhysicalSerialNum
return None

 

So, entPhysicalClasses is expected to be an integer, but it returns 0 (see bold above).  Since 0 is not an integer, we fail.  The vendor should report a 1 if it is unknown... so, you could contact Cisco to see if an IOS upgrade fixes it, or you could submit a support case because our code should check first to see if it is an integer before running the int() on the value.  This would make our code better.

 

Best Regards;


Keith Paschal

HP UCMDB Support

Hope this helps,
Keith Paschal
UCMDB Worldwide Support Lead
Micro Focus Support
If you find this or any post resolves your issue, please be sure to mark it as an accepted solution."

Click the KUDOS star on the left to say 'Thanks'
Highlighted
Absent Member.. Absent Member..
Absent Member..

Re: Switch not created by discovery, SNMP: Connection failed.

Jump to solution

Thanks for your reply.

According to wikipedia a zero is also an integer btw, but i will create a case for this to change the discovery.

 

Gr,

Ronald

0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

Re: Switch not created by discovery, SNMP: Connection failed.

Jump to solution

Ha ha ha!  I may have miscounted the columns... it could be the 'EMPTY VALUE' that it is trying to convert to an integer.  At any rate it is *not* expected, and this is causing the problem.  A check should be put into the code that will check to ensure we aren't doing any casting of variables into types that they cannot be cast to...

Hope this helps,
Keith Paschal
UCMDB Worldwide Support Lead
Micro Focus Support
If you find this or any post resolves your issue, please be sure to mark it as an accepted solution."

Click the KUDOS star on the left to say 'Thanks'
0 Likes
Highlighted
Absent Member.
Absent Member.

Re: Switch not created by discovery, SNMP: Connection failed.

Jump to solution

Hi Ronald,

 

A temporary solution, you could try to add the following red lines to SNMP_Connection_Utils.py

 

def getSNByPublicMib(client):
    entTable = SNMP_Networking_Utils.getEntPhysicalTable(client)
    if entTable:
        for row in entTable:
            #  INTEGER {other(1), unknown(2), chassis(3), backplane(4), container(5), powerSupply(6), fan(7), sensor(8),
            #  module(9), port(10), stack(11), cpu(12)}
            if  row.entPhysicalClassess.strip():
                if int(row.entPhysicalClassess) == 3: #only get type of chassis
                    return row.entPhysicalSerialNum
    return None

 

Or you could catch the ValueError exception. It is another temporary solution.

 

def getSNByPublicMib(client):
    entTable = SNMP_Networking_Utils.getEntPhysicalTable(client)
    if entTable:
        for row in entTable:
            #  INTEGER {other(1), unknown(2), chassis(3), backplane(4), container(5), powerSupply(6), fan(7), sensor(8),
            #  module(9), port(10), stack(11), cpu(12)}
            try:               

                if int(row.entPhysicalClassess) == 3: #only get type of chassis
                    return row.entPhysicalSerialNum

            except ValueError:

               return None

    return None

 

 

Regards,

Ivy

 

View solution in original post

0 Likes
Highlighted
Absent Member.. Absent Member..
Absent Member..

Re: Switch not created by discovery, SNMP: Connection failed.

Jump to solution

Hi Ivy,

 

Thanks! That was very helpful.

I added the line from the first example and now discovery runs ok and the switch ci is created.

 

Gr,

Ronald

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.