2
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2018-11-08 00:59:34 +01:00

Merge pull request #713 from iborodikhin/master

Comments update and error messages
This commit is contained in:
Stig Sandbeck Mathisen 2016-04-15 12:53:43 +02:00
commit d42751c908

View file

@ -25,9 +25,12 @@
# Use it in your site configuration (/etc/nginx/sites-enabled/anything.conf): # Use it in your site configuration (/etc/nginx/sites-enabled/anything.conf):
# access_log /var/log/nginx/upstream.log upstream; # access_log /var/log/nginx/upstream.log upstream;
# #
# Attention! Because munin-node does not have read permission for nginx log files we need to run it as root.
#
# And specify some options in /etc/munin/plugin-conf.d/munin-node: # And specify some options in /etc/munin/plugin-conf.d/munin-node:
# #
# [nginx_upstream_multi_upstream] # [nginx_upstream_multi_upstream]
# user root
# env.graphs cache http time request # env.graphs cache http time request
# env.log /var/log/nginx/upstream.log # env.log /var/log/nginx/upstream.log
# env.upstream 10.0.0.1:80 10.0.0.2:8080 unix:/tmp/upstream3 # env.upstream 10.0.0.1:80 10.0.0.2:8080 unix:/tmp/upstream3
@ -199,8 +202,8 @@ else:
try: try:
logHandle = open(logPath, "r") logHandle = open(logPath, "r")
except Exception: except Exception as e:
print "Log file %s not readable" % logPath print "Log file %s not readable: %s" % (logPath, e.strerror)
sys.exit(1) sys.exit(1)
try: try:
@ -278,7 +281,8 @@ else:
lastByteHandle = open(lastBytePath, "w") lastByteHandle = open(lastBytePath, "w")
lastByteHandle.write(str(logHandle.tell())) lastByteHandle.write(str(logHandle.tell()))
lastByteHandle.close() lastByteHandle.close()
except Exception: except Exception as e:
print e.strerror
sys.exit(1) sys.exit(1)
logHandle.close() logHandle.close()