cancel
Showing results for 
Search instead for 
Did you mean: 

python exception socket.error: [Errno 128] Network is unreachable

python exception socket.error: [Errno 128] Network is unreachable

Vladimir_Shenco
New Contributor
Colleagues, hello.
There was a need of sending mail on an event from the switch.
I was will find here such absolutely remarkable script of https://github.com/extremenetworks/ExtremeScripting/blob/master/EXOS/Python/Email_event/email.py

Everything is good only if to launch through cli: run script email.py I receive socket.error: [Errno 128] of Network is unreachable if through UPM Profile just silence, it is natural that the email server from the switch is available, as far as I understand problem in vr vr-default, but as to launch it having specified vr vr-default it isn't told anywhere. Prompt please how to resolve an issue with it python exception.

7 REPLIES 7

bw447
New Contributor III
When you say that you needed to change the VR are you referring to editing the /proc/self/ns_id file? I see (from the python doc) that it needs to be changed. Question is does it need to be changed every time the script is ran or is the initial change permanent?

The self part of /proc/self/ns_id shows that this pseudo-file pertains to the currently running process itself.

The proc part hints that this is per-process, but Linux has not been consistent with this and lots of non-process-specific stuff landed in procfs (usually mounted under /proc), before adding sysfs (usually mounted under /sys) for new system wide information and settings. But /proc/self relates to the current process only.

So this file is new for every process and by default set to use VR-Mgmt and therefore needs to be changed every time the script is run.

BrandonC
Extreme Employee
Yes, this needs to be modified every time you want to access something via VR-Mgmt.

Vladimir_Shenco
New Contributor
Many thanks ! Now everything works perfectly.

GTM-P2G8KFN