0

I have this Nexus 5596 chassis that doesn't support SLA configuration. I want to create a static route only if TCP on port 80 is open for another IP. I got the similar thing working on a Nexus 9K with a TCP-type SLA and a track and EEM that monitors the syslog and add/remove the route.

What option do I have on the 5596? I see that it supports Python. Is it the best option I have? If so, which library or module can do the work for me? I found people using "socket" but I got error with the interactive console

#  python
Copyright (c) 2001-2012 Python Software Foundation; All Rights Reserved

>>> import socket
>>> sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
Permission denied for the role
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/isan/python/scripts/socket.py", line 187, in __init__
    _sock = _realsocket(family, type, proto)
SystemError: NULL result without error in PyObject_Call

Is there a way to fix the permission issue, or is there a more proper Cisco way to do this? I am hoping that it will check and generate a Syslog message. Then my EEM script can capture it and do the rest. Of course, if easy enough, I can also try to do everything with Python. Let me know your advice. Thanks!

Difan Zhao
  • 379
  • 6
  • 20

0 Answers0