From 85f66f7c90aff2fe20ebbafddb7417a2728943e8 Mon Sep 17 00:00:00 2001 From: Joerg Linge Date: Fri, 4 Jun 2010 00:47:37 +0800 Subject: [PATCH] check for writable checkresult directory --- nagixsc_http2nagios.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/nagixsc_http2nagios.py b/nagixsc_http2nagios.py index e327bc1..0a709a5 100755 --- a/nagixsc_http2nagios.py +++ b/nagixsc_http2nagios.py @@ -51,6 +51,10 @@ except ConfigParser.NoOptionError, e: print 'Config file error: %s ' % e sys.exit(1) +if os.access(config['checkresultdir'],os.W_OK) == False: + print 'Checkresult directory "%s" is not writable.' % config['checkresultdir'] + sys.exit(1) + users = {} for u in cfgread.options('users'): users[u] = cfgread.get('users', u) -- 2.30.2