Changeset 1244
- Timestamp:
- 11/15/06 00:24:33 (5 years ago)
- Files:
-
- people/janl/libperl (added)
- people/janl/libperl/Munin (added)
- people/janl/libperl/Munin.pm.in (moved) (moved from people/janl/server/Munin.pm.in) (6 diffs)
- people/janl/libperl/Munin/Node.pm.in (moved) (moved from people/janl/node/Muninnode.pm)
- people/janl/libperl/Munin/Plugin.pm.in (moved) (moved from people/janl/node/Plugin.pm.in)
- people/janl/node/munin-node.in (modified) (2 diffs)
- people/janl/server/munin-update.in (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
people/janl/libperl/Munin.pm.in
r1203 r1244 1 package Munin;1 # package Munin; 2 2 # -*- perl -*- 3 3 # 4 # Copyright (C) 2003-200 4 Jimmy Olsen, Audun Ytterdal4 # Copyright (C) 2003-2006 Jimmy Olsen, Audun Ytterdal, Nicolai Langfeldt 5 5 # 6 6 # This program is free software; you can redistribute it and/or … … 18 18 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 19 19 # 20 #21 #22 20 # $Id$ 23 #24 21 25 22 use Exporter; 26 23 @ISA = ('Exporter'); 27 @EXPORT = ('munin_trend', 28 'munin_fetch', 29 'munin_nscasend', 24 @EXPORT = ('munin_trend', 25 'munin_fetch', 26 'munin_nscasend', 30 27 'munin_createlock', 31 28 'munin_removelock', … … 50 47 'munin_get_max_label_length', 51 48 'munin_get_field_order', 52 'munin_get_rrd_filename' 49 'munin_get_rrd_filename', 53 50 ); 54 51 … … 59 56 use Symbol 'gensym'; 60 57 61 my $VERSION = "@@VERSION@@";58 my $VERSION = '@@VERSION@@'; 62 59 63 60 my $nsca = new IO::Handle; … … 65 62 66 63 my $DEBUG=0; 67 my $configfile= "@@CONFDIR@@/munin.conf";64 my $configfile='@@CONFDIR@@/munin.conf'; 68 65 69 66 my @legal = ("tmpldir", "ncsa", "ncsa_server", "ncsa_config", "rundir", 70 "dbdir", "logdir", "htmldir", "include", "domain_order", "node_order", 71 "graph_order", "graph_sources", "fork", "graph_title", "create_args", 72 "graph_args", "graph_vlabel", "graph_vtitle", "graph_total", 73 "graph_scale", "graph", "update", "host_name", "label", "cdef", "draw", 74 "graph", "max", "min", "negative", "skipdraw", "type", "warning", 75 "critical", "special_stack", "special_sum", "stack", "sum", "address", 76 "htaccess", "warn", "use_default_name", "use_node_name", "port", 77 "graph_noscale", "nsca", "nsca_server", "nsca_config", "extinfo", 78 "fetch_data", "filename", "max_processes", "nagios", "info", 79 "graph_info", "graph_category", "graph_strategy", "graph_width", 67 "dbdir", "logdir", "htmldir", "include", "domain_order", "node_order", 68 "graph_order", "graph_sources", "fork", "graph_title", "create_args", 69 "graph_args", "graph_vlabel", "graph_vtitle", "graph_total", 70 "graph_scale", "graph", "update", "host_name", "label", "cdef", "draw", 71 "graph", "max", "min", "negative", "skipdraw", "type", "warning", 72 "critical", "special_stack", "special_sum", "stack", "sum", "address", 73 "htaccess", "warn", "use_default_name", "use_node_name", "port", 74 "graph_noscale", "nsca", "nsca_server", "nsca_config", "extinfo", 75 "fetch_data", "filename", "max_processes", "nagios", "info", 76 "graph_info", "graph_category", "graph_strategy", "graph_width", 80 77 "graph_height", "graph_sums", "local_address", "compare", 81 "text", "command", "contact", "contacts", "max_messages", 78 "text", "command", "contact", "contacts", "max_messages", 82 79 "always_send", "notify_alias", "line", "state", "graph_period", 83 80 "cgiurl_graph", "cgiurl", "tls", "service_order", "category_order", 84 "version", "tls_certificate", "tls_private_key", "tls_pem", 81 "version", "tls_certificate", "tls_private_key", "tls_pem", 85 82 "tls_verify_certificate", "tls_verify_depth", "graph_data_size", 86 83 "colour", "graph_printf" … … 90 87 91 88 # Fields to copy when "aliasing" a field 92 my @copy_fields = ("label", "draw", "type", "rrdfile", "fieldname", "info"); 93 89 my @copy_fields = ("label", "draw", "type", "rrdfile", "fieldname", "info"); 90 91 # Make configuration settings available at runtime. 92 my $PREFIX = '@@PREFIX@@'; 93 $ENV{'MUNIN_PREFIX'} = $PREFIX; 94 my $CONFDIR = '@@CONFDIR@@'; # /etc/munin,/etc/opt/munin or such 95 $ENV{'MUNIN_CONFDIR'} = $CONFDIR; 96 my $BINDIR = '@@BINDIR@@'; 97 $ENV{'MUNIN_BINDIR'} = $BINDIR; 98 my $SBINDIR = '@@SBINDIR@@'; 99 $ENV{'MUNIN_SBINDIR'} = $SBINDIR; 100 my $DOCDIR = '@@DOCDIR@@'; 101 $ENV{'MUNIN_DOCDIR'} = $DOCDIR; 102 my $LIBDIR = '@@LIBDIR@@'; # LIBDIR/plugins contains plugin.sh 103 $ENV{'MUNIN_LIBDIR'} = $LIBDIR; 104 my $HTMLDIR = '@@HTMLDIR@@'; 105 $ENV{'MUNIN_HTMLDIR'} = $HTMLDIR; 106 my $CGIDIR = '@@CGIDIR@@'; 107 $ENV{'MUNIN_CGIDIR'} = $CGIDIR; 108 my $DBDIR = '@@DBDIR@@'; 109 $ENV{'MUNIN_DBDIR'} = $DBDIR; 110 my $PLUGSTATE = '@@PLUGSTATE@@'; # Put plugin state files here! 111 $ENV{'MUNIN_PLUGSTATE'} = $PLUGSTATE; # Put plugin state files here! 112 my $MANDIR = '@@MANDIR@@'; 113 $ENV{'MUNIN_MANDIR'} = $MANDIR; 114 my $LOGDIR = '@@LOGDIR@@'; 115 $ENV{'MUNIN_LOGDIR'} = $LOGDIR; 116 my $STATEDIR = '@@STATEDIR@@'; # This is for .pid files 117 $ENV{'MUNIN_STATEDIR'} = $STATEDIR; # This is for .pid files 118 my $USER = '@@USER@@'; # User munin runs as (mostly) 119 $ENV{'MUNIN_USER'} = $USER; # User munin runs as (mostly) 120 my $GROUP = '@@GROUP@@'; # Group ditto 121 $ENV{'MUNIN_GROUP'} = $GROUP; # Group ditto 122 my $PLUGINUSER = '@@PLUGINUSER@@';# Default user for plugin running 123 $ENV{'MUNIN_PLUGINUSER'} = $PLUGINUSER; # Default user for plugin running 124 $ENV{'MUNIN_VERSION'} = $VERSION; 125 my $PERL = '@@PERL@@'; 126 $ENV{'MUNIN_PERL'} = $PERL; 127 my $PERLLIB = '@@PERLLIB@@'; 128 $ENV{'MUNIN_PERLLIB'} = $PERLLIB; 129 my $GOODSH = '@@GOODSH@@'; 130 $ENV{'MUNIN_GOODSH'} = $GOODSH; 131 my $BASH = '@@BASH@@'; 132 $ENV{'MUNIN_BASH'} = $BASH; 133 my $PYTHON = '@@PYTHON@@'; 134 $ENV{'MUNIN_PYTHON'} = $PYTHON; 135 my $OSTYPE = '@@OSTYPE@@'; 136 $ENV{'MUNIN_OSTYPE'} = $OSTYPE; 137 my $HOSTNAME = '@@HOSTNAME@@'; 138 $ENV{'MUNIN_HOSTNAME'} = $HOSTNAME; 139 my $MKTEMP = '@@MKTEMP@@'; 140 $ENV{'MUNIN_MKTEMP'} = $MKTEMP; 94 141 95 142 sub munin_trend { people/janl/node/munin-node.in
r1198 r1244 27 27 use vars qw(@ISA); 28 28 use Getopt::Long; 29 use Munin; 29 30 use Net::Server::Fork; # any personality will do 30 31 … … 45 46 $0 =~ /^(.*)$/; # for some strange reason won't "$0 = $0;" work. 46 47 $0 = $1; 47 48 # Make configuration settings available at runtime.49 $ENV{'MUNIN_PREFIX'} = '@@PREFIX@@';50 $ENV{'MUNIN_CONFDIR'} = '@@CONFDIR@@'; # /etc/munin,/etc/opt/munin or such51 $ENV{'MUNIN_BINDIR'} = '@@BINDIR@@';52 $ENV{'MUNIN_SBINDIR'} = '@@SBINDIR@@';53 $ENV{'MUNIN_DOCDIR'} = '@@DOCDIR@@';54 $ENV{'MUNIN_LIBDIR'} = '@@LIBDIR@@'; # LIBDIR/plugins contains plugin.sh55 $ENV{'MUNIN_HTMLDIR'} = '@@HTMLDIR@@';56 $ENV{'MUNIN_CGIDIR'} = '@@CGIDIR@@';57 $ENV{'MUNIN_DBDIR'} = '@@DBDIR@@';58 $ENV{'MUNIN_PLUGSTATE'} = '@@PLUGSTATE@@'; # Put plugin state files here!59 $ENV{'MUNIN_MANDIR'} = '@@MANDIR@@';60 $ENV{'MUNIN_LOGDIR'} = '@@LOGDIR@@';61 $ENV{'MUNIN_STATEDIR'} = '@@STATEDIR@@'; # This is for .pid files62 $ENV{'MUNIN_USER'} = '@@USER@@'; # User munin runs as (mostly)63 $ENV{'MUNIN_GROUP'} = '@@GROUP@@'; # Group ditto64 $ENV{'MUNIN_PLUGINUSER'} = '@@PLUGINUSER@@';# Default user for plugin running65 $ENV{'MUNIN_VERSION'} = '@@VERSION@@';66 $ENV{'MUNIN_PERL'} = '@@PERL@@';67 $ENV{'MUNIN_PERLLIB'} = '@@PERLLIB@@';68 $ENV{'MUNIN_GOODSH'} = '@@GOODSH@@';69 $ENV{'MUNIN_BASH'} = '@@BASH@@';70 $ENV{'MUNIN_PYTHON'} = '@@PYTHON@@';71 $ENV{'MUNIN_OSTYPE'} = '@@OSTYPE@@';72 $ENV{'MUNIN_HOSTNAME'} = '@@HOSTNAME@@';73 $ENV{'MUNIN_MKTEMP'} = '@@MKTEMP@@';74 48 75 49 @ISA = qw(Net::Server::Fork); people/janl/server/munin-update.in
r1179 r1244 1 #!@@PERL@@ -w 2 # -*- cperl -*- 1 #!/usr/bin/perl -w 3 2 # 4 # Copyright (C) 2002-200 4 Jimmy Olsen, Audun Ytterdal3 # Copyright (C) 2002-2006 Jimmy Olsen, Audun Ytterdal, Nicolai Langfeldt 5 4 # 6 5 # This program is free software; you can redistribute it and/or … … 26 25 use strict; 27 26 use IO::Socket; 27 use lib "../build/libperl"; 28 28 use Munin; 29 29 use Time::HiRes; … … 35 35 36 36 my $DEBUG=0; 37 my $VERSION= "@@VERSION@@";37 my $VERSION='@@VERSION@@'; 38 38 my $serversocket = "munin-server-socket.$$"; 39 my $conffile = "@@CONFDIR@@/munin.conf";39 my $conffile = $Munin::CONFDIR."/munin.conf"; 40 40 my $force_root = 0; 41 41 my $do_usage = 0; … … 80 80 may be supplied. 81 81 --config <file> Use <file> as configuration file. 82 [ @@CONFDIR@@/munin.conf]82 [$Munin::CONFDIR/Munin.conf] 83 83 --[no]debug View debug messages. [--nodebug] 84 84 --[no]fork Don't fork one instance for each host. [--fork] … … 955 955 my $cert; 956 956 $key = $cert = munin_get ($config, "tls_pem", undef, $domain, $name); 957 $key = &munin_get ($config, "tls_private_key", " @@CONFDIR@@/munin.pem", $domain, $name)957 $key = &munin_get ($config, "tls_private_key", "$Munin::CONFDIR/munin.pem", $domain, $name) 958 958 unless defined $key; 959 $cert = &munin_get ($config, "tls_certificate", " @@CONFDIR@@/munin.pem", $domain, $name)959 $cert = &munin_get ($config, "tls_certificate", "$Munin::CONFDIR/munin.pem", $domain, $name) 960 960 unless defined $cert; 961 961 if (!start_tls ($socket, $tls_requirement, $cert, $key,
