#!/usr/bin/python -tt # -*- coding: iso-8859-15 -*- # # Copyright (C) 2006 - Rodolphe Quiedeville # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 dated June, # 1991. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # $Log$ # Revision 1.0 2006/05/24 22:23:01 rodo # Created by Rodolphe Quiedeville # # Magic markers #%# capabilities=autoconf #%# family=auto __version__="2.1" import sys try: f = open ("/tmp/metar-munin", "r") v = f.readlines() f.close() except: print "error" sys.exit(1) if len(sys.argv)>1 : if sys.argv[1] == "config" : print "graph_title Temperature -",v[0].strip() print "graph_args --base 1000" print "graph_vlabel Celsius" print "graph_category metar" print 'graph_info Plugin available at http://rodolphe.quiedeville.org/hack/munin/' print "temp.label temperature" print "temp.draw LINE1" sys.exit(0) elif sys.argv[1] == "autoconfig" : print('yes') sys.exit(0) # Do the Job print "temp.value ",v[2].strip()