Skip to content

snmp session error after first time executing #5

@tbiles

Description

@tbiles

I recommend a change to your code. As is, the script would only work one time for a single printer then it fails saying that it can't open an SNMP session. After looking over the logic, I found that you never close the snmp session for the current device. Subsequent connections even to the same device fail, so I added the following line at the end of the if block (starting line 29). In my editor, this line is 101. The code now works fine and I was able to iterate through a list of about 400 printers with no errors.

$snmp.Close()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions