Changeset 1251
- Timestamp:
- 11/15/06 23:03:45 (5 years ago)
- Files:
-
- people/janl/Makefile (modified) (5 diffs)
- people/janl/nonsrc (added)
- people/janl/nonsrc/VeraMono.ttf (moved) (moved from people/janl/src/server/VeraMono.ttf)
- people/janl/nonsrc/definitions.html (moved) (moved from people/janl/src/server/definitions.html)
- people/janl/nonsrc/favicon.ico (moved) (moved from people/janl/src/resources/favicon.ico)
- people/janl/nonsrc/logo-horizontal.svg (moved) (moved from people/janl/logo-horizontal.svg)
- people/janl/nonsrc/logo.eps (moved) (moved from people/janl/logo.eps)
- people/janl/nonsrc/logo.png (moved) (moved from people/janl/src/server/logo.png)
- people/janl/nonsrc/logo.svg (moved) (moved from people/janl/logo.svg)
- people/janl/nonsrc/style.css (moved) (moved from people/janl/src/server/style.css)
- people/janl/src/libperl/Munin.pm (modified) (7 diffs)
- people/janl/src/libperl/Munin/Server.pm (modified) (9 diffs)
- people/janl/src/server/munin-update (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
people/janl/Makefile
r1205 r1251 1 1 # Gnu make only. Seriously. 2 # 2 3 # $Id$ 3 4 # 4 5 # Defaults/paths from this file 5 6 include Makefile.config … … 9 10 INSTALL = ./install-sh 10 11 DIR = $(shell /bin/pwd | sed 's/^.*\///') 11 INFILES = $(shell find . -name '*.in')12 PLUGINS = $(wildcard node/node.d.$(OSTYPE)/*node/node.d/*)12 INFILES = $(shell find src -type f -print | egrep -v '(/\.svn/|~)') 13 PLUGINS = $(wildcard src/node/node.d.$(OSTYPE)/* src/node/node.d/*) 13 14 MANCENTER = "Munin Documentation" 14 15 MAN8 = node/munin-node node/munin-run \ 15 node/munin-node-configure-snmp \16 src/node/munin-node-configure-snmp \ 16 17 node/munin-node-configure \ 17 18 server/munin-graph server/munin-update \ … … 50 51 $(INSTALL) -m 0644 "$$p" $(CONFDIR)/templates/ ; \ 51 52 done 52 $(INSTALL) -m 0644 server/logo.png $(CONFDIR)/templates/53 $(INSTALL) -m 0644 server/style.css $(CONFDIR)/templates/54 $(INSTALL) -m 0644 server/definitions.html $(CONFDIR)/templates/55 $(INSTALL) -m 0755 server/VeraMono.ttf $(LIBDIR)/56 $(INSTALL) -m 0644 resources/favicon.ico $(HTMLDIR)/53 $(INSTALL) -m 0644 nonsrc/logo.png $(CONFDIR)/templates/ 54 $(INSTALL) -m 0644 nonsrc/style.css $(CONFDIR)/templates/ 55 $(INSTALL) -m 0644 nonsrc/definitions.html $(CONFDIR)/templates/ 56 $(INSTALL) -m 0755 nonsrc/VeraMono.ttf $(LIBDIR)/ 57 $(INSTALL) -m 0644 nonsrc/favicon.ico $(HTMLDIR)/ 57 58 test -f $(HTMLDIR)/.htaccess || $(INSTALL) -m 0644 build/server/munin-htaccess $(HTMLDIR)/.htaccess 58 test -f "$(CONFDIR)/munin.conf" || $(INSTALL) -m 0644 build/server/munin.conf $(CONFDIR)/59 test -f "$(CONFDIR)/munin.conf" || $(INSTALL) -m 0644 build/server/munin.conf $(CONFDIR)/ 59 60 $(INSTALL) -m 0755 build/server/munin-cron $(BINDIR)/ 60 61 $(INSTALL) -m 0755 build/server/munin-update $(LIBDIR)/ … … 216 217 touch build-stamp 217 218 rm -rf build 218 @for file in $(INFILES); do \ 219 destname=`echo $$file | sed 's/.in$$//'`; \ 220 echo Generating build/$$destname..; \ 221 mkdir -p build/`dirname $$file`; \ 222 sed -e 's|@@PREFIX@@|$(PREFIX)|g' \ 219 @for file in $(INFILES); do \ 220 destname=`echo $$file | sed 's|^src/|build/|'`; \ 221 echo Generating $$destname; \ 222 mkdir -p `dirname $$destname`; \ 223 sed -e '1 s|#!/bin/sh|#!$(GOODSH)|' \ 224 -e '1 s|#!/bin/bash|#!$(BASH)|' \ 225 -e '1 s|#!/usr/bin/perl|#!$(PERL)|' \ 226 -e '1 s|#!/usr/bin/env python|#!$(PYTHON)|' \ 227 -e 's|@@PREFIX@@|$(PREFIX)|g' \ 223 228 -e 's|@@CONFDIR@@|$(CONFDIR)|g' \ 224 229 -e 's|@@BINDIR@@|$(BINDIR)|g' \ … … 245 250 -e 's|@@GOODSH@@|$(GOODSH)|g' \ 246 251 -e 's|@@BASH@@|$(BASH)|g' \ 247 $$file > build/$$destname; \252 $$file > $$destname; \ 248 253 done 249 254 people/janl/src/libperl/Munin.pm
r1249 r1251 21 21 22 22 use strict; 23 use vars qw(@ISA @EXPORT $VERSION $CONFDIR);24 23 use Exporter; 24 25 use vars qw(@ISA @EXPORT @EXPORT_OK $VERSION $CONFDIR $DEBUG @legalfetch 26 @legalconfig @copy_fields); 25 27 26 28 @ISA = ('Exporter'); … … 33 35 'munin_runlock', 34 36 'munin_getlock', 35 'munin_readconfig',36 'munin_writeconfig',37 37 'munin_delete', 38 38 'munin_overwrite', 39 'munin_config',40 39 'munin_draw_field', 41 40 'munin_get_bool', … … 52 51 'munin_get_field_order', 53 52 'munin_get_rrd_filename', 53 '$CONFDIR', 54 '$DEBUG', 54 55 ); 56 57 @EXPORT_OK = ''; # qw($CONFDIR); 58 59 $VERSION='@@VERSION@@'; 60 $CONFDIR='@@CONFDIR@@'; 55 61 56 62 use RRDs; … … 59 65 use Symbol 'gensym'; 60 66 61 $VERSION='@@VERSION@@';62 $CONFDIR='@@CONFDIR@@';63 1;64 __END__65 66 67 $VERSION = '@@VERSION@@'; 67 68 … … 69 70 my $config = undef; 70 71 71 my$DEBUG=0;72 $DEBUG=0; 72 73 my $configfile='@@CONFDIR@@/munin.conf'; 73 74 … … 84 85 ); 85 86 86 87 87 # Fields to copy when "aliasing" a field 88 my@copy_fields = ("label", "draw", "type", "rrdfile", "fieldname", "info");88 @copy_fields = ("label", "draw", "type", "rrdfile", "fieldname", "info"); 89 89 90 90 # Make configuration settings available at runtime. 91 91 my $PREFIX = '@@PREFIX@@'; 92 92 $ENV{'MUNIN_PREFIX'} = $PREFIX; 93 $CONFDIR = '@@CONFDIR@@'; # /etc/munin,/etc/opt/munin or such93 $CONFDIR = '@@CONFDIR@@'; # /etc/munin,/etc/opt/munin or such 94 94 print "CONFDIR: $CONFDIR!\n"; 95 95 $ENV{'MUNIN_CONFDIR'} = $CONFDIR; … … 270 270 } 271 271 272 sub munin_readconfig {273 my ($conf, $missingok, $corruptok) = @_;274 my $config = undef;275 my @contents = undef;276 277 $conf ||= $configfile;278 if (! -r $conf and ! $missingok) {279 ::logger ("munin_readconfig: cannot open '$conf'");280 return undef;281 }282 if (open (CFG, $conf))283 {284 @contents = <CFG>;285 close (CFG);286 }287 288 $config = &munin_parse_config (\@contents);289 290 # Some important defaults before we return...291 $config->{'rundir'} ||= "/tmp/";292 $config->{'dbdir'} ||= "/var/lib/munin/";293 $config->{'logdir'} ||= "/var/log/";294 $config->{'tmpldir'}||= "/etc/munin/templates/";295 $config->{'htmldir'}||= "@@HTMLDIR@@/";296 return ($config);297 }298 299 sub munin_parse_config300 {301 my $lines = shift;302 my $hash = undef;303 my $prefix = "";304 my $prevline = "";305 306 foreach my $line (@{$lines})307 {308 chomp $line;309 #$line =~ s/(^|[^\\])#.*/$1/g if $line =~ /#/; # Skip comments...310 if ($line =~ /#/)311 {312 next if ($line =~ /^#/);313 $line =~ s/(^|[^\\])#.*/$1/g;314 }315 next unless ($line =~ /\S/); # And empty lines...316 if (length $prevline)317 {318 $line = $prevline . $line;319 $prevline = "";320 }321 if ($line =~ /\\\\$/)322 {323 $line =~ s/\\\\$/\\/;324 }325 elsif ($line =~ /\\$/)326 {327 ($prevline = $line) =~ s/\\$//;328 next;329 }330 $line =~ s/\s+$//g; # And trailing whitespace...331 $line =~ s/^\s+//g; # And heading whitespace...332 333 if ($line =~ /^\.(\S+)\s+(.+)\s*$/)334 {335 my ($var, $val) = ($1, $2);336 $hash = &munin_set_var_path ($hash, $var, $val);337 }338 elsif ($line =~ /^\s*\[([^\]]*)]\s*$/)339 {340 $prefix = $1;341 if ($prefix =~ /^([^:;]+);([^:;]+)$/)342 {343 $prefix .= ":";344 }345 elsif ($prefix =~ /^([^:;]+);$/)346 {347 $prefix .= "";348 }349 elsif ($prefix =~ /^([^:;]+);([^:;]+):(.*)$/)350 {351 $prefix .= ".";352 }353 elsif ($prefix =~ /^([^:;]+)$/)354 {355 (my $domain = $prefix) =~ s/^[^\.]+\.//;356 $prefix = "$domain;$prefix:";357 }358 elsif ($prefix =~ /^([^:;]+):(.*)$/)359 {360 (my $domain = $prefix) =~ s/^[^\.]+\.//;361 $prefix = "$domain;$prefix.";362 }363 }364 elsif ($line =~ /^\s*(\S+)\s+(.+)\s*$/)365 {366 my ($var, $val) = ($1, $2);367 $hash = &munin_set_var_path ($hash, "$prefix$var", $val);368 }369 else370 {371 warn "Malformed configuration line \"$line\".";372 }373 }374 375 return $hash;376 }377 378 sub munin_get_var_path379 {380 my $hash = shift;381 my $var = shift;382 my $val = shift;383 384 print "DEBUG: Getting var \"$var\" = \"$val\"\n" if $DEBUG;385 if ($var =~ /^\s*([^;:]+);([^;:]+):(\S+)\s*$/)386 {387 my ($dom, $host, $rest) = ($1, $2, $3);388 my @sp = split (/\./, $rest);389 390 if (@sp == 3)391 {392 return $hash->{domain}->{$dom}->{node}->{$host}->{client}->{$sp[0]}->{"$sp[1].$sp[2]"};393 }394 elsif (@sp == 2)395 {396 return $hash->{domain}->{$dom}->{node}->{$host}->{client}->{$sp[0]}->{$sp[1]};397 }398 elsif (@sp == 1)399 {400 return $hash->{domain}->{$dom}->{node}->{$host}->{$sp[0]};401 }402 else403 {404 warn "munin_set_var: Malformatted variable path \"$var\".";405 }406 }407 elsif ($var =~ /^\s*([^;:]+);([^;:]+)\s*$/)408 {409 my ($dom, $rest) = ($1, $2);410 my @sp = split (/\./, $rest);411 412 if (@sp == 1)413 {414 return $hash->{domain}->{$dom}->{$sp[0]};415 }416 else417 {418 warn "munin_set_var: Malformatted variable path \"$var\".";419 }420 }421 elsif ($var =~ /^\s*([^;:\.]+)\s*$/)422 {423 return $hash->{$1};424 }425 else426 {427 warn "munin_set_var: Malformatted variable path \"$var\".";428 }429 430 return undef;431 }432 433 sub munin_set_var_path {434 my $hash = shift;435 my $var = shift;436 my $val = shift;437 438 print "DEBUG: Setting var \"$var\" = \"$val\"\n" if $DEBUG;439 if ($var =~ /^\s*([^;:]+);([^:]+):(\S+)\s*$/)440 {441 my ($dom, $host, $rest) = ($1, $2, $3);442 my @sp = split (/\./, $rest);443 444 if (@sp == 3)445 {446 ::logger ("Warning: Unknown option \"$sp[2]\" in \"$dom;$host:$sp[0].$sp[1].$sp[2]\".")447 unless defined $legal_expanded{$sp[2]};448 $hash->{domain}->{$dom}->{node}->{$host}->{client}->{$sp[0]}->{"$sp[1].$sp[2]"} = $val;449 }450 elsif (@sp == 2)451 {452 ::logger ("Warning: Unknown option \"$sp[1]\" in \"$dom;$host:$sp[0].$sp[1]\".")453 unless defined $legal_expanded{$sp[1]};454 $hash->{domain}->{$dom}->{node}->{$host}->{client}->{$sp[0]}->{$sp[1]} = $val;455 }456 elsif (@sp == 1)457 {458 ::logger ("Warning: Unknown option \"$sp[0]\" in \"$dom;$host:$sp[0]\".")459 unless defined $legal_expanded{$sp[0]};460 $hash->{domain}->{$dom}->{node}->{$host}->{$sp[0]} = $val;461 }462 else463 {464 warn "munin_set_var: Malformatted variable path \"$var\".";465 }466 }467 elsif ($var =~ /^\s*([^;:]+);([^;:]+)\s*$/)468 {469 my ($dom, $rest) = ($1, $2);470 my @sp = split (/\./, $rest);471 472 if (@sp == 1)473 {474 ::logger ("Warning: Unknown option \"$sp[0]\" in \"$dom;$sp[0]\".")475 unless defined $legal_expanded{$sp[0]};476 $hash->{domain}->{$dom}->{$sp[0]} = $val;477 }478 else479 {480 warn "munin_set_var: Malformatted variable path \"$var\".";481 }482 }483 elsif ($var =~ /^\s*([^;:\.]+)\s*$/)484 {485 ::logger ("Warning: Unknown option \"$1\" in \"$1\".")486 unless defined $legal_expanded{$1};487 $hash->{$1} = $val;488 }489 elsif ($var =~ /^\s*([^\.]+)\.([^\.]+)\.([^\.]+)$/)490 {491 ::logger ("Warning: Unknown option \"$1\" in \"$var\".")492 unless defined $legal_expanded{$1};493 ::logger ("Warning: Unknown option \"$3\" in \"$var\".")494 unless defined $legal_expanded{$3};495 $hash->{$1}->{$2}->{$3} = $val;496 }497 else498 {499 warn "munin_set_var: Malformatted variable path \"$var\".";500 }501 502 return $hash;503 }504 505 sub munin_writeconfig_loop {506 my ($data,$fh,$pre) = @_;507 $pre |= "";508 509 # Write datafile510 foreach my $a (keys %{$data})511 {512 if (ref ($data->{$a}) eq "HASH")513 {514 if ($a eq "domain" or $a eq "node" or $a eq "client")515 {516 &munin_writeconfig_loop ($data->{$a}, $fh, "$pre");517 }518 elsif ($a eq "contact" and $pre eq "")519 {520 &munin_writeconfig_loop ($data->{$a}, $fh, "contact.");521 }522 else523 {524 my $lpre = $pre;525 if ($lpre eq "")526 {527 $lpre = $a.";";528 }529 elsif ($lpre =~ /;$/)530 {531 $lpre .= $a.":";532 }533 else534 {535 $lpre .= $a.".";536 }537 &munin_writeconfig_loop ($data->{$a}, $fh, "$lpre");538 }539 }540 elsif (defined $data->{$a} and length $data->{$a})541 {542 next if "$pre$a" eq "version"; # Handled separately543 print "Writing: $pre$a $data->{$a}\n" if $DEBUG;544 if ($data->{$a} =~ /\\$/)545 { # Backslash as last char has special meaning. Avoid it.546 print $fh "$pre$a $data->{$a}\\\n";547 } else {548 print $fh "$pre$a $data->{$a}\n";549 }550 }551 }552 }553 sub munin_writeconfig {554 my ($datafilename,$data,$fh) = @_;555 # my $datafile = new Config::General();556 # $datafile->save_file($datafilename,$data);557 558 if (!defined $fh)559 {560 $fh = gensym();561 unless (open ($fh, ">$datafilename"))562 {563 die "Fatal error: Could not open \"$datafilename\" for writing: $!";564 }565 }566 567 # Write version568 print $fh "version $VERSION\n";569 # Write datafile570 &munin_writeconfig_loop ($data, $fh, "");571 572 if (defined $fh)573 {574 print "DEBUG: Closing filehandle \"$datafilename\"...\n" if $DEBUG;575 close ($fh);576 }577 }578 579 sub munin_config {580 my $conffile = shift;581 $config = shift;582 $conffile ||= $configfile;583 $config = &munin_readconfig ($conffile);584 ::logger_open ($config->{logdir});585 my $data = &munin_readconfig("$config->{dbdir}/datafile", 1, 1);586 587 $data = &munin_overwrite($data,$config);588 return ($data);589 }590 272 591 273 sub munin_get_picture_filename { people/janl/src/libperl/Munin/Server.pm
r1247 r1251 3 3 use strict; 4 4 use RRDs; 5 use Munin; 6 use vars qw($configfile @legal %legal_expanded @copy_fields); 5 6 use Exporter; 7 8 use vars qw($configfile @legal %legal_expanded @copy_fields @ISA 9 @EXPORT $VERSION); 10 11 @ISA = qw(Munin Exporter); 12 13 @EXPORT= qw($configfile @legal %legal_expanded @copy_fields 14 munin_readconfig munin_parse_config 15 ); 7 16 8 17 $configfile='@@CONFDIR@@/munin.conf'; 9 18 10 @legal = ("tmpldir", "ncsa", "ncsa_server", "ncsa_config", "rundir", 11 "dbdir", "logdir", "htmldir", "include", "domain_order", "node_order", 12 "graph_sources", "fork", "special_stack", "special_sum", 13 "stack", "sum", "address", "htaccess", "warn", 14 "use_default_name", "use_node_name", "port", "graph_noscale", 15 "nsca", "nsca_server", "nsca_config", "extinfo", "fetch_data", 16 "filename", "max_processes", "nagios", "info", "graph_info", 17 "graph_category", "graph_strategy", "graph_width", 18 "graph_height", "graph_sums", "local_address", "compare", 19 "text", "command", "contact", "contacts", "max_messages", 20 "always_send", "notify_alias", "line", "state", "graph_period", 21 "cgiurl_graph", "cgiurl", "tls", "service_order", "category_order", 22 "version", "tls_certificate", "tls_private_key", "tls_pem", 23 "tls_verify_certificate", "tls_verify_depth", "graph_data_size", 24 25 ); 19 @legal = qw( 20 tmpldir ncsa ncsa_server ncsa_config rundir dbdir logdir 21 htmldir include domain_order node_order graph_sources fork 22 special_stack special_sum stack sum address htaccess warn 23 use_default_name use_node_name port graph_noscale nsca 24 nsca_server nsca_config extinfo fetch_data filename 25 max_processes nagios info graph_info graph_category 26 graph_strategy graph_width graph_height graph_sums 27 local_address compare text command contact contacts 28 max_messages always_send notify_alias line state 29 graph_period cgiurl_graph cgiurl tls service_order 30 category_order version tls_certificate tls_private_key 31 tls_pem tls_verify_certificate tls_verify_depth 32 graph_data_size 33 ); 26 34 27 35 push(@legal,@Munin::legalfetch,@Munin::legalconfig); 28 36 37 $VERSION='@@VERSION@@'; 29 38 30 39 %legal_expanded = map { $_ => 1 } @legal; … … 52 61 53 62 # Some important defaults before we return... 54 $config->{'rundir'} ||= "/tmp/";55 $config->{'dbdir'} ||= "/var/lib/munin/";56 $config->{'logdir'} ||= "/var/log/";57 $config->{'tmpldir'}||= "/etc/munin/templates/";58 $config->{'htmldir'}||= "@@HTMLDIR@@/";63 $config->{'rundir'} ||= '/tmp/'; 64 $config->{'dbdir'} ||= '@@DBDIR@@/'; 65 $config->{'logdir'} ||= '@@LOGDIR@@/'; 66 $config->{'tmpldir'}||= '@@CONFDIR@@/templates/'; 67 $config->{'htmldir'}||= '@@HTMLDIR@@/'; 59 68 return ($config); 60 69 } 61 70 62 sub munin_parse_config 63 { 71 sub munin_parse_config { 64 72 my $lines = shift; 65 73 my $hash = undef; … … 67 75 my $prevline = ""; 68 76 69 foreach my $line (@{$lines}) 70 { 77 foreach my $line (@{$lines}) { 71 78 chomp $line; 72 79 #$line =~ s/(^|[^\\])#.*/$1/g if $line =~ /#/; # Skip comments... 73 if ($line =~ /#/) 74 { 80 if ($line =~ /#/) { 75 81 next if ($line =~ /^#/); 76 82 $line =~ s/(^|[^\\])#.*/$1/g; 77 83 } 78 84 next unless ($line =~ /\S/); # And empty lines... 79 if (length $prevline) 80 { 85 if (length $prevline) { 81 86 $line = $prevline . $line; 82 87 $prevline = ""; 83 88 } 84 if ($line =~ /\\\\$/) 85 { 89 if ($line =~ /\\\\$/) { 86 90 $line =~ s/\\\\$/\\/; 87 } 88 elsif ($line =~ /\\$/) 89 { 91 } elsif ($line =~ /\\$/) { 90 92 ($prevline = $line) =~ s/\\$//; 91 93 next; … … 94 96 $line =~ s/^\s+//g; # And heading whitespace... 95 97 96 if ($line =~ /^\.(\S+)\s+(.+)\s*$/) 97 { 98 if ($line =~ /^\.(\S+)\s+(.+)\s*$/) { 98 99 my ($var, $val) = ($1, $2); 99 100 $hash = &munin_set_var_path ($hash, $var, $val); 100 } 101 elsif ($line =~ /^\s*\[([^\]]*)]\s*$/) 102 { 101 } elsif ($line =~ /^\s*\[([^\]]*)]\s*$/) { 103 102 $prefix = $1; 104 if ($prefix =~ /^([^:;]+);([^:;]+)$/) 105 { 103 if ($prefix =~ /^([^:;]+);([^:;]+)$/) { 106 104 $prefix .= ":"; 107 } 108 elsif ($prefix =~ /^([^:;]+);$/) 109 { 105 } elsif ($prefix =~ /^([^:;]+);$/) { 110 106 $prefix .= ""; 111 } 112 elsif ($prefix =~ /^([^:;]+);([^:;]+):(.*)$/) 113 { 107 } elsif ($prefix =~ /^([^:;]+);([^:;]+):(.*)$/) { 114 108 $prefix .= "."; 115 } 116 elsif ($prefix =~ /^([^:;]+)$/) 117 { 109 } elsif ($prefix =~ /^([^:;]+)$/) { 118 110 (my $domain = $prefix) =~ s/^[^\.]+\.//; 119 111 $prefix = "$domain;$prefix:"; 120 } 121 elsif ($prefix =~ /^([^:;]+):(.*)$/) 122 { 112 } elsif ($prefix =~ /^([^:;]+):(.*)$/) { 123 113 (my $domain = $prefix) =~ s/^[^\.]+\.//; 124 114 $prefix = "$domain;$prefix."; 125 115 } 126 } 127 elsif ($line =~ /^\s*(\S+)\s+(.+)\s*$/) 128 { 116 } elsif ($line =~ /^\s*(\S+)\s+(.+)\s*$/) { 129 117 my ($var, $val) = ($1, $2); 130 118 $hash = &munin_set_var_path ($hash, "$prefix$var", $val); 131 } 132 else 133 { 119 } else { 134 120 warn "Malformed configuration line \"$line\"."; 135 121 } … … 145 131 my $val = shift; 146 132 147 print "DEBUG: Getting var \"$var\" = \"$val\"\n" if $ DEBUG;133 print "DEBUG: Getting var \"$var\" = \"$val\"\n" if $::DEBUG; 148 134 if ($var =~ /^\s*([^;:]+);([^;:]+):(\S+)\s*$/) 149 135 { … … 199 185 my $val = shift; 200 186 201 print "DEBUG: Setting var \"$var\" = \"$val\"\n" if $ DEBUG;187 print "DEBUG: Setting var \"$var\" = \"$val\"\n" if $::DEBUG; 202 188 if ($var =~ /^\s*([^;:]+);([^:]+):(\S+)\s*$/) 203 189 { … … 304 290 { 305 291 next if "$pre$a" eq "version"; # Handled separately 306 print "Writing: $pre$a $data->{$a}\n" if $ DEBUG;292 print "Writing: $pre$a $data->{$a}\n" if $::DEBUG; 307 293 if ($data->{$a} =~ /\\$/) 308 294 { # Backslash as last char has special meaning. Avoid it. … … 314 300 } 315 301 } 302 303 316 304 sub munin_writeconfig { 317 305 my ($datafilename,$data,$fh) = @_; … … 335 323 if (defined $fh) 336 324 { 337 print "DEBUG: Closing filehandle \"$datafilename\"...\n" if $DEBUG; 325 print "DEBUG: Closing filehandle \"$datafilename\"...\n" 326 if $::DEBUG; 338 327 close ($fh); 339 328 } 340 329 } 341 330 342 sub munin_config {331 sub munin_config ($$) { 343 332 my $conffile = shift; 344 $config = shift;333 my $config = shift; 345 334 $conffile ||= $configfile; 346 335 $config = &munin_readconfig ($conffile); people/janl/src/server/munin-update
r1249 r1251 24 24 25 25 use strict; 26 #use IO::Socket;27 use lib "../ build/libperl";26 use IO::Socket; 27 use lib "../../build/libperl"; 28 28 use Munin; 29 30 # print "$VERSION"; 31 print "$Munin::VERSION\n"; 32 print "$Munin::CONFDIR\n"; 33 34 __END__ 35 29 use Munin::Server; 36 30 use Time::HiRes; 37 31 use RRDs; … … 40 34 use POSIX ":sys_wait_h"; 41 35 use Storable qw(fd_retrieve nstore_fd); 42 43 print "Confdir: ",$Munin::CONFDIR,"\n";44 exit 0;45 36 46 37 my $DEBUG=0;
