You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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()
The text was updated successfully, but these errors were encountered:
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()
The text was updated successfully, but these errors were encountered: