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

snmp session error after first time executing #5

Open
tbiles opened this issue Jul 21, 2020 · 0 comments
Open

snmp session error after first time executing #5

tbiles opened this issue Jul 21, 2020 · 0 comments

Comments

@tbiles
Copy link

tbiles commented Jul 21, 2020

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()

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

No branches or pull requests

1 participant