Mohammed Imran
unread,Mar 17, 2015, 5:34:22 AM3/17/15Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to exabgp...@googlegroups.com
Hi Thomas,
We are in the process to use exabgp extensively in our environment.
Need some help in fixing the issue
Basically I have created a script which would announce a flowspec filter and withdraw the route after a period of time.
This functionality works with out any issue. I also wanted to add logging to my script so that this will help us in troubleshooting.
so I used python inbuilt logging module, below is my code snippet
handler = RotatingFileHandler('/opt/flowspec/hello.log', maxBytes=1048576, backupCount=5)
log = logging.getLogger('Flowspec')
log.setLevel(logging.DEBUG)
#handler = logging.FileHandler('/opt/flowspec/hello.log',mode='a',encoding=None,delay=False)
handler.setLevel(logging.INFO)
formatter = logging.Formatter('%(asctime)s %(name)-12s %(levelname)-8s %(message)s')
handler.setFormatter(formatter)
log.addHandler(handler)
Here is my exabgp script
neighbor 30.1.1.11 {
description "will announce a route until told otherwise";
router-id 30.1.1.2;
local-address 30.1.1.2;
local-as 100;
peer-as 100;
# add and remove a route every 10 second
process service-dynamic {
run /opt/flowspec/FlowHandler1.py;
}
#addbracket
#add_script
}
All the files have executable permissions and I am logged in as superuser to run the script.
But when I run I get the below traceback.If I directly run FlowHandler1.py it works fine.
Traceback (most recent call last):
File "/opt/flowspec/FlowHandler1.py", line 38, in <module>
handler = RotatingFileHandler('/opt/flowspec/hello.log', maxBytes=1048576, backupCount=5)
File "/usr/lib/python2.7/logging/handlers.py", line 118, in __init__
BaseRotatingHandler.__init__(self, filename, mode, encoding, delay)
File "/usr/lib/python2.7/logging/handlers.py", line 65, in __init__
logging.FileHandler.__init__(self, filename, mode, encoding, delay)
File "/usr/lib/python2.7/logging/__init__.py", line 897, in __init__
StreamHandler.__init__(self, self._open())
File "/usr/lib/python2.7/logging/__init__.py", line 916, in _open
stream = open(self.baseFilename, self.mode)
IOError: [Errno 13] Permission denied: '/opt/flowspec/hello.log'
Not sure what is the issue.
Appreciate if you can help me with this.
--Imran